瀏覽代碼

Units: Adding T,P,E,Z,and Y bytes (#18706)

* Adding T and P for bytes

Luckily, all the hard work was done before; just added in these prefixes for our production environment.

* Future-proofing with other values (why not?)

* Yottaflops?

* Cutting back down to Peta sizes, except for hashes
Omar Ahmad 6 年之前
父節點
當前提交
ca96d794e2
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      packages/grafana-ui/src/utils/valueFormats/categories.ts

+ 10 - 0
packages/grafana-ui/src/utils/valueFormats/categories.ts

@@ -75,6 +75,8 @@ export const getCategories = (): ValueFormatCategory[] => [
       { name: 'TFLOP/s', id: 'tflops', fn: decimalSIPrefix('FLOP/s', 4) },
       { name: 'PFLOP/s', id: 'pflops', fn: decimalSIPrefix('FLOP/s', 5) },
       { name: 'EFLOP/s', id: 'eflops', fn: decimalSIPrefix('FLOP/s', 6) },
+      { name: 'ZFLOP/s', id: 'zflops', fn: decimalSIPrefix('FLOP/s', 7) },
+      { name: 'YFLOP/s', id: 'yflops', fn: decimalSIPrefix('FLOP/s', 8) },
     ],
   },
   {
@@ -123,6 +125,8 @@ export const getCategories = (): ValueFormatCategory[] => [
       { name: 'kibibytes', id: 'kbytes', fn: binarySIPrefix('B', 1) },
       { name: 'mebibytes', id: 'mbytes', fn: binarySIPrefix('B', 2) },
       { name: 'gibibytes', id: 'gbytes', fn: binarySIPrefix('B', 3) },
+      { name: 'tebibytes', id: 'tbytes', fn: binarySIPrefix('B', 4) },
+      { name: 'pebibytes', id: 'pbytes', fn: binarySIPrefix('B', 5) },
     ],
   },
   {
@@ -133,6 +137,8 @@ export const getCategories = (): ValueFormatCategory[] => [
       { name: 'kilobytes', id: 'deckbytes', fn: decimalSIPrefix('B', 1) },
       { name: 'megabytes', id: 'decmbytes', fn: decimalSIPrefix('B', 2) },
       { name: 'gigabytes', id: 'decgbytes', fn: decimalSIPrefix('B', 3) },
+      { name: 'terabytes', id: 'dectbytes', fn: decimalSIPrefix('B', 4) },
+      { name: 'petabytes', id: 'decpbytes', fn: decimalSIPrefix('B', 5) },
     ],
   },
   {
@@ -147,6 +153,10 @@ export const getCategories = (): ValueFormatCategory[] => [
       { name: 'megabits/sec', id: 'Mbits', fn: decimalSIPrefix('bps', 2) },
       { name: 'gigabytes/sec', id: 'GBs', fn: decimalSIPrefix('Bs', 3) },
       { name: 'gigabits/sec', id: 'Gbits', fn: decimalSIPrefix('bps', 3) },
+      { name: 'terabytes/sec', id: 'TBs', fn: decimalSIPrefix('Bs', 4) },
+      { name: 'terabits/sec', id: 'Gbits', fn: decimalSIPrefix('bps', 4) },
+      { name: 'petabytes/sec', id: 'PBs', fn: decimalSIPrefix('Bs', 5) },
+      { name: 'petabits/sec', id: 'Pbits', fn: decimalSIPrefix('bps', 5) },
     ],
   },
   {