Skip to content

Commit 0a6f713

Browse files
benmwatsonBen Watson
andauthored
Fix bug. Can't have TimeSpan in event source. (#271)
Co-authored-by: Ben Watson <bewatson@microsoft.com>
1 parent 27f27f4 commit 0a6f713

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Events.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ---------------------------------------------------------------------
1+
// ---------------------------------------------------------------------
22
// Copyright (c) 2015 Microsoft
33
//
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -89,15 +89,15 @@ public void MemoryStreamCreated(Guid guid, string tag, long requestedSize, long
8989
/// </summary>
9090
/// <param name="guid">A unique ID for this stream.</param>
9191
/// <param name="tag">A temporary ID for this stream, usually indicates current usage.</param>
92-
/// <param name="lifetime">Lifetime of the stream</param>
92+
/// <param name="lifetimeMs">Lifetime in milliseconds of the stream</param>
9393
/// <param name="allocationStack">Call stack of initial allocation.</param>
9494
/// <param name="disposeStack">Call stack of the dispose.</param>
9595
[Event(2, Level = EventLevel.Verbose, Version = 3)]
96-
public void MemoryStreamDisposed(Guid guid, string tag, TimeSpan lifetime, string allocationStack, string disposeStack)
96+
public void MemoryStreamDisposed(Guid guid, string tag, long lifetimeMs, string allocationStack, string disposeStack)
9797
{
9898
if (this.IsEnabled(EventLevel.Verbose, EventKeywords.None))
9999
{
100-
WriteEvent(2, guid, tag ?? string.Empty, lifetime, allocationStack ?? string.Empty, disposeStack ?? string.Empty);
100+
WriteEvent(2, guid, tag ?? string.Empty, lifetimeMs, allocationStack ?? string.Empty, disposeStack ?? string.Empty);
101101
}
102102
}
103103

src/RecyclableMemoryStreamManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ---------------------------------------------------------------------
1+
// ---------------------------------------------------------------------
22
// Copyright (c) 2015-2016 Microsoft
33
//
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -667,7 +667,7 @@ internal void ReportStreamCreated(Guid id, string tag, long requestedSize, long
667667

668668
internal void ReportStreamDisposed(Guid id, string tag, TimeSpan lifetime, string allocationStack, string disposeStack)
669669
{
670-
Events.Writer.MemoryStreamDisposed(id, tag, lifetime, allocationStack, disposeStack);
670+
Events.Writer.MemoryStreamDisposed(id, tag, (long)lifetime.TotalMilliseconds, allocationStack, disposeStack);
671671
this.StreamDisposed?.Invoke(this, new StreamDisposedEventArgs(id, tag, lifetime, allocationStack, disposeStack));
672672
}
673673

0 commit comments

Comments
 (0)