Add observation and ser/de metrics for serde calls - #5320
Conversation
7988eba to
a0c66b8
Compare
|
This PR introduces serde/observability wrapper macros (
macro_rules! json_from_slice {
($value:expr) => {{
let __bind = $value;
// ... records __bind.len() for metrics ...
$crate::observe!(serde_json::from_slice($value)) // BUG: should be from_slice(__bind)
}};
}
The docstring example: /// observe_with!(task(), |dt, location| {
/// if dt > Duration::from_secs(10) { ... }
/// });
...but the actual macro signature is
The doc comment opens a second Rustdoc will treat everything from that
No existing constant covers byte sizes, so a new one (e.g.,
The
|
ReviewReviewed the diff (JSON serde metrics wrapper macros in Bugs
macro_rules! json_from_slice {
($value:expr) => {{
let __bind = $value;
$crate::metrics::DESERIALIZE_SIZE...observe(__bind.len() as f64);
$crate::observe!(serde_json::from_slice($value)) // <- re-expands $value, not __bind
}};
}
CLAUDE.md conventionInline duplicate bucket array instead of a shared Minor / consistency
Other notes (not blocking)
Everything else (the mechanical |
|
🚅 Deployed to the rivet-pr-5320 environment in rivet-frontend
|
a0c66b8 to
9ff6358
Compare
No description provided.