Skip to content

Commit

Permalink
Introduced IEC-compliant unit abbreviations netdata#4711 (netdata#4912)
Browse files Browse the repository at this point in the history
* Introduced IEC-compliant unit abbreviations netdata#4711

* Generated dashboard.js

* Reverted the old abbreviations to a x1000 coefficient

* Reverted coefficients
  • Loading branch information
gmosx authored Dec 11, 2018
1 parent f16827d commit fe70512
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 10 deletions.
41 changes: 36 additions & 5 deletions web/gui/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -806,13 +806,20 @@ NETDATA.unitsConversion = {
'GB/s': 1024 * 1024,
'TB/s': 1024 * 1024 * 1024
},
'KiB/s': {
'B/s': 1 / 1024,
'KiB/s': 1,
'MiB/s': 1024,
'GiB/s': 1024 * 1024,
'TiB/s': 1024 * 1024 * 1024
},
'B': {
'B': 1,
'KB': 1024,
'MB': 1024 * 1024,
'GB': 1024 * 1024 * 1024,
'TB': 1024 * 1024 * 1024 * 1024,
'PB': 1024 * 1024 * 1024 * 1024 * 1024
'KiB': 1024,
'MiB': 1024 * 1024,
'GiB': 1024 * 1024 * 1024,
'TiB': 1024 * 1024 * 1024 * 1024,
'PiB': 1024 * 1024 * 1024 * 1024 * 1024
},
'KB': {
'B': 1 / 1024,
Expand All @@ -821,6 +828,13 @@ NETDATA.unitsConversion = {
'GB': 1024 * 1024,
'TB': 1024 * 1024 * 1024
},
'KiB': {
'B': 1 / 1024,
'KiB': 1,
'MiB': 1024,
'GiB': 1024 * 1024,
'TiB': 1024 * 1024 * 1024
},
'MB': {
'B': 1 / (1024 * 1024),
'KB': 1 / 1024,
Expand All @@ -829,6 +843,14 @@ NETDATA.unitsConversion = {
'TB': 1024 * 1024,
'PB': 1024 * 1024 * 1024
},
'MiB': {
'B': 1 / (1024 * 1024),
'KiB': 1 / 1024,
'MiB': 1,
'GiB': 1024,
'TiB': 1024 * 1024,
'PiB': 1024 * 1024 * 1024
},
'GB': {
'B': 1 / (1024 * 1024 * 1024),
'KB': 1 / (1024 * 1024),
Expand All @@ -837,6 +859,15 @@ NETDATA.unitsConversion = {
'TB': 1024,
'PB': 1024 * 1024,
'EB': 1024 * 1024 * 1024
},
'GiB': {
'B': 1 / (1024 * 1024 * 1024),
'KiB': 1 / (1024 * 1024),
'MiB': 1 / 1024,
'GiB': 1,
'TiB': 1024,
'PiB': 1024 * 1024,
'EiB': 1024 * 1024 * 1024
}
/*
'milliseconds': {
Expand Down
41 changes: 36 additions & 5 deletions web/gui/src/dashboard.js/units-conversion.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,20 @@ NETDATA.unitsConversion = {
'GB/s': 1024 * 1024,
'TB/s': 1024 * 1024 * 1024
},
'KiB/s': {
'B/s': 1 / 1024,
'KiB/s': 1,
'MiB/s': 1024,
'GiB/s': 1024 * 1024,
'TiB/s': 1024 * 1024 * 1024
},
'B': {
'B': 1,
'KB': 1024,
'MB': 1024 * 1024,
'GB': 1024 * 1024 * 1024,
'TB': 1024 * 1024 * 1024 * 1024,
'PB': 1024 * 1024 * 1024 * 1024 * 1024
'KiB': 1024,
'MiB': 1024 * 1024,
'GiB': 1024 * 1024 * 1024,
'TiB': 1024 * 1024 * 1024 * 1024,
'PiB': 1024 * 1024 * 1024 * 1024 * 1024
},
'KB': {
'B': 1 / 1024,
Expand All @@ -54,6 +61,13 @@ NETDATA.unitsConversion = {
'GB': 1024 * 1024,
'TB': 1024 * 1024 * 1024
},
'KiB': {
'B': 1 / 1024,
'KiB': 1,
'MiB': 1024,
'GiB': 1024 * 1024,
'TiB': 1024 * 1024 * 1024
},
'MB': {
'B': 1 / (1024 * 1024),
'KB': 1 / 1024,
Expand All @@ -62,6 +76,14 @@ NETDATA.unitsConversion = {
'TB': 1024 * 1024,
'PB': 1024 * 1024 * 1024
},
'MiB': {
'B': 1 / (1024 * 1024),
'KiB': 1 / 1024,
'MiB': 1,
'GiB': 1024,
'TiB': 1024 * 1024,
'PiB': 1024 * 1024 * 1024
},
'GB': {
'B': 1 / (1024 * 1024 * 1024),
'KB': 1 / (1024 * 1024),
Expand All @@ -70,6 +92,15 @@ NETDATA.unitsConversion = {
'TB': 1024,
'PB': 1024 * 1024,
'EB': 1024 * 1024 * 1024
},
'GiB': {
'B': 1 / (1024 * 1024 * 1024),
'KiB': 1 / (1024 * 1024),
'MiB': 1 / 1024,
'GiB': 1,
'TiB': 1024,
'PiB': 1024 * 1024,
'EiB': 1024 * 1024 * 1024
}
/*
'milliseconds': {
Expand Down

0 comments on commit fe70512

Please sign in to comment.