Skip to content

Commit 00f5e0e

Browse files
committed
GHC 8.6 support.
1 parent 9a8e748 commit 00f5e0e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

System/Metrics.hs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,12 @@ sToMs s = round (s * 1000.0)
370370
--
371371
-- [@rts.gc.bytes_copied@] Number of bytes copied during GC
372372
--
373+
-- [@rts.gc.init_cpu_ms@] CPU time used by the init phase, in
374+
-- milliseconds. GHC 8.6+ only.
375+
--
376+
-- [@rts.gc.init_wall_ms@] Wall clock time spent running the init
377+
-- phase, in milliseconds. GHC 8.6+ only.
378+
--
373379
-- [@rts.gc.mutator_cpu_ms@] CPU time spent running mutator threads,
374380
-- in milliseconds. This does not include any profiling overhead or
375381
-- initialization.
@@ -423,6 +429,10 @@ registerGcMetrics store =
423429
, ("rts.gc.num_bytes_usage_samples" , Counter . fromIntegral . Stats.major_gcs)
424430
, ("rts.gc.cumulative_bytes_used" , Counter . fromIntegral . Stats.cumulative_live_bytes)
425431
, ("rts.gc.bytes_copied" , Counter . fromIntegral . Stats.copied_bytes)
432+
#if MIN_VERSION_base(4,12,0)
433+
, ("rts.gc.init_cpu_ms" , Counter . nsToMs . Stats.init_cpu_ns)
434+
, ("rts.gc.init_wall_ms" , Counter . nsToMs . Stats.init_elapsed_ns)
435+
#endif
426436
, ("rts.gc.mutator_cpu_ms" , Counter . nsToMs . Stats.mutator_cpu_ns)
427437
, ("rts.gc.mutator_wall_ms" , Counter . nsToMs . Stats.mutator_elapsed_ns)
428438
, ("rts.gc.gc_cpu_ms" , Counter . nsToMs . Stats.gc_cpu_ns)
@@ -491,6 +501,10 @@ emptyRTSStats = Stats.RTSStats
491501
, cumulative_par_max_copied_bytes = 0
492502
# if MIN_VERSION_base(4,11,0)
493503
, cumulative_par_balanced_copied_bytes = 0
504+
# if MIN_VERSION_base(4,12,0)
505+
, init_cpu_ns = 0
506+
, init_elapsed_ns = 0
507+
# endif
494508
# endif
495509
, mutator_cpu_ns = 0
496510
, mutator_elapsed_ns = 0

0 commit comments

Comments
 (0)