<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:00:49 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[DOCS-10546] Docs for SERVER-4786: Random sampling for profiling and logging</title>
                <link>https://jira.mongodb.org/browse/DOCS-10546</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;h1&gt;&lt;a name=&quot;DocumentationRequestSummary%3A&quot;&gt;&lt;/a&gt;Documentation Request Summary: &lt;/h1&gt;

&lt;ul&gt;
	&lt;li&gt;Extend the profile command documentation to mention sampleRate: &lt;a href=&quot;https://docs.mongodb.com/manual/reference/command/profile/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/reference/command/profile/&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;Update docs for the &lt;tt&gt;db.setProfilingLevel()&lt;/tt&gt; shell helper: &lt;a href=&quot;https://docs.mongodb.com/manual/reference/method/db.setProfilingLevel/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/reference/method/db.setProfilingLevel/&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;Possibly mention this in the Administration &amp;gt; MongoDB Performance page: &lt;a href=&quot;https://docs.mongodb.com/manual/administration/analyzing-mongodb-performance/#database-profiling&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/administration/analyzing-mongodb-performance/#database-profiling&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;Extend configuration file options docs for &lt;tt&gt;operationProfiling.slowOpSampleRate&lt;/tt&gt;: &lt;a href=&quot;https://docs.mongodb.com/manual/reference/configuration-options/#operationprofiling-options&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/reference/configuration-options/#operationprofiling-options&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;Add docs for the new &lt;tt&gt;--slowOpSampleRate&lt;/tt&gt; command line parameter here: &lt;a href=&quot;https://docs.mongodb.com/manual/reference/program/mongod/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/reference/program/mongod/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;&lt;a name=&quot;EngineeringTicketDescription%3A&quot;&gt;&lt;/a&gt;Engineering Ticket Description:&lt;/h1&gt;

&lt;p&gt;Add a new &lt;tt&gt;sampleRate&lt;/tt&gt; parameter to the profile command. This parameter can take values on the interval [0, 1], and is set to 1 by default on startup. The behavior of &lt;tt&gt;sampleRate&lt;/tt&gt; is as follows for logging:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;If the logLevel is 0, then we log a slow command that exceeds the &lt;tt&gt;slowms&lt;/tt&gt; with probability given by &lt;tt&gt;sampleRate&lt;/tt&gt;. Commands whose latency is less than &lt;tt&gt;slowms&lt;/tt&gt;, as before, are not logged.&lt;/li&gt;
	&lt;li&gt;If the logLevel is 1 or higher, then all commands are logged. The &lt;tt&gt;sampleRate&lt;/tt&gt; has no affect in this case.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;For creating &lt;tt&gt;system.profile&lt;/tt&gt; entries, the behavior of &lt;tt&gt;sampleRate&lt;/tt&gt; is as follows:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;If the profiling level is 0, then no profile entries are created and &lt;tt&gt;sampleRate&lt;/tt&gt; takes no affect.&lt;/li&gt;
	&lt;li&gt;If the profiling level is 1, then an operation exceeding &lt;tt&gt;slowms&lt;/tt&gt; is profiled with probability given by &lt;tt&gt;sampleRate&lt;/tt&gt;.&lt;/li&gt;
	&lt;li&gt;If the profiling level is 2, then all operations are profiled with probability given by &lt;tt&gt;sampleRate&lt;/tt&gt;, regardless of latency.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;There are three ways to set the profiler &lt;tt&gt;sampleRate&lt;/tt&gt;. The first is by running the &lt;tt&gt;profile&lt;/tt&gt; command. For example, the following command indicates that the server should profile 10% of operations slower than 30ms:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.runCommand({profile: 2, slowms: 30, sampleRate: 0.1});&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;This command will return the previous settings of &lt;tt&gt;profile&lt;/tt&gt;, &lt;tt&gt;slowms&lt;/tt&gt;, and &lt;tt&gt;sampleRate&lt;/tt&gt; on success. Like &lt;tt&gt;slowms&lt;/tt&gt;, the &lt;tt&gt;sampleRate&lt;/tt&gt; setting is unchanged when it is omitted from the command. The &lt;tt&gt;sampleRate&lt;/tt&gt; can also be set from the shell using the &lt;tt&gt;db.setProfilingLevel()&lt;/tt&gt; helper:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;db.setProfilingLevel(2, {slowms: 30, sampleRate: 0.1});&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;The second argument to this helper is now either the slowms value, or an options object.&lt;/p&gt;

&lt;p&gt;The second way to set &lt;tt&gt;sampleRate&lt;/tt&gt; is the new &lt;tt&gt;slowOpSampleRate&lt;/tt&gt; command line option:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;./mongod --profile 2 --slowms 30 --slowOpSampleRate 0.1&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Third, it can be set in a configuration file using &lt;tt&gt;operationProfiling.slowOpSampleRate&lt;/tt&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="405698">DOCS-10546</key>
            <summary>Docs for SERVER-4786: Random sampling for profiling and logging</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="nick.larew@mongodb.com">Nicholas Larew</assignee>
                                    <reporter username="emily.hall">Emily Hall</reporter>
                        <labels>
                            <label>neweng</label>
                            <label>profiling</label>
                    </labels>
                <created>Tue, 18 Jul 2017 18:33:04 +0000</created>
                <updated>Sun, 29 Oct 2023 13:59:26 +0000</updated>
                            <resolved>Wed, 17 Jan 2018 17:51:56 +0000</resolved>
                                                    <fixVersion>3.5.3</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1772672" author="xgen-internal-githook" created="Fri, 12 Jan 2018 14:05:54 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;nick.larew@10gen.com&apos;, &apos;name&apos;: &apos;Nick Larew&apos;, &apos;username&apos;: &apos;nlarew&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-10546&quot; title=&quot;Docs for SERVER-4786: Random sampling for profiling and logging&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-10546&quot;&gt;&lt;del&gt;DOCS-10546&lt;/del&gt;&lt;/a&gt;: random sampling for profiler/logging&lt;/p&gt;

&lt;p&gt;Signed-off-by: kay &amp;lt;kay.kim@10gen.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/118f439591272fc0cdbd520acdf6fcdb43f696d2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/118f439591272fc0cdbd520acdf6fcdb43f696d2&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                            <outwardlinks description="documents">
                                        <issuelink>
            <issuekey id="29214">SERVER-4786</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 12 Jan 2018 14:05:54 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 4 weeks, 5 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>DOCS-10575</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 4 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>emily.hall</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>nick.larew@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htb707:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|ht325j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="1324">KANBAN BUCKET</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htat2v:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                </customfields>
    </item>
</channel>
</rss>