Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clock implementation is faulty #271

Closed
SergeyKanzhelev opened this issue Aug 1, 2016 · 3 comments
Closed

Clock implementation is faulty #271

SergeyKanzhelev opened this issue Aug 1, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@SergeyKanzhelev
Copy link
Contributor

This clock implementation is faulty:
https://github.com/Microsoft/ApplicationInsights-dotnet/blob/1ccd5b466451db1884b242b6a58b3e9401a1fbcf/src/Core/Managed/Shared/Extensibility/Implementation/Clock.cs#L31

This implementation will accumulate error when windows adjusts time on the computer:

public DateTimeOffset Time 
{ 
    get { return InitialTimeStamp + OffsetStopwatch.Elapsed; } 
} 
@SergeyKanzhelev
Copy link
Contributor Author

Same in OperationWatch in server:

        public static DateTimeOffset Timestamp(long elapsedTicks)
        {
            // Stopwatch ticks are different from DateTime.Ticks. 
            // Each tick in the DateTime.Ticks value represents one 100-nanosecond interval. 
            // Each tick in the ElapsedTicks value represents the time interval equal to 
            // 1 second divided by the Frequency.
            return StartTime.AddTicks(Convert.ToInt64(elapsedTicks * HundredNanosecondsPerTick));
        }

@abaranch
Copy link
Contributor

abaranch commented Oct 7, 2016

CoreSDK fixed. OperationWatch is not fixed.

@cijothomas
Copy link
Contributor

Closing this issue as this is fixed for base sdk. For web sdk, new issue is opened: microsoft/ApplicationInsights-dotnet-server#286

TimothyMothra pushed a commit that referenced this issue Oct 25, 2019
TimothyMothra pushed a commit that referenced this issue Oct 25, 2019
Added additional variable to distinguish signing builds from develop builds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants