summaryrefslogtreecommitdiff
path: root/doc/operations/metrics/dashboards/yaml_number_format.md
blob: 1a8bd6f42571b79014f95a1d8e17733b81cf4cc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
---
stage: Monitor
group: APM
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---

# Unit formats reference **(CORE)**

> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/201999) in GitLab 12.9.

Format the data in your dashboard panels.

You can select units to format your charts by adding `format` to your
[axis configuration](yaml.md).

## Internationalization and localization

Currently, your [internationalization and localization options](https://en.wikipedia.org/wiki/Internationalization_and_localization) for number formatting are dependent on the system you are using i.e. your OS or browser.

## Engineering Notation

For generic or default data, numbers are formatted according to the current locale in [engineering notation](https://en.wikipedia.org/wiki/Engineering_notation).

While an [engineering notation exists for the web](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat), GitLab uses a version based off the [scientific notation](https://en.wikipedia.org/wiki/Scientific_notation). GitLab formatting acts in accordance with SI prefixes. For example, using GitLab notation, `1500.00` becomes `1.5k` instead of `1.5E3`. Keep this distinction in mind when using the engineering notation for your metrics.

Formats: `engineering`

SI prefixes:

| Name       | Symbol  | Value                      |
| ---------- | ------- | -------------------------- |
| `yotta`    | Y       | 1000000000000000000000000  |
| `zetta`    | Z       | 1000000000000000000000     |
| `exa`      | E       | 1000000000000000000        |
| `peta`     | P       | 1000000000000000           |
| `tera`     | T       | 1000000000000              |
| `giga`     | G       | 1000000000                 |
| `mega`     | M       | 1000000                    |
| `kilo`     | k       | 1000                       |
| `milli`    | m       | 0.001                      |
| `micro`    | μ       | 0.000001                   |
| `nano`     | n       | 0.000000001                |
| `pico`     | p       | 0.000000000001             |
| `femto`    | f       | 0.000000000000001          |
| `atto`     | a       | 0.000000000000000001       |
| `zepto`    | z       | 0.000000000000000000001    |
| `yocto`    | y       | 0.000000000000000000000001 |

**Examples:**

| Data                              | Displayed |
| --------------------------------- | --------- |
| `0.000000000000000000000008`      | 8y        |
| `0.000000000000000000008`         | 8z        |
| `0.000000000000000008`            | 8a        |
| `0.000000000000008`               | 8f        |
| `0.000000000008`                  | 8p        |
| `0.000000008`                     | 8n        |
| `0.000008`                        | 8μ        |
| `0.008`                           | 8m        |
| `10`                              | 10        |
| `1080`                            | 1.08k     |
| `18000`                           | 18k       |
| `18888`                           | 18.9k     |
| `188888`                          | 189k      |
| `18888888`                        | 18.9M     |
| `1888888888`                      | 1.89G     |
| `1888888888888`                   | 1.89T     |
| `1888888888888888`                | 1.89P     |
| `1888888888888888888`             | 1.89E     |
| `1888888888888888888888`          | 1.89Z     |
| `1888888888888888888888888`       | 1.89Y     |
| `1888888888888888888888888888`    | 1.89e+27  |

## Numbers

For number data, numbers are formatted according to the current locale.

Formats: `number`

**Examples:**

| Data  | Displayed |
| ---------- | --------- |
| `10`       | 1         |
| `1000`     | 1,000     |
| `1000000`  | 1,000,000 |

## Percentage

For percentage data, format numbers in the chart with a `%` symbol.

Formats supported: `percent`, `percentHundred`

**Examples:**

| Format           | Data  | Displayed |
| ---------------- | ----- | --------- |
| `percent`        | `0.5` | 50%       |
| `percent`        | `1`   | 100%      |
| `percent`        | `2`   | 200%      |
| `percentHundred` | `50`  | 50%       |
| `percentHundred` | `100` | 100%      |
| `percentHundred` | `200` | 200%      |

## Duration

For time durations, format numbers in the chart with a time unit symbol.

Formats supported: `milliseconds`, `seconds`

**Examples:**

| Format         | Data   | Displayed |
| -------------- | ------ | --------- |
| `milliseconds` | `10`   | 10ms      |
| `milliseconds` | `500`  | 100ms     |
| `milliseconds` | `1000` | 1000ms    |
| `seconds`      | `10`   | 10s       |
| `seconds`      | `500`  | 500s      |
| `seconds`      | `1000` | 1000s     |

## Digital (Metric)

Converts a number of bytes using metric prefixes. It scales to
use the unit that's the best fit.

Formats supported:

- `decimalBytes`
- `kilobytes`
- `megabytes`
- `gigabytes`
- `terabytes`
- `petabytes`

**Examples:**

| Format         | Data      | Displayed |
| -------------- | --------- | --------- |
| `decimalBytes` | `1`       | 1B        |
| `decimalBytes` | `1000`    | 1kB       |
| `decimalBytes` | `1000000` | 1MB       |
| `kilobytes`    | `1`       | 1kB       |
| `kilobytes`    | `1000`    | 1MB       |
| `kilobytes`    | `1000000` | 1GB       |
| `megabytes`    | `1`       | 1MB       |
| `megabytes`    | `1000`    | 1GB       |
| `megabytes`    | `1000000` | 1TB       |

## Digital (IEC)

Converts a number of bytes using binary prefixes. It scales to
use the unit that's the best fit.

Formats supported:

- `bytes`
- `kibibytes`
- `mebibytes`
- `gibibytes`
- `tebibytes`
- `pebibytes`

**Examples:**

| Format      | Data          | Displayed |
| ----------- | ------------- | --------- |
| `bytes`     | `1`           | 1B        |
| `bytes`     | `1024`        | 1KiB      |
| `bytes`     | `1024 * 1024` | 1MiB      |
| `kibibytes` | `1`           | 1KiB      |
| `kibibytes` | `1024`        | 1MiB      |
| `kibibytes` | `1024 * 1024` | 1GiB      |
| `mebibytes` | `1`           | 1MiB      |
| `mebibytes` | `1024`        | 1GiB      |
| `mebibytes` | `1024 * 1024` | 1TiB      |