mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
fix(telemetry): address Phase 2 code review findings
- Move node health attribute strings to compile-time constants in SpanNames.h (attr::nodeAmendmentBlocked, attr::nodeServerState) - Add Tempo search filters for node health attributes - Remove unnecessary .c_str() on strOperatingMode() return - Add samplingRatio clamping test (values > 1.0 and < 0.0) - Fix Task 2.3 status: delivered in Phase 1c, not Phase 2 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -106,3 +106,16 @@ TEST(TelemetryConfig, null_telemetry_factory)
|
||||
tel->start();
|
||||
tel->stop();
|
||||
}
|
||||
|
||||
TEST(TelemetryConfig, sampling_ratio_clamped)
|
||||
{
|
||||
Section section;
|
||||
section.set("sampling_ratio", "2.5");
|
||||
auto setup = telemetry::setup_Telemetry(section, "nHUtest123", "2.0.0", 0);
|
||||
EXPECT_DOUBLE_EQ(setup.samplingRatio, 1.0);
|
||||
|
||||
Section section2;
|
||||
section2.set("sampling_ratio", "-0.5");
|
||||
auto setup2 = telemetry::setup_Telemetry(section2, "nHUtest123", "2.0.0", 0);
|
||||
EXPECT_DOUBLE_EQ(setup2.samplingRatio, 0.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user