File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -571,6 +571,7 @@ let main1
571571 if tcConfig.showTimes then
572572 Caches.CacheMetrics.CaptureStatsAndWriteToConsole() |> disposables.Register
573573 Activity.Profiling.addConsoleListener () |> disposables.Register
574+ Caches.CacheMetrics.CaptureStatsAndWriteToConsole() |> disposables.Register
574575
575576 tcConfig.writeTimesToFile
576577 |> Option.iter ( fun f ->
Original file line number Diff line number Diff line change @@ -143,6 +143,15 @@ module CacheMetrics =
143143 Console.WriteLine( StatsToString())
144144 }
145145
146+ let CaptureStatsAndWriteToConsole () =
147+ let listener = ListenToAll()
148+
149+ { new IDisposable with
150+ member _.Dispose () =
151+ listener.Dispose()
152+ Console.WriteLine( StatsToString())
153+ }
154+
146155 // Currently the Cache emits telemetry for raw cache events: hits, misses, evictions etc.
147156 // This type observes those counters and keeps a snapshot of readings. It is used in tests and can be used to print cache stats in debug mode.
148157 type CacheMetricsListener ( cacheTags : TagList ) =
You can’t perform that action at this time.
0 commit comments