* chore(histogram): Simplify code by using std lib method
Leverage existing standard library method to simplify implementation. No changes to public API or MSRV.
Signed-off-by: Matheus <cardosaum@pm.me>
* refactor(histogram): Remove `duration_to_seconds` function
Signed-off-by: Matheus <cardosaum@pm.me>
* tests(histogram): Remove `duration_to_second` test
After removing the aforementioned method in a previous commit, this test became obsolete.
Signed-off-by: Matheus <cardosaum@pm.me>
---------
Signed-off-by: Matheus <cardosaum@pm.me>
Co-authored-by: Luca Bruno <lucab@lucabruno.net>
* feat!: upgrade to protobuf 3.7
- keep some of the `get_` and `set_` methods around and mark them as deprecated
- keep api changes to a minimal
Signed-off-by: Sven Kanoldt <sven+oss@d34dl0ck.me>
* fix: fix all issues related to api combatibility when the protobuf feature is not enabled
Signed-off-by: Sven Kanoldt <sven+oss@d34dl0ck.me>
* implement review feedback and close all minor remarks
Signed-off-by: Sven Kanoldt <sven+oss@d34dl0ck.me>
* fix ci errors
Signed-off-by: Sven Kanoldt <sven@d34dl0ck.me>
---------
Signed-off-by: Sven Kanoldt <sven+oss@d34dl0ck.me>
Signed-off-by: Sven Kanoldt <sven@d34dl0ck.me>
This is a pedantic lint added in 1.73.0. Because it occurs inside a
macro expansion, the lint is triggered from user code. The justification
given by the lint definition is:
> Matching with `()` explicitly instead of `_` outlines the fact that
> the pattern contains no data. Also it would detect a type change that
> `_` would ignore.
Removing the lint requires a trivial change. It does introduce the
possibility for compilation errors in the event the return type of the
function currently returning `()` changes, but that seems like more of a
benefit than a drawback. In these cases, it seems unlikely that the
return type in question will change in the future.
The user experience can be seen by linting the examples:
```
% cargo +nightly clippy --examples -- -A clippy::all -W clippy::ignored_unit_patterns -Z macro-backtrace
Compiling prometheus v0.13.3 (/home/matt/src/rust-prometheus)
...
warning: matching over `()` is more explicit
--> /home/matt/src/rust-prometheus/src/macros.rs:217:58
|
214 | macro_rules! register_counter {
| -----------------------------
| |
| in this expansion of `register_counter!` (#1)
| in this expansion of `register_counter!` (#2)
| in this expansion of `register_counter!` (#3)
...
217 | $crate::register(Box::new(counter.clone())).map(|_| counter)
| ^
...
221 | register_counter!(@of_type Counter, $OPTS)
| ------------------------------------------ in this macro invocation (#3)
...
225 | register_counter!(opts!($NAME, $HELP))
| -------------------------------------- in this macro invocation (#2)
|
::: examples/example_push.rs:16:40
|
16 | static ref PUSH_COUNTER: Counter = register_counter!(
| ________________________________________-
17 | | "example_push_total",
18 | | "Total number of prometheus client pushed."
19 | | )
| |_____- in this macro invocation (#1)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: requested on the command line with `-W clippy::ignored-unit-patterns`
...
```
Signed-off-by: Matt Weber <30441572+mweber15@users.noreply.github.com>
Co-authored-by: Luca Bruno <luca.bruno@coreos.com>
* ci: bump MSRV to fix test jobs
Signed-off-by: Luca BRUNO <lucab@lucabruno.net>
* src: fix new linting warnings
Signed-off-by: Luca BRUNO <lucab@lucabruno.net>
---------
Signed-off-by: Luca BRUNO <lucab@lucabruno.net>
The main thing here is an update on the GitHub side for what version
of Node is being used to stay ahead of their deprecation schedule.
Signed-off-by: Bruce Mitchener <bruce.mitchener@gmail.com>
This adds a new CI job to verify building with a minimum supported
Rust version (MSRV), currently set at 1.57.
This is done in preparation for a future edition-2021 switch.
Signed-off-by: Luca BRUNO <luca.bruno@coreos.com>
Signed-off-by: Luca BRUNO <luca.bruno@coreos.com>
* build(deps): update procfs requirement from ^0.12 to ^0.14
Updates the requirements on [procfs](https://github.com/eminence/procfs) to permit the latest version.
- [Release notes](https://github.com/eminence/procfs/releases)
- [Commits](https://github.com/eminence/procfs/compare/v0.12.0...v0.14.0)
---
updated-dependencies:
- dependency-name: procfs
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
* process: update to new procfs-0.14 API
Signed-off-by: Luca BRUNO <luca.bruno@coreos.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Luca BRUNO <luca.bruno@coreos.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luca BRUNO <luca.bruno@coreos.com>
The crate didn't compile on 32-bit targets any more due to
libc::sysconf() returning a 32-bit value on those targets.
Signed-off-by: Frank Denis <github@pureftpd.org>
A minor change, but previously the root-level re-export of
TEXT_FORMAT would require cfg(feature = "protobuf"), despite
the text export format not requiring protobufs. Since this is
the only location where TEXT_FORMAT is made public, it should
be exported regardless of protobuf feature availability.
Signed-off-by: Jeremy Rodi <me@telios.dev>
This simply retrieves and exports the value of the field from the
already populated that CPU, memory and start time are
sourced.
Signed-off-by: Alin Sinpalean <alin.sinpalean@gmail.com>