Skip to content

Commit

Permalink
chore: correct gibibyte spelling (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
etolbakov authored Aug 20, 2024
1 parent 3b55c14 commit 4116832
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion metrics-observer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ fn f64_data_to_displayable(value: f64, unit: Unit) -> String {
let offset = match unit {
Unit::Kibibytes => 1,
Unit::Mebibytes => 2,
Unit::Gigibytes => 3,
Unit::Gibibytes => 3,
Unit::Tebibytes => 4,
_ => 0,
};
Expand Down
18 changes: 9 additions & 9 deletions metrics/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ pub enum Unit {
Nanoseconds,
/// Tebibytes.
///
/// One tebibyte is equal to 1024 gigibytes.
/// One tebibyte is equal to 1024 gibibytes.
Tebibytes,
/// Gigibytes.
/// Gibibytes.
///
/// One gigibyte is equal to 1024 mebibytes.
Gigibytes,
/// One gibibyte is equal to 1024 mebibytes.
Gibibytes,
/// Mebibytes.
///
/// One mebibyte is equal to 1024 kibibytes.
Expand Down Expand Up @@ -133,7 +133,7 @@ impl Unit {
Unit::Microseconds => "microseconds",
Unit::Nanoseconds => "nanoseconds",
Unit::Tebibytes => "tebibytes",
Unit::Gigibytes => "gigibytes",
Unit::Gibibytes => "gibibytes",
Unit::Mebibytes => "mebibytes",
Unit::Kibibytes => "kibibytes",
Unit::Bytes => "bytes",
Expand Down Expand Up @@ -161,7 +161,7 @@ impl Unit {
Unit::Microseconds => "μs",
Unit::Nanoseconds => "ns",
Unit::Tebibytes => "TiB",
Unit::Gigibytes => "GiB",
Unit::Gibibytes => "GiB",
Unit::Mebibytes => "MiB",
Unit::Kibibytes => "KiB",
Unit::Bytes => "B",
Expand All @@ -186,7 +186,7 @@ impl Unit {
"microseconds" => Some(Unit::Microseconds),
"nanoseconds" => Some(Unit::Nanoseconds),
"tebibytes" => Some(Unit::Tebibytes),
"gigibytes" => Some(Unit::Gigibytes),
"gibibytes" => Some(Unit::Gibibytes),
"mebibytes" => Some(Unit::Mebibytes),
"kibibytes" => Some(Unit::Kibibytes),
"bytes" => Some(Unit::Bytes),
Expand All @@ -210,7 +210,7 @@ impl Unit {
matches!(
self,
Unit::Tebibytes
| Unit::Gigibytes
| Unit::Gibibytes
| Unit::Mebibytes
| Unit::Kibibytes
| Unit::Bytes
Expand Down Expand Up @@ -294,7 +294,7 @@ mod tests {
Unit::Microseconds,
Unit::Nanoseconds,
Unit::Tebibytes,
Unit::Gigibytes,
Unit::Gibibytes,
Unit::Mebibytes,
Unit::Kibibytes,
Unit::Bytes,
Expand Down

0 comments on commit 4116832

Please sign in to comment.