<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:21:11 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>[CDRIVER-4526] bson_get_monotonic_time has 10-16 millisecond resolution on Windows</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-4526</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;h4&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;Summary&lt;/h4&gt;

&lt;p&gt;&lt;tt&gt;bson_get_monotonic_time()&lt;/tt&gt; uses &lt;a href=&quot;https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-gettickcount64&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;GetTickCount64&lt;/tt&gt;&lt;/a&gt; on Windows, which appears to have a resolution in the range of 10-16 milliseconds. This is actually quite a bit worse than what I originally assumed reading the libbson code, which implies that the returned value is just milliseconds.&lt;/p&gt;

&lt;p&gt;This came up while fixing some command monitoring tests on Windows for &lt;a href=&quot;https://jira.mongodb.org/browse/PHPC-2143&quot; title=&quot;Add Windows builds to GitHub Actions and publish DLLs for releases&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PHPC-2143&quot;&gt;&lt;del&gt;PHPC-2143&lt;/del&gt;&lt;/a&gt;. We had a few tests that assert a non-zero duration for a commandFailed or commandSucceeded event, and I noticed that these tests occasionally fail (presumably when the calculated duration is less than &lt;tt&gt;GetTickCount64&lt;/tt&gt;&apos;s resolution.&lt;/p&gt;

&lt;p&gt;Given this limitation, is there an alternative that would make more sense on Windows? Is command monitoring the only likely case where diffing two &lt;tt&gt;bson_get_monotonic_time()&lt;/tt&gt; return values might evaluate to zero? If not, perhaps &lt;tt&gt;bson_gettimeofday&lt;/tt&gt; would make a better fallback. &lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;Environment&quot;&gt;&lt;/a&gt;Environment&lt;/h4&gt;

&lt;ul&gt;
	&lt;li&gt;libmongoc 1.23.1&lt;/li&gt;
	&lt;li&gt;Windows Server 2019 64-bit&lt;/li&gt;
	&lt;li&gt;MSVC15 (Visual C++ 2017) x64&lt;/li&gt;
&lt;/ul&gt;


&lt;h4&gt;&lt;a name=&quot;HowtoReproduce&quot;&gt;&lt;/a&gt;How to Reproduce&lt;/h4&gt;

&lt;p&gt;Example script: &lt;a href=&quot;https://github.com/mongodb/mongo-php-driver/blob/1.14.2/tests/apm/commandSucceededEvent-001.phpt&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;commandSucceededEvent-001.phpt&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2187622">CDRIVER-4526</key>
            <summary>bson_get_monotonic_time has 10-16 millisecond resolution on Windows</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="jmikola@mongodb.com">Jeremy Mikola</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Nov 2022 14:46:07 +0000</created>
                <updated>Mon, 21 Nov 2022 20:07:49 +0000</updated>
                                                                            <component>APM</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2147582">PHPC-2143</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i11fnk:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>