Skip to content
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

Enable per Block device metrics #4202

Merged
merged 6 commits into from
Nov 1, 2023

Conversation

sudanl0
Copy link
Contributor

@sudanl0 sudanl0 commented Oct 27, 2023

Changes

Add per device metrics for block device.

Reason

To add more granularity in block device metrics.

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

- [ ] If a specific issue led to this PR, this PR closes the issue.

  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
    - [ ] API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
    - [ ] New TODOs link to an issue.
  • Commits meet contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (ded9038) 82.92% compared to head (c27703e) 82.96%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4202      +/-   ##
==========================================
+ Coverage   82.92%   82.96%   +0.03%     
==========================================
  Files         221      222       +1     
  Lines       28235    28299      +64     
==========================================
+ Hits        23414    23477      +63     
- Misses       4821     4822       +1     
Flag Coverage Δ
4.14-c7g.metal 78.38% <94.91%> (+0.04%) ⬆️
4.14-m5d.metal 80.32% <94.91%> (+0.04%) ⬆️
4.14-m6a.metal 79.44% <94.91%> (+0.04%) ⬆️
4.14-m6g.metal 78.38% <94.91%> (+0.04%) ⬆️
4.14-m6i.metal 80.30% <94.91%> (+0.04%) ⬆️
5.10-c7g.metal 81.33% <96.61%> (+0.04%) ⬆️
5.10-m5d.metal 83.01% <96.61%> (+0.02%) ⬆️
5.10-m6a.metal 82.25% <96.61%> (+0.04%) ⬆️
5.10-m6g.metal 81.33% <96.61%> (+0.04%) ⬆️
5.10-m6i.metal 83.01% <96.61%> (+0.03%) ⬆️
6.1-c7g.metal 81.33% <96.61%> (+0.04%) ⬆️
6.1-m5d.metal 83.03% <96.61%> (+0.03%) ⬆️
6.1-m6a.metal 82.25% <96.61%> (+0.04%) ⬆️
6.1-m6g.metal 81.33% <96.61%> (+0.04%) ⬆️
6.1-m6i.metal 83.01% <96.61%> (+0.03%) ⬆️

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

Files Coverage Δ
src/vmm/src/devices/virtio/block/mod.rs 0.00% <ø> (ø)
src/vmm/src/devices/virtio/block/request.rs 96.80% <100.00%> (+0.17%) ⬆️
src/vmm/src/logger/metrics.rs 96.05% <100.00%> (-0.15%) ⬇️
src/vmm/src/devices/virtio/block/block_metrics.rs 98.38% <98.38%> (ø)
src/vmm/src/devices/virtio/block/device.rs 91.54% <84.21%> (+0.08%) ⬆️

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

@sudanl0 sudanl0 force-pushed the block_metrics branch 8 times, most recently from f2209b5 to 0ca2420 Compare October 27, 2023 23:34
@sudanl0 sudanl0 changed the title Block metrics Enable per Block device metrics Oct 27, 2023
@sudanl0 sudanl0 self-assigned this Oct 29, 2023
@sudanl0 sudanl0 added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Oct 29, 2023
src/vmm/src/logger/metrics.rs Outdated Show resolved Hide resolved
src/vmm/src/logger/metrics.rs Show resolved Hide resolved
tests/integration_tests/functional/test_metrics.py Outdated Show resolved Hide resolved
tests/integration_tests/functional/test_metrics.py Outdated Show resolved Hide resolved
src/vmm/src/devices/virtio/block/block_metrics.rs Outdated Show resolved Hide resolved
src/vmm/src/devices/virtio/block/block_metrics.rs Outdated Show resolved Hide resolved
src/vmm/src/devices/virtio/block/block_metrics.rs Outdated Show resolved Hide resolved
@sudanl0 sudanl0 force-pushed the block_metrics branch 4 times, most recently from 55fa526 to 5484ceb Compare October 30, 2023 17:13
@sudanl0 sudanl0 requested a review from kalyazin October 30, 2023 17:14
@sudanl0 sudanl0 force-pushed the block_metrics branch 3 times, most recently from cefa970 to 8e9fc96 Compare October 31, 2023 14:45
kalyazin
kalyazin previously approved these changes Oct 31, 2023
To prepare for per block device metrics:
- Move BlockDeviceMetrics from logger to Block module.
- Define a global buffer to put per device block metrics.

Signed-off-by: Sudan Landge <sudanl@amazon.com>
- Add metrics fs an field in Block{} to record metrics per block.
- Remove new() implementation of BlockDeviceMetrics since default
  is enough.
- For each block device added, allocate a metrics struct in global
  BLOCK_METRICS pool and save its pointer in Block::metrics.
- Use Block's self.metrics instead of the aggregated METRICS to
  record per device block metrics.
- Pass self.metrics to finish() and write_status_and_finish() to
  record per block device metrics.

Signed-off-by: Sudan Landge <sudanl@amazon.com>
Add a test that has multiple block devices and validate
aggregate block metrics.

Signed-off-by: Sudan Landge <sudanl@amazon.com>
Include per device block metrics in changelog.

Signed-off-by: Sudan Landge <sudanl@amazon.com>
Add unit test for block inc metrics and shared metrics.

Signed-off-by: Sudan Landge <sudanl@amazon.com>
test_cli_metrics_path and test_flush_metrics both validated breaking
change in FC metrics so move the validation functions to host_tools
which already had CI metrics related functions defined.

Signed-off-by: Sudan Landge <sudanl@amazon.com>
@sudanl0 sudanl0 merged commit 5502430 into firecracker-microvm:main Nov 1, 2023
6 of 7 checks passed
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.

None yet

3 participants