Skip to content

Commit

Permalink
fix numeric format
Browse files Browse the repository at this point in the history
  • Loading branch information
MargaritaChe committed Dec 16, 2024
1 parent c976b19 commit 296b37c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Orc.Monitoring.Reporters.ReportOutputs;
namespace Orc.Monitoring.Reporters.ReportOutputs;

using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -118,7 +118,7 @@ public ReportItem UpdateReportItemEnding(MethodCallEnd end, IMethodCallReporter?
var endTime = end.TimeStamp;

reportItem.EndTime = endTime.ToString("yyyy-MM-dd HH:mm:ss.fff");
reportItem.Duration = (endTime - DateTime.Parse(reportItem.StartTime ?? string.Empty)).TotalMilliseconds.ToString("N1", CultureInfo.InvariantCulture);
reportItem.Duration = (endTime - DateTime.Parse(reportItem.StartTime ?? string.Empty)).TotalMilliseconds.ToString("F1", CultureInfo.InvariantCulture);
reportItem.Parameters = end.MethodCallInfo.Parameters ?? new Dictionary<string, string>();

_logger.LogDebug($"Updated report item: {reportItem.MethodName}, Id: {reportItem.Id}, StartTime: {reportItem.StartTime}, EndTime: {reportItem.EndTime}, Duration: {reportItem.Duration}ms");
Expand All @@ -133,7 +133,7 @@ public ReportItem CreateGapReportItem(CallGap gap, IMethodCallReporter? reporter
Id = Guid.NewGuid().ToString(),
StartTime = gap.TimeStamp.ToString("yyyy-MM-dd HH:mm:ss.fff"),
EndTime = (gap.TimeStamp + gap.Elapsed).ToString("yyyy-MM-dd HH:mm:ss.fff"),
Duration = gap.Elapsed.TotalMilliseconds.ToString("N1", CultureInfo.InvariantCulture),
Duration = gap.Elapsed.TotalMilliseconds.ToString("F1", CultureInfo.InvariantCulture),
Report = reporter?.FullName ?? string.Empty,
ThreadId = string.Empty,
Level = string.Empty,
Expand Down

0 comments on commit 296b37c

Please sign in to comment.