Skip to content

Commit 9a95fef

Browse files
committed
feat: add metric units
1 parent 227d96c commit 9a95fef

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

cSpell.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"Freebox",
6464
"Frostegård",
6565
"gecos",
66+
"Gibibytes",
6667
"Grcov",
6768
"hasher",
6869
"healthcheck",
@@ -87,6 +88,7 @@
8788
"kcachegrind",
8889
"kexec",
8990
"keyout",
91+
"Kibibytes",
9092
"kptr",
9193
"lcov",
9294
"leecher",
@@ -97,6 +99,7 @@
9799
"LOGNAME",
98100
"Lphant",
99101
"matchmakes",
102+
"Mebibytes",
100103
"metainfo",
101104
"middlewares",
102105
"misresolved",
@@ -159,6 +162,7 @@
159162
"Swiftbit",
160163
"taiki",
161164
"tdyne",
165+
"Tebibytes",
162166
"tempfile",
163167
"testcontainers",
164168
"thiserror",

packages/metrics/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ pub mod metric_collection;
66
pub mod prometheus;
77
pub mod sample;
88
pub mod sample_collection;
9+
pub mod unit;

packages/metrics/src/unit.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//! This module defines the `Unit` enum, which represents various units of
2+
//! measurement.
3+
//!
4+
//! The `Unit` enum is used to specify the unit of measurement for metrics.
5+
//!
6+
//! They were copied from the `metrics` crate, to allow future compatibility.
7+
pub enum Unit {
8+
Count,
9+
Percent,
10+
Seconds,
11+
Milliseconds,
12+
Microseconds,
13+
Nanoseconds,
14+
Tebibytes,
15+
Gibibytes,
16+
Mebibytes,
17+
Kibibytes,
18+
Bytes,
19+
TerabitsPerSecond,
20+
GigabitsPerSecond,
21+
MegabitsPerSecond,
22+
KilobitsPerSecond,
23+
BitsPerSecond,
24+
CountPerSecond,
25+
}

0 commit comments

Comments
 (0)