Follow new naming in GHC.Stats, add new stats#30
Follow new naming in GHC.Stats, add new stats#30nh2 wants to merge 2 commits intohaskell-github-trust:masterfrom
Conversation
|
Urgh, |
05d5332 to
caa5d68
Compare
|
Looks like the https://github.com/tibbe/ekg/blob/07ac776ef90b8d6f5629568a5a28d911a0e267b0/assets/monitor.js#L337 That's why all my graphs are empty if just applying this |
caa5d68 to
1da8410
Compare
|
I think I'll do a GHC 8.6-compatible point release first, and then a major release with this change. |
System/Metrics.hs
Outdated
| ]) | ||
| getRTSStats | ||
| #else | ||
| -- Pre base-4.10 we have the names from before GHC commit 24e6594cc7890babe69b8ba122d171affabad2d1. |
There was a problem hiding this comment.
Doesn't seem like a great idea to me. Can't we use new names with base <4.10 as well?
There was a problem hiding this comment.
Maybe, but then we'd have to put a new ifdef for that very version in which the old names were in place.
I didn't see the value in updating the EKG names for significantly older versions of base/ghc, but if you think there is one, I can try and do that.
There was a problem hiding this comment.
Our GHC support window is 3 years, otherwise I'd gladly drop support for base < 4.10.
System/Metrics.hs
Outdated
| -- @par_tot_bytes_copied@ divided by @par_max_bytes_copied@ approaches | ||
| -- 1 for a maximally sequential run and approaches the number of | ||
| -- threads (set by the RTS flag @-N@) for a maximally parallel run. | ||
| -- Registered counters (see "GHC.Stats" for their meanings: |
There was a problem hiding this comment.
I'd rather leave the old comment (adding "see also the GHC.Stats documentation" is fine).
There was a problem hiding this comment.
The old comment would have to be fully updated with the new fields, and that would be mostly copy-pasting stuff from GHC.Stats, so I'm not sure how useful that would be. In particular because that copy-paste easily gets outdated (like the thing in #29 (comment)).
There was a problem hiding this comment.
The old comment was also basically copy-paste. Since ekg tries to provide a uniform interface over a range of GHC versions, I think it's useful to have a comment describing the ekg view of the world. If the comment gets out of date due to changes in GHC, it means that our assumptions have changed and we may need to update other parts of library.
The issue in #29 (comment) appears to be caused by us trying to provide backwards compatibility.
There was a problem hiding this comment.
OK, done.
I've copied the new descriptions from https://hackage.haskell.org/package/base-4.12.0.0/docs/GHC-Stats.html.
|
|
||
| #if MIN_VERSION_base(4,10,0) | ||
| -- | Convert nanoseconds to milliseconds. | ||
| nsToMs :: Int64 -> Int64 |
There was a problem hiding this comment.
I don't think so, as I removed all usages of this function.
There was a problem hiding this comment.
I was rather thinking of clients breaking due to ms -> ns change. We should mention it in the changelog.
There was a problem hiding this comment.
Yes, the fields and their meanings definitely change completely.
That sounds prudent to me.
|
This is now done. |
For easier GHC compatibility testing.
1da8410 to
80bed30
Compare
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.
80bed30 to
db6bfe4
Compare
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 The change has now been tested on Stackage versions:
|
|
|
|
|
This PR seems worth resurrecting. There are now additional stats from |
|
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 |

Fixes #29.
Based on #28 for GHC 8.6 compatibility.
I've tested it with: