Skip to content

feat(metrics): store dimensions alongside metrics in store_data #5329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 31, 2025

Conversation

Manciukic
Copy link
Contributor

Changes

This patch changes the format of the metrics.json to add two keys: metrics, contanining the old dict of metrics, and dimensions, contiaining the dict of dimensions.
We're not storing all other properties as they are the same across all tests on the same executor and they can be fetched from test_result.json already, under "user_properties".

The metrics.json is not used anywhere in the codebase (except some downstream scripts), so this format change won't break anything.

Example:

{
  "metrics": {
    "throughput_guest_to_host": {
      "unit": "Bits/Second",
      "values": [
        1521035552.397601,
        1509913260.8668907,
        1516511907.9876878,
        1519015711.4238577,
        1521465457.3455591,
        1518696862.9045,
        1515518147.2383862,
        1522867838.40718,
        1527683628.617747,
        1541685794.8929434,
        1545028848.734238,
        1541926412.701195,
        1533085549.7164657,
        1530072366.862809,
        1526355028.8311164,
        1521260173.491227,
        1511490591.6653512,
        1546977580.4738607,
        1515960423.8909352
      ]
    },
    "throughput_host_to_guest": {
      "unit": "Bits/Second",
      "values": [
        5034717094.48179,
        5014916646.993628,
        5049309117.50637,
        5051670826.80042,
        5038316942.29528,
        5038833664,
        5040061261.798115,
        5011715459.06281,
        5031551121.01712,
        5092404817.727023,
        5082481599.609217,
        5080387407.336452,
        5072570762.918288,
        5071266247.682884,
        5081399296,
        5070318876.56711,
        5032219627.042276,
        5070049733.85223,
        5060680852.0309
      ]
    }
  },
  "dimensions": {
    "performance_test": "test_vsock_throughput",
    "payload_length": "64K",
    "mode": "bd",
    "instance": "m5n.metal",
    "cpu_model": "Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz",
    "host_kernel": "linux-5.10",
    "guest_kernel": "linux-5.10",
    "rootfs": "ubuntu-24.04.squashfs",
    "vcpus": "2",
    "guest_memory": "1024.0MB"
  }
}

Reason

In d6e5521b we added a metrics.json to dump all emitted metrics, but we don't add the dimensions to easily parse and know to know to what they refer.
We may want to switch our ab_test framework to switch using this file at some point, but that's not really needed.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • I have read and understand CONTRIBUTING.md.
  • I have run tools/devtool checkbuild --all to verify that the PR passes
    build checks on all supported architectures.
  • I have run tools/devtool checkstyle to verify that the PR passes the
    automated style checks.
  • I have described what is done in these changes, why they are needed, and
    how they are solving the problem in a clear and encompassing way.
  • I have updated any relevant documentation (both in code and in the docs)
    in the PR.
  • I have mentioned all user-facing changes in CHANGELOG.md.
  • If a specific issue led to this PR, this PR closes the issue.
  • When making API changes, I have followed the
    Runbook for Firecracker API changes.
  • I have tested all new and changed functionalities in unit tests and/or
    integration tests.
  • I have linked an issue to every new TODO.

  • This functionality cannot be added in rust-vmm.

Copy link

codecov bot commented Jul 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.03%. Comparing base (1dac3b6) to head (e0e262b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5329      +/-   ##
==========================================
+ Coverage   82.98%   83.03%   +0.05%     
==========================================
  Files         250      250              
  Lines       26837    26837              
==========================================
+ Hits        22271    22285      +14     
+ Misses       4566     4552      -14     
Flag Coverage Δ
5.10-c5n.metal 83.48% <ø> (ø)
5.10-m5n.metal 83.48% <ø> (ø)
5.10-m6a.metal 82.70% <ø> (-0.01%) ⬇️
5.10-m6g.metal 79.15% <ø> (ø)
5.10-m6i.metal 83.48% <ø> (ø)
5.10-m7a.metal-48xl 82.69% <ø> (?)
5.10-m7g.metal 79.15% <ø> (ø)
5.10-m7i.metal-24xl 83.44% <ø> (?)
5.10-m7i.metal-48xl 83.45% <ø> (?)
5.10-m8g.metal-24xl 79.14% <ø> (?)
5.10-m8g.metal-48xl 79.14% <ø> (?)
6.1-c5n.metal 83.53% <ø> (ø)
6.1-m5n.metal 83.53% <ø> (+<0.01%) ⬆️
6.1-m6a.metal 82.75% <ø> (ø)
6.1-m6g.metal 79.15% <ø> (ø)
6.1-m6i.metal 83.53% <ø> (ø)
6.1-m7a.metal-48xl 82.74% <ø> (?)
6.1-m7g.metal 79.15% <ø> (ø)
6.1-m7i.metal-24xl 83.55% <ø> (?)
6.1-m7i.metal-48xl 83.54% <ø> (?)
6.1-m8g.metal-24xl 79.13% <ø> (?)
6.1-m8g.metal-48xl 79.14% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

In d6e5521b we added a metrics.json to dump all emitted metrics, but we
don't add the dimensions to easily parse and know to know to what they
refer.
This patch changes the format of the metrics.json to add two keys:
metrics, contanining the old dict of metrics, and dimensions,
contiaining the dict of dimensions.
We're not storing all other properties as they are the same across all
tests on the same executor and they can be fetched from test_result.json
already, under "user_properties".

Signed-off-by: Riccardo Mancini <[email protected]>
@Manciukic Manciukic force-pushed the metric-properties branch from e875dc8 to 3d27c7b Compare July 25, 2025 14:02
@Manciukic Manciukic marked this pull request as ready for review July 29, 2025 15:21
@Manciukic Manciukic added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Jul 29, 2025
@Manciukic Manciukic merged commit c5ee60a into firecracker-microvm:main Jul 31, 2025
8 checks passed
@Manciukic Manciukic deleted the metric-properties branch July 31, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting review Indicates that a pull request is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants