Commit 97e4c1b
feat: add
closes lambdaclass#350
## ποΈ Description / Motivation
Adds the `lean_tick_interval_duration_seconds` metric as defined in
leanMetrics PR
[lambdaclass#34](leanEthereum/leanMetrics#34). This tracks
the scheduling interval of the blockchain server loop.
## What Changed
* `crates/blockchain/src/lib.rs`: Added `last_tick_instant:
Option<Instant>` to `BlockChainServer` to measure elapsed time at the
top of `on_tick`.
* `crates/blockchain/src/metrics.rs`: Registered the histogram with
buckets from the spec.
* `docs/metrics.md`: Added the new metric to the documentation.
## Correctness / Behavior Guarantees
* Uses `std::time::Instant` (monotonic clock) rather than `SystemTime`
to avoid wall-clock/NTP drift bugs.
* Skips observation on the first tick.
## Tests Added / Run
* Ran `cargo test -p ethlambda-blockchain --lib` (19 passed).
## β
Verification Checklist
* [x] Ran `make fmt` β clean
* [x] Ran `make lint` (clippy with `-D warnings`) β clean
---------
Co-authored-by: TomΓ‘s GrΓΌner <47506558+MegaRedHand@users.noreply.github.com>lean_tick_interval_duration_seconds metric (lambdaclass#352)1 parent da95706 commit 97e4c1b
3 files changed
Lines changed: 32 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
126 | 130 | | |
127 | 131 | | |
128 | 132 | | |
129 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
130 | 140 | | |
131 | 141 | | |
132 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
305 | 307 | | |
306 | 308 | | |
307 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
308 | 322 | | |
309 | 323 | | |
310 | 324 | | |
| |||
417 | 431 | | |
418 | 432 | | |
419 | 433 | | |
| 434 | + | |
420 | 435 | | |
421 | 436 | | |
422 | 437 | | |
| |||
599 | 614 | | |
600 | 615 | | |
601 | 616 | | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
602 | 622 | | |
603 | 623 | | |
604 | 624 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
0 commit comments