Skip to content

Commit f28e5f7

Browse files
authored
Merge pull request #51 from nblumhardt/dev
3.0.1 Release
2 parents d3f69b4 + 4cbddad commit f28e5f7

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

src/SerilogTimings/CompletionBehaviour.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ enum CompletionBehaviour
2020
Complete,
2121
Silent
2222
}
23-
}
23+
}

src/SerilogTimings/Extensions/LoggerOperationExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
using System;
1615
using Serilog;
1716
using Serilog.Events;
1817
using SerilogTimings.Configuration;

src/SerilogTimings/Operation.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,19 @@ public enum Properties
5555
};
5656

5757
const string OutcomeCompleted = "completed", OutcomeAbandoned = "abandoned";
58-
static readonly long StopwatchToTimeSpanTicks = Stopwatch.Frequency / TimeSpan.TicksPerSecond;
58+
static readonly double StopwatchToTimeSpanTicks = (double)Stopwatch.Frequency / TimeSpan.TicksPerSecond;
5959

6060
ILogger _target;
6161
readonly string _messageTemplate;
6262
readonly object[] _args;
6363
readonly long _start;
6464
long? _stop;
6565

66-
IDisposable _popContext;
66+
readonly IDisposable _popContext;
6767
CompletionBehaviour _completionBehaviour;
6868
readonly LogEventLevel _completionLevel;
6969
readonly LogEventLevel _abandonmentLevel;
70-
private readonly TimeSpan? _warningThreshold;
70+
readonly TimeSpan? _warningThreshold;
7171
Exception? _exception;
7272

7373
internal Operation(ILogger target, string messageTemplate, object[] args,
@@ -87,7 +87,7 @@ internal Operation(ILogger target, string messageTemplate, object[] args,
8787

8888
static long GetTimestamp()
8989
{
90-
return Stopwatch.GetTimestamp() / StopwatchToTimeSpanTicks;
90+
return unchecked((long)(Stopwatch.GetTimestamp() / StopwatchToTimeSpanTicks));
9191
}
9292

9393
/// <summary>

src/SerilogTimings/SerilogTimings.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<Description>Extend Serilog with timed operations.</Description>
5-
<VersionPrefix>3.0.0</VersionPrefix>
5+
<VersionPrefix>3.0.1</VersionPrefix>
66
<Authors>nblumhardt;SerilogTimings Contributors</Authors>
77
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
88
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

test/SerilogTimings.Tests/OperationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public async Task TimingWithinOrderOfMagnitude(int delay)
246246
op.Dispose();
247247

248248
var elapsed = GetElapsedMilliseconds(logger);
249-
Assert.InRange(elapsed, delay * 0.5, delay * 5);
249+
Assert.InRange(elapsed, delay * 0.2, delay * 8);
250250
}
251251

252252
[Fact]

0 commit comments

Comments
 (0)