-
Notifications
You must be signed in to change notification settings - Fork 649
[HFT Benchmark]: Add benchmark suite for Countersyncd #4016
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Janet Cui <[email protected]>
Signed-off-by: Janet Cui <[email protected]>
Signed-off-by: Janet Cui <[email protected]>
Signed-off-by: Janet Cui <[email protected]>
Signed-off-by: Janet Cui <[email protected]>
Signed-off-by: Janet Cui <[email protected]>
Signed-off-by: Janet Cui <[email protected]>
Signed-off-by: Janet Cui <[email protected]>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds OpenTelemetry metrics export functionality and a comprehensive benchmark suite to Countersyncd. The implementation enables SAI statistics to be converted to OpenTelemetry gauge formats and exported to OTLP collectors, along with extensive performance benchmarking capabilities to validate the HFT (High-Frequency Trading) requirements.
Key Changes:
- New OpenTelemetry message types and conversion pipeline (SAI → OTel → Protobuf)
- OtelActor for handling metric export with configurable console output and collector endpoints
- Comprehensive benchmark suite covering message conversions, actor throughput, IPFIX parsing, export performance, memory efficiency, and end-to-end pipelines
- CLI integration with optional OTel export flags and channel capacity configuration
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
crates/countersyncd/src/message/otel.rs |
Defines OpenTelemetry data structures and conversion logic from SAI statistics |
crates/countersyncd/src/actor/otel.rs |
Implements OtelActor for metrics export with protobuf conversion and gRPC client |
crates/countersyncd/src/main.rs |
Integrates OTel export with CLI arguments and actor orchestration |
crates/countersyncd/benches/*.rs |
Five comprehensive benchmark suites covering all aspects of the pipeline |
crates/countersyncd/Cargo.toml |
Adds OpenTelemetry, gRPC, and benchmarking dependencies |
Cargo.toml |
Workspace-level dependency additions |
Cargo.lock |
Dependency resolution with version locks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| // Test Arc cloning cost | ||
| group.bench_with_input( | ||
| BenchmarkId::new("arc_cloning", format("{}stats", message_size)), |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing exclamation mark in format macro call. Should be format! instead of format.
| BenchmarkId::new("arc_cloning", format("{}stats", message_size)), | |
| BenchmarkId::new("arc_cloning", format!("{}stats", message_size)), |
| pub struct OtelActor { | ||
| stats_receiver: Receiver<SAIStatsMessage>, | ||
| config: OtelActorConfig, | ||
| shutdown_notifier: Option<oneshot::Sender<()>>, |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The client field lacks documentation. Consider adding a doc comment explaining that this is a reusable gRPC client for exporting metrics to the OTLP collector.
| shutdown_notifier: Option<oneshot::Sender<()>>, | |
| shutdown_notifier: Option<oneshot::Sender<()>>, | |
| /// Reusable gRPC client for exporting metrics to the OTLP collector. |
| let observation_time_nano = 0u64; // 1970-01-01 00:00:00 UTC | ||
| let data_point = OtelDataPoint::from_sai_stat(&sai_stat, observation_time_nano); |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment '1970-01-01 00:00:00 UTC' is misleading since this is in the test. Consider using a more meaningful test timestamp constant or clarifying this is intentionally epoch zero for testing.
| let observation_time_nano = 0u64; // 1970-01-01 00:00:00 UTC | |
| let data_point = OtelDataPoint::from_sai_stat(&sai_stat, observation_time_nano); | |
| // Intentionally using epoch zero (1970-01-01 00:00:00 UTC) as test timestamp. | |
| const TEST_OBSERVATION_TIME_NANO_EPOCH: u64 = 0; | |
| let data_point = OtelDataPoint::from_sai_stat(&sai_stat, TEST_OBSERVATION_TIME_NANO_EPOCH); |
| counter: 5000, | ||
| }; | ||
|
|
||
| let observation_time_nano = 0u64; // 1970-01-01 00:00:00 UTC |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same misleading comment as line 235. Consider defining a test constant like TEST_EPOCH_TIMESTAMP to make the intent clearer.
| } | ||
| } | ||
|
|
||
| pub fn print_conversion_report(sai_stats: &SAIStats, otel_metrics: &OtelMetrics) { |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is declared as pub but is never called in the main code (only used in tests implicitly). Consider making it private or documenting its intended public use case.
| pub fn print_conversion_report(sai_stats: &SAIStats, otel_metrics: &OtelMetrics) { | |
| fn print_conversion_report(sai_stats: &SAIStats, otel_metrics: &OtelMetrics) { |
| /// Enable OpenTelemetry console output | ||
| #[arg( | ||
| long, | ||
| default_value = "true", |
Copilot
AI
Nov 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Default value for otel_console is 'true', which means console output is enabled by default when OTel is enabled. This could generate excessive log output in production. Consider defaulting to 'false' for production readiness.
| default_value = "true", | |
| default_value = "false", |
|
@Janetxxx , please fix the description per template and give details of the change |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
What I did
Why I did it
How I verified it
Details if related