Skip to content

Add max GC pause to GHC.Stats/-t --machine-readable

Sometimes we're interested in latency of our programs. Often the upper highest percentiles are by garbage collector pauses due to stop-the-world implementation.

It seems that currently the only way to see the highest pause is to use the -s flag or alternatively -S. This is problematic in two scenarios:

  1. You don't have a human at the monitor parsing the -s output.
  2. You are unable to get the maximum pause statistic programmatically inside the program itself.

We do have -t -machine-readable which is nearly what I'd want but missing the actual pause information. Either that should include all the extra info from -s or -s should have machine-readable output format too.

There is the -S option which will print garbage collections as they happen. We could parse and manually track the highest pause time but it requires an external process and a parser. If you want to get that information back into the process then you have to do even more work.

GHC.Stats is of no help. It does not track or expose pause values. Even the "last GC info" APIs don't provide this (and they are not a solution anyway as you can only get info on last GC).

I would therefore like to request two similar features:

  • Add relevant information from -s to -t machine readable output or add machine readable format option to -s.
  • Add maximum pause information to GHC.Stats interface.
Trac metadata
Trac field Value
Version 8.2.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information