Skip to content

Conversation

millillitre
Copy link
Contributor

@millillitre millillitre commented Sep 2, 2025

Quarch Plugin: disk power consumption measurement

Context

This PR introduces a new Alumet plugin for measuring disk power consumption using a Quarch Power Analysis Module. The plugin provides real-time power monitoring in watts and is designed to work with Grid'5000 nodes (e.g., yeti-4 in Grenoble) or any other devices connected to a Quarch Module.

Changes

  1. lib.rs:

    • Main implementation of the Quarch plugin for Alumet.
    • Includes an averaging table to map the desired polling interval to the closest supported sample rate on the Quarch device.
  2. source.rs:

    • Implements the source functionality for the plugin, rewritten in Rust (inspired by the Python library quarchpy and these examples).
    • Features thread-safe QuarchSource for shared access and TCP-based communication with the Quarch device.

Development Practices

  • Linting: Applied cargo fmt --check && cargo clippy -p plugin-quarch -- --no-deps successfully.
  • Testing: The plugin has been tested successfully in both debug and release modes across various nodes of Grenoble Grid'5000 cluster.
  • Error Management: Used anyhow for simple error management and PollError for source error management.
  • Logging: Used the log crate for logging messages.

@millillitre
Copy link
Contributor Author

millillitre commented Sep 5, 2025

I don't know why, I just rebased to the last commits on the main branch to update and checks won't pass anymore (like #272).

@millillitre millillitre force-pushed the feature/quarch branch 7 times, most recently from 96bba49 to 9ffaccb Compare September 11, 2025 12:45
@AngeCyp AngeCyp self-requested a review September 11, 2025 21:53
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this nice README, please could you adjust your README to follow the template:

https://github.com/alumet-dev/alumet/blob/main/readme/SOURCE_PLUGIN_README_TEMPLATE.md

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve updated the README to match the official template but I am not sure it will be enough for you since I only updated metrics part; let me know if anything still doesn’t align, i will change it!

Comment on lines 79 to 80
.flush_interval(self.config.flush_interval)
.update_interval(self.config.flush_interval)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it relevant to make a difference between both ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’re right, there’s no need to keep both if they serve the same purpose. I merge them into a single interval (only flush_interval).

Comment on lines 93 to 99
fn pre_pipeline_start(&mut self, _alumet: &mut alumet::plugin::AlumetPreStart) -> anyhow::Result<()> {
Ok(())
}

fn post_pipeline_start(&mut self, _alumet: &mut AlumetPostStart) -> anyhow::Result<()> {
Ok(())
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are they needed as you return Ok(()) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these hooks won’t be used, I removed them entirely to keep the codebase clean.

let _ = child.kill();
let _ = child.wait();
}
let _ = std::process::Command::new("pkill")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is pkill always available ? I mean i always use kill because i always found the command as available without the need to install it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I didn't thought about that! I have replaced the code of the stop hook with a cross-platform approach using kill instead of pkill and conditional compilation for Unix.

@millillitre millillitre requested a review from AngeCyp September 15, 2025 07:24
@millillitre millillitre force-pushed the feature/quarch branch 8 times, most recently from 333202d to 1865f83 Compare September 15, 2025 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants