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

Correct a coercion bug in capture manager #1139

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lading/src/captures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,14 @@ impl CaptureManager {
// TODO we're allocating the same small strings over and over most likely
labels.insert(lbl.key().into(), lbl.value().into());
}
let value: f64 = f64::from_bits(counter.get_inner().load(Ordering::Relaxed));
let line = json::Line {
run_id: self.run_id,
time: now_ms,
fetch_index: self.fetch_index,
metric_name: key.name().into(),
metric_kind: json::MetricKind::Counter,
value: json::LineValue::Int(counter.get_inner().load(Ordering::Relaxed)),
value: json::LineValue::Float(value),
labels,
};
lines.push(line);
Expand All @@ -180,13 +181,14 @@ impl CaptureManager {
// TODO we're allocating the same small strings over and over most likely
labels.insert(lbl.key().into(), lbl.value().into());
}
let value: f64 = f64::from_bits(gauge.get_inner().load(Ordering::Relaxed));
let line = json::Line {
run_id: self.run_id,
time: now_ms,
fetch_index: self.fetch_index,
metric_name: key.name().into(),
metric_kind: json::MetricKind::Gauge,
value: json::LineValue::Int(gauge.get_inner().load(Ordering::Relaxed)),
value: json::LineValue::Float(value),
labels,
};
lines.push(line);
Expand Down
Loading