There are a few minor issues this change addresses:
1. When we send points to the `MetricsWriter` we are calling
`Instant::now()` twice, using the first result in the metrics stats,
and using the seconds value for `last_write_time`. Yet, on the next
upload, we would use `last_write_time` as a reference point.
We upload metrics using a network call, so it is far from
instantaneous. This creates a minor discrepancy in our time
reporting.
Good news is that we do not really need to call `Instant::now()`
twice at all, as we can use the same value for both stats and
`last_write_time`.
2. We did not report metrics stats if we did not have any points
accumulated. It seems better to always report metric stats,
including when no points have been accumulated. In practice, this
does not happen for the validator, as validators always report
something during a 10-second accumulation interval.
3. We did not upload any points when the metrics thread was existing.
This may cause a short number of metrics not to be reported.
4. `collect_points()` was always converting both `points` and `counters`
into a vector of `DataPoint`, even if the final length was over the
specified `max_points`. In the `mainnet-beta` we have values of up
to 5m points lost, so it could be a small optimization if we drop
them sooner.
* fix grammatical error in Incident Response Process section
* Fix typo in setup instructions
* Fixed grammatical errors in documentation: corrected article usage, pluralization, and singular form in database reference
* Fix typos in documentation: Correct 'In oder' to 'In order', fix 'enviroment' to 'environment', correct 'reults' to 'results' in Ping Results section, and change 'engress' to 'egress' in CUDA section.
* Fix grammatical errors in documentation
* Fix grammatical issues in documentation
Correct subject-verb agreement in transaction balance description and clarify execution of instructions in a transaction.
* allow pedantic invalid cast lint
* allow lint with false-positive triggered by `test-case` crate
* nightly `fmt` correction
* adapt to rust layout changes
* remove dubious test
* Use transmute instead of pointer cast and de/ref when check_aligned is false.
* Renames clippy::integer_arithmetic to clippy::arithmetic_side_effects.
* bump rust nightly to 2023-08-25
* Upgrades Rust to 1.72.0
---------
Co-authored-by: Trent Nelson <trent@solana.com>
Rust grammar allows trailing commas in most places where a list of
elements are accepted. It simplifies cases when the list is generated
by a macro, allowing the macro to avoid special cases for a one element
list vs longer lists.
As such, it is a common practice to allow trailing commas in macros as
well.
* introduce workspace.package
* introduce workspace.dependencies
* read version from root cargo.toml
* pass check when version = { workspace = true }
* don't bump version when version = { workspace = true }
* including workspace Cargo.toml when bump version
* programs/sbf use workspace inheritance
* fix increasing cargo version ignore program/sbf/Cargo.toml
* introduce workspace.package
* introduce workspace.dependencies
* read version from root cargo.toml
* pass check when version = { workspace = true }
* don't bump version when version = { workspace = true }
* including workspace Cargo.toml when bump version
* programs/sbf use workspace inheritance
* fix increasing cargo version ignore program/sbf/Cargo.toml
Tenets:
1. Limit thread names to 15 characters
2. Prefix all Solana-controlled threads with "sol"
3. Use Camel case. It's more character dense than Snake or Kebab case