Skip to content

Commit

Permalink
Update gh53564.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
davmason committed Mar 23, 2023
1 parent 0313b10 commit 664ae9c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tests/tracing/eventcounter/gh53564.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ protected override void OnEventSourceCreated(EventSource source)
// first set interval to 1 seconds
refreshInterval["EventCounterIntervalSec"] = "1";
EnableEvents(source, EventLevel.Informational, (EventKeywords)(-1), refreshInterval);
DisableEvents(source);

// wait a moment to get some events
Thread.Sleep(TimeSpan.FromSeconds(3));
Expand All @@ -41,6 +42,7 @@ protected override void OnEventSourceCreated(EventSource source)
Console.WriteLine($"[{DateTime.UtcNow:hh:mm:ss.fff}] OnEventSourceCreated :: Setting interval to 0");
refreshInterval["EventCounterIntervalSec"] = "0";
EnableEvents(source, EventLevel.Informational, (EventKeywords)(-1), refreshInterval);
DisableEvents(source);
setToZeroTimestamp = DateTime.UtcNow + TimeSpan.FromSeconds(1); // Stash timestamp 1 second after setting to 0
setToZero.Set();

Expand All @@ -49,6 +51,7 @@ protected override void OnEventSourceCreated(EventSource source)
Console.WriteLine($"[{DateTime.UtcNow:hh:mm:ss.fff}] OnEventSourceCreated :: Setting interval to 1");
refreshInterval["EventCounterIntervalSec"] = "1";
EnableEvents(source, EventLevel.Informational, (EventKeywords)(-1), refreshInterval);
DisableEvents(source);
}
}

Expand Down

0 comments on commit 664ae9c

Please sign in to comment.