Commit Graph

14 Commits

Author SHA1 Message Date
Trent Nelson 5572d23efa
ci: deflake `Measurement` tests (#31812)
* measure: test timer and conversion separately

* measure: test `timing::duration_as_*()` directly...
2023-05-25 12:46:46 -06:00
Illia Bobyr 69dfd842c8
measure: `as_*`/`end_as_*` tests: Increase margins to 20% (#31635) 2023-05-15 18:38:27 -07:00
Illia Bobyr 1a71cd7fe2
measure: Measure::end_as{ns,us,ms,s,duration} (#30762)
In most cases, for a given `Measure` value, a `stop()` call must always be followed by a call to one of the `as_*()` methods. Combining them into a single function call makes the API a bit simpler.
2023-03-17 12:26:06 -07:00
behzad nouri 9524c9dbff patches errors from clippy::uninlined_format_args
https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
2022-12-06 19:32:15 +00:00
Brooks Prumo 85e383378a
Add `Measure::as_duration()` (#25942) 2022-06-14 07:15:28 -05:00
apfitzge e6c21a3036
Convert Measure::this to measure! and remove Measure::this (#25776)
* Remove the args param from Measure::this since we don't ever use it

* banking_stage.rs: convert to measure!

* poh_recorder.rs: convert to measure!

* cost_update_service.rs: convert to measure!

* poh_service.rs: convert to measure!

* bank.rs: convert to measure!

* measure.rs: Remove Measure::this now that all have been converted to measure!
2022-06-06 20:21:05 -05:00
Michael Vines b8837c04ec Reformat imports to a consistent style for imports
rustfmt.toml configuration:
  imports_granularity = "One"
  group_imports = "One"
2021-12-03 09:19:13 -08:00
Brooks Prumo 842ff774e6
Fix doc tests and examples for Measure::this() (#20833) 2021-10-21 10:07:02 -05:00
Brooks Prumo d1debcd971
Add incremental snapshot utils (#18504)
This commit adds high-level functions for creating and loading-from
incremental snapshots, plus all low-level functions required to perform
those tasks.  This commit **does not** add taking incremental snapshots
as part of a running validator, nor starting up a node with an
incremental snapshot; just laying ground work.

Additionally, `snapshot_utils` and `serde_snapshot` have been
refactored to use a common code paths for the different snapshots.

Also of note, some renaming has happened:
  1. Snapshots are now either `full_` or `incremental_` throughout the
     codebase.  If not specified, the code applies to both.
  2. Bank snapshots now are called "bank snapshots"
     (before they were called "slot snapshots", "bank snapshots", or
      just "snapshots").  The one exception is within `Bank`, where they
     are still just "snapshots", because they are already "bank
     snapshots".
  3. Snapshot archives now have `_archive` in the code.  This
     should clear up an ambiguity between bank snapshots and snapshot
     archives.
2021-07-22 14:40:37 -05:00
Alexander Meißner 6514096a67 chore: cargo +nightly clippy --fix -Z unstable-options 2021-06-18 10:42:46 -07:00
Brooks Prumo 7e5964e339
Add Measure::this() (#16953)
Use `Measure::this()` when you have a function that you want to measure.
`this()` will start a new `Measure`, call your function, stop the
measure, then return the `Measure` object along with your function's
return value.
2021-04-29 17:48:33 -05:00
Jeff Washington (jwash) 40997d0aef
add metrics for tick producer and poh_recorder (#15931) 2021-03-17 10:38:26 -05:00
Michael Vines 18a17cfbbf
Implement Display trait (#6929) 2019-11-13 11:44:07 -07:00
sakridge a89589a1d5
Add Measure abstraction over measuring time intervals (#4851)
Allows one to swap in different implementations. This provides
the normal Insant::now() -> .elapsed() path.
2019-06-29 15:34:49 +02:00