You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GHC commit
24e6594cc7890babe69b8ba122d171affabad2d1
changed a lot of the stats names.
Until now, EKG stuck to the old names, which can be very confusing;
especially since some names were clearly misleading and have been
renamed in GHC consequentially.
This commit changes all names to the new names.
For base < 4.10, we translate the old API to their new equivalents
(multiplying to get nanoseconds as needed).
The added comment documents this translation.
The change has been tested on Stackage versions:
* lts-14.27 (GHC 8.6.5)
* nightly-2018-11-08 (GHC 8.6.1)
* lts-12.17 (GHC 8.4.4)
* lts-9.21 (ghc-8.0.2) -- this is base 4.9
This change may break some users that rely on the old names,
so a new major release should be made.
Copy file name to clipboardExpand all lines: System/Metrics.hs
+114-110
Original file line number
Diff line number
Diff line change
@@ -332,13 +332,10 @@ createDistribution name store = do
332
332
-- function.
333
333
334
334
#if MIN_VERSION_base(4,10,0)
335
-
--| Convert nanoseconds to milliseconds.
336
-
nsToMs::Int64->Int64
337
-
nsToMs s =round (realToFrac s / (1000000.0::Double))
338
335
#else
339
-
--| Convert seconds to milliseconds.
340
-
sToMs::Double->Int64
341
-
sToMs s =round (s *1000.0)
336
+
--| Convert seconds to nanoseconds.
337
+
sToNs::Double->Int64
338
+
sToNs s =round (s *1000000000.0)
342
339
#endif
343
340
344
341
--| Register a number of metrics related to garbage collector
@@ -355,121 +352,128 @@ sToMs s = round (s * 1000.0)
355
352
-- The runtime overhead of @-T@ is very small so it's safe to always
356
353
-- leave it enabled.
357
354
--
358
-
-- Registered counters:
359
-
--
360
-
-- [@rts.gc.bytes_allocated@] Total number of bytes allocated
361
-
--
362
-
-- [@rts.gc.num_gcs@] Number of garbage collections performed
363
-
--
364
-
-- [@rts.gc.num_bytes_usage_samples@] Number of byte usage samples taken
365
-
--
366
-
-- [@rts.gc.cumulative_bytes_used@] Sum of all byte usage samples, can be
367
-
-- used with @numByteUsageSamples@ to calculate averages with
368
-
-- arbitrary weighting (if you are sampling this record multiple
369
-
-- times).
370
-
--
371
-
-- [@rts.gc.bytes_copied@] Number of bytes copied during GC
372
-
--
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
-
--
379
-
-- [@rts.gc.mutator_cpu_ms@] CPU time spent running mutator threads,
380
-
-- in milliseconds. This does not include any profiling overhead or
381
-
-- initialization.
382
-
--
383
-
-- [@rts.gc.mutator_wall_ms@] Wall clock time spent running mutator
384
-
-- threads, in milliseconds. This does not include initialization.
385
-
--
386
-
-- [@rts.gc.gc_cpu_ms@] CPU time spent running GC, in milliseconds.
387
-
--
388
-
-- [@rts.gc.gc_wall_ms@] Wall clock time spent running GC, in
389
-
-- milliseconds.
390
-
--
391
-
-- [@rts.gc.cpu_ms@] Total CPU time elapsed since program start, in
392
-
-- milliseconds.
393
-
--
394
-
-- [@rts.gc.wall_ms@] Total wall clock time elapsed since start, in
395
-
-- milliseconds.
396
-
--
397
-
-- Registered gauges:
398
-
--
399
-
-- [@rts.gc.max_bytes_used@] Maximum number of live bytes seen so far
400
-
--
401
-
-- [@rts.gc.current_bytes_used@] Current number of live bytes
402
-
--
403
-
-- [@rts.gc.current_bytes_slop@] Current number of bytes lost to slop
404
-
--
405
-
-- [@rts.gc.max_bytes_slop@] Maximum number of bytes lost to slop at any one time so far
406
-
--
407
-
-- [@rts.gc.peak_megabytes_allocated@] Maximum number of megabytes allocated
408
-
--
409
-
-- [@rts.gc.par_tot_bytes_copied@] Number of bytes copied during GC, minus
410
-
-- space held by mutable lists held by the capabilities. Can be used
411
-
-- with 'parMaxBytesCopied' to determine how well parallel GC utilized
412
-
-- all cores.
413
-
--
414
-
-- [@rts.gc.par_avg_bytes_copied@] Deprecated alias for
415
-
-- @par_tot_bytes_copied@.
416
-
--
417
-
-- [@rts.gc.par_max_bytes_copied@] Sum of number of bytes copied each GC by
418
-
-- the most active GC thread each GC. The ratio of
419
-
-- @par_tot_bytes_copied@ divided by @par_max_bytes_copied@ approaches
420
-
-- 1 for a maximally sequential run and approaches the number of
421
-
-- threads (set by the RTS flag @-N@) for a maximally parallel run.
355
+
-- Registered counters (see also "GHC.Stats"):
356
+
--
357
+
-- > [@rts.gcs@] - Total number of GCs
358
+
-- > [@rts.major_gcs@] - Total number of major (oldest generation) GCs
359
+
-- > [@rts.allocated_bytes@] - Total bytes allocated
360
+
-- > [@rts.max_live_bytes@] - Maximum live data (including large objects + compact regions) in the heap. Updated after a major GC.
361
+
-- > [@rts.max_large_objects_bytes@] - Maximum live data in large objects
362
+
-- > [@rts.max_compact_bytes@] - Maximum live data in compact regions
363
+
-- > [@rts.max_slop_bytes@] - Maximum slop
364
+
-- > [@rts.max_mem_in_use_bytes@] - Maximum memory in use by the RTS
365
+
-- > [@rts.cumulative_live_bytes@] - Sum of live bytes across all major GCs. Divided by major_gcs gives the average live data over the lifetime of the program.
366
+
-- > [@rts.copied_bytes@] - Sum of copied_bytes across all GCs
367
+
-- > [@rts.par_copied_bytes@] - Sum of copied_bytes across all parallel GCs
368
+
-- > [@rts.cumulative_par_max_copied_bytes@] - Sum of par_max_copied_bytes across all parallel GCs. Deprecated.
369
+
-- > [@rts.cumulative_par_balanced_copied_bytes@] - Sum of par_balanced_copied bytes across all parallel GCs
370
+
-- > [@rts.init_cpu_ns@] - Total CPU time used by the init phase @since 4.12.0.0
371
+
-- > [@rts.init_elapsed_ns@] - Total elapsed time used by the init phase @since 4.12.0.0
372
+
-- > [@rts.mutator_cpu_ns@] - Total CPU time used by the mutator
373
+
-- > [@rts.mutator_elapsed_ns@] - Total elapsed time used by the mutator
374
+
-- > [@rts.gc_cpu_ns@] - Total CPU time used by the GC
375
+
-- > [@rts.gc_elapsed_ns@] - Total elapsed time used by the GC
376
+
-- > [@rts.cpu_ns@] - Total CPU time (at the previous GC)
377
+
-- > [@rts.elapsed_ns@] - Total elapsed time (at the previous GC)
378
+
-- > [@rts.gc.gen@] - The generation number of this GC
379
+
-- > [@rts.gc.threads@] - Number of threads used in this GC
380
+
-- > [@rts.gc.allocated_bytes@] - Number of bytes allocated since the previous GC
381
+
-- > [@rts.gc.live_bytes@] - Total amount of live data in the heap (incliudes large + compact data). Updated after every GC. Data in uncollected generations (in minor GCs) are considered live.
382
+
-- > [@rts.gc.large_objects_bytes@] - Total amount of live data in large objects
383
+
-- > [@rts.gc.compact_bytes@] - Total amount of live data in compact regions
384
+
-- > [@rts.gc.slop_bytes@] - Total amount of slop (wasted memory)
385
+
-- > [@rts.gc.mem_in_use_bytes@] - Total amount of memory in use by the RTS
386
+
-- > [@rts.gc.copied_bytes@] - Total amount of data copied during this GC
387
+
-- > [@rts.gc.par_max_copied_bytes@] - In parallel GC, the max amount of data copied by any one thread. Deprecated.
388
+
-- > [@rts.gc.sync_elapsed_ns@] - The time elapsed during synchronisation before GC
389
+
-- > [@rts.gc.cpu_ns@] - The CPU time used during GC itself
390
+
-- > [@rts.gc.elapsed_ns@] - The time elapsed during GC itself
0 commit comments