[go: up one dir, main page]

Skip to content

Include peak memory usage in JUnit reports

What

This MR causes --record-mem-peak to also record peak memory usage in JUnit reports in a <property>. The name of this property can be controlled with --junit-mem-peak.

Why

JUnit reports can in particular be sent to external tools such as DataDog which can display properties. By default we don't want to assume a particular tool, so we give the property a neutral name (memory.peak), but DataDog expects a name of the form dd_tags[...] so we give the option to specify it.

How

See https://docs.datadoghq.com/tests/setup/junit_xml/?tab=linux#providing-metadata-through-property-elements

Manually testing the MR

$ dune exec test/unix/main.exe -- --record-mem-peak --junit junit.xml -j 2 --mem-poll-frequency 10000
$ grep memory.peak junit.xml
$ dune exec test/unix/main.exe -- --record-mem-peak --junit junit.xml -j 2 --mem-poll-frequency 10000 --junit-mem-peak 'dd_tags[mempeak]'
$ grep dd_tags junit.xml

Checklist

  • Update CHANGES.md. No need to document changes to documentation and tests.
  • Make sure all new values, types etc. are documented in .mli files and that the generated documentation looks ok.
  • Add tests in test/, if relevant.

Merge request reports

Loading