Skip to content

Commit d1239e2

Browse files
committed
add some more fields to the empty structures as well as the outputs.
1 parent 4f6b7d0 commit d1239e2

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

System/Metrics.hs

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,10 @@ createDistribution name store = do
388388
--
389389
-- [@rts.gc.max_bytes_used@] Maximum number of live bytes seen so far
390390
--
391+
-- [@rts.gc.max_large_bytes_used@] Maximum number of live bytes seen so far just in large ojects
392+
--
393+
-- [@rts.gc.max_compact_bytes_used@] Maximum number of live bytes seen so far just in compact regions
394+
--
391395
-- [@rts.gc.current_bytes_used@] Current number of live bytes
392396
--
393397
-- [@rts.gc.current_bytes_slop@] Current number of bytes lost to slop
@@ -408,7 +412,22 @@ createDistribution name store = do
408412
-- the most active GC thread each GC. The ratio of
409413
-- @par_tot_bytes_copied@ divided by @par_max_bytes_copied@ approaches
410414
-- 1 for a maximally sequential run and approaches the number of
411-
-- threads (set by the RTS flag @-N@) for a maximally parallel run.
415+
-- threads (set by the RTS flag @-N@) for a maximally parallel run. Deprecated by
416+
-- GHC in later versions.
417+
--
418+
-- [@rts.gc.par_balanced_bytes_copied@] Sum of balanced data copied by all threads in parallel GC, across all parallel GCs.
419+
--
420+
-- [@rts.gc.nm.sync_cpu_ms@] The total CPU time used during the post-mark pause phase of the concurrent nonmoving GC.
421+
--
422+
-- [@rts.gc.nm.sync_elapsed_ms@] The total time elapsed during the post-mark pause phase of the concurrent nonmoving GC.
423+
--
424+
-- [@rts.gc.nm.sync_max_elapsed_ms@] The maximum elapsed length of any post-mark pause phase of the concurrent nonmoving GC.
425+
--
426+
-- [@rts.gc.nm.cpu_ms@] The total CPU time used by the nonmoving GC.
427+
--
428+
-- [@rts.gc.nm.elapsed_ms@] The total time elapsed during which there is a nonmoving GC active.
429+
--
430+
-- [@rts.gc.nm.max_elapsed_ms@] The maximum time elapsed during any nonmoving GC cycle.
412431
registerGcMetrics :: Store -> IO ()
413432
registerGcMetrics =
414433
registerGroup
@@ -430,13 +449,26 @@ registerGcMetrics =
430449
, ("rts.gc.cpu_ms" , Counter . nsToMs . Stats.cpu_ns)
431450
, ("rts.gc.wall_ms" , Counter . nsToMs . Stats.elapsed_ns)
432451
, ("rts.gc.max_bytes_used" , Gauge . fromIntegral . Stats.max_live_bytes)
452+
, ("rts.gc.max_large_bytes_used" , Gauge . fromIntegral . Stats.max_large_objects_bytes)
453+
, ("rts.gc.max_compact_bytes_used" , Gauge . fromIntegral . Stats.max_compact_bytes)
433454
, ("rts.gc.current_bytes_used" , Gauge . fromIntegral . Stats.gcdetails_live_bytes . Stats.gc)
434455
, ("rts.gc.current_bytes_slop" , Gauge . fromIntegral . Stats.gcdetails_slop_bytes . Stats.gc)
435456
, ("rts.gc.max_bytes_slop" , Gauge . fromIntegral . Stats.max_slop_bytes)
436457
, ("rts.gc.peak_megabytes_allocated" , Gauge . fromIntegral . (`quot` (1024*1024)) . Stats.max_mem_in_use_bytes)
437458
, ("rts.gc.par_tot_bytes_copied" , Gauge . fromIntegral . Stats.par_copied_bytes)
438459
, ("rts.gc.par_avg_bytes_copied" , Gauge . fromIntegral . Stats.par_copied_bytes)
439460
, ("rts.gc.par_max_bytes_copied" , Gauge . fromIntegral . Stats.cumulative_par_max_copied_bytes)
461+
#if MIN_VERSION_base(4,11,0)
462+
, ("rts.gc.par_balanced_bytes_copied", Gauge . fromIntegral . Stats.cumulative_par_balanced_copied_bytes)
463+
#if MIN_VERSION_base(4,15,0)
464+
, ("rts.gc.nm.sync_cpu_ms" , Counter . nsToMs . Stats.nonmoving_gc_sync_cpu_ns)
465+
, ("rts.gc.nm.sync_elapsed_ms" , Counter . nsToMs . Stats.nonmoving_gc_sync_elapsed_ns)
466+
, ("rts.gc.nm.sync_max_elapsed_ms" , Counter . nsToMs . Stats.nonmoving_gc_sync_max_elapsed_ns)
467+
, ("rts.gc.nm.cpu_ms" , Counter . nsToMs . Stats.nonmoving_gc_cpu_ns)
468+
, ("rts.gc.nm.elapsed_ms" , Counter . nsToMs . Stats.nonmoving_gc_elapsed_ns)
469+
, ("rts.gc.nm.max_elapsed_ms" , Counter . nsToMs . Stats.nonmoving_gc_max_elapsed_ns)
470+
# endif
471+
# endif
440472
])
441473
getRTSStats
442474
where
@@ -501,6 +533,14 @@ emptyRTSStats = Stats.RTSStats
501533
# if MIN_VERSION_base(4,12,0)
502534
, init_cpu_ns = 0
503535
, init_elapsed_ns = 0
536+
# if MIN_VERSION_base(4,15,0)
537+
, nonmoving_gc_sync_cpu_ns = 0
538+
, nonmoving_gc_sync_elapsed_ns = 0
539+
, nonmoving_gc_sync_max_elapsed_ns = 0
540+
, nonmoving_gc_cpu_ns = 0
541+
, nonmoving_gc_elapsed_ns = 0
542+
, nonmoving_gc_max_elapsed_ns = 0
543+
# endif
504544
# endif
505545
# endif
506546
, mutator_cpu_ns = 0
@@ -526,6 +566,13 @@ emptyGCDetails = Stats.GCDetails
526566
, gcdetails_par_max_copied_bytes = 0
527567
# if MIN_VERSION_base(4,11,0)
528568
, gcdetails_par_balanced_copied_bytes = 0
569+
# if MIN_VERSION_base(4,15,0)
570+
, gcdetails_nonmoving_gc_sync_cpu_ns = 0
571+
, gcdetails_nonmoving_gc_sync_elapsed_ns = 0
572+
# if MIN_VERSION_base(4,18,0)
573+
, gcdetails_block_fragmentation_bytes = 0
574+
# endif
575+
# endif
529576
# endif
530577
, gcdetails_sync_elapsed_ns = 0
531578
, gcdetails_cpu_ns = 0

cabal.haskell-ci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
distribution: jammy

0 commit comments

Comments
 (0)