"version": 2` is emitted but nothing says what it means or when it changes, so it cannot be relied on. That is how the two backends came to emit different key sets while both claiming version 2, which #117 fixes.
Proposed policy, which is what the fixes in #117 already assume:
- The key set is the same for every supported OCaml version. A backend that cannot compute a value emits the key with
null. null means "not available on this runtime", 0 means "measured as zero".
- A key means the same thing everywhere, across backends and across the human-readable and JSON output.
- Consumers must ignore keys they do not recognise, which is what makes adding a key non-breaking.
version bumps only on a breaking change: removing a key, renaming it, changing its type, or changing its definition.
By rule 4, #117 is a breaking change, since total_heap on the 5.0 backend goes from a number to null. Folding it into version 2 rather than bumping seems fine: the version field was added in f505bf6, three days after 0.5.4 was tagged, so no released version emits one at all and nothing on opam has ever seen version 1 or 2.
A short section in the README would be the best place for this, and gives somewhere to record what the keys mean and their units, which is not written down anywhere today.
"version": 2` is emitted but nothing says what it means or when it changes, so it cannot be relied on. That is how the two backends came to emit different key sets while both claiming version 2, which #117 fixes.
Proposed policy, which is what the fixes in #117 already assume:
null.nullmeans "not available on this runtime",0means "measured as zero".versionbumps only on a breaking change: removing a key, renaming it, changing its type, or changing its definition.By rule 4, #117 is a breaking change, since
total_heapon the 5.0 backend goes from a number tonull. Folding it into version 2 rather than bumping seems fine: the version field was added in f505bf6, three days after 0.5.4 was tagged, so no released version emits one at all and nothing on opam has ever seen version 1 or 2.A short section in the README would be the best place for this, and gives somewhere to record what the keys mean and their units, which is not written down anywhere today.