Follow new naming in GHC.Stats, add new stats
Fixes #29.
Based on #28 for GHC 8.6 compatibility.
I've tested it with:
- Stackage lts-12.17
- Stackage nightly-2018-11-08
Urgh, cumulative_par_balanced_copied_bytes has a missing @since 4.12.0.0 in https://downloads.haskell.org/~ghc/master/libraries/html/base/GHC-Stats.html, will fix.
Looks like the ekg package's Javascript also has to be updated, it refers to the old names and there's no compile-time check for that:
https://github.com/tibbe/ekg/blob/07ac776ef90b8d6f5629568a5a28d911a0e267b0/assets/monitor.js#L337
That's why all my graphs are empty if just applying this ekg-core patch, and all values in the top right are 0.
I think I'll do a GHC 8.6-compatible point release first, and then a major release with this change. ekg-statsd, ekg-json, and ekg may also require updates.
I think I'll do a GHC 8.6-compatible point release first, and then a major release with this change.
That sounds prudent to me.
ekg-statsd,ekg-json, andekgmay also require updates.
ekg for sure, I already have a branch that does this which I'm currently testing. The other two I'm not using so I might need some help with those.
I think I'll do a GHC 8.6-compatible point release first
This is now done.
Doesn't seem like a great idea to me. Can't we use new names with
base <4.10as well?
I have force-pushed to implement this suggestion (and also to address all other feedback). Now it translates the old API to the new field names.
For easy review comparison I have diffed the fields used by not(MIN_VERSION_base(4,10,0)) and MIN_VERSION_base(4,10,0) in meld, showing that the first is a subset of the other:

The change has now 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
ekg javascript/HTML PR at https://github.com/tibbe/ekg/pull/80
ekg-statsd,ekg-json, andekgmay also require updates.
ekg: https://github.com/tibbe/ekg/pull/80 (only needs a few fields renamed)ekg-json: seems to require no update, as it does not refer to any specific field namesekg-statsd: same
This PR seems worth resurrecting. There are now additional stats from base-4.14.1.0+ tracking the non moving GC. What is pending to get this across the line. How can I help?
The newer stats are
Stats.RTSStats
{ nonmoving_gc_sync_cpu_ns
, nonmoving_gc_sync_elapsed_ns
, nonmoving_gc_sync_max_elapsed_ns
, nonmoving_gc_cpu_ns
, nonmoving_gc_elapsed_ns
, nonmoving_gc_max_elapsed_ns
}
and
Stats.GCDetails
{ gcdetails_nonmoving_gc_sync_cpu_ns
, gcdetails_nonmoving_gc_sync_elapsed_ns
}
Gentle ping, another year later