Skip to content
Bug reportNov 6, 2026· 0:33· 15 views

Grafana: IEC data rate units (KiBs/MiBs/GiBs) display wrong SI prefix — scale shifted up by offset

0:33 total

Comments · 0

Be the first to comment.

Bug reportby SceneRecap AI

mediumValue formatting: symbolFormatters.ts, scaledUnits(). The extArray lookup uses extArray[offset + siIndex] and appears to count the offset twice for IEC units with offset > 0.
os: macOSdpr: 1locale: en-USbrowser: Chromium 151.0.7922.34timezone: Europe/Berlinviewport: 1280x720source_file: symbolFormatters.ts (cited on page)

Repro steps

  1. 1.Open the Grafana #137111 repro page that compares buggy and expected output for IEC data rate units.
  2. 2.Format 1,200 bytes/s with unit KiBs (offset=1) and read the Buggy output column.
  3. 3.Format 1,210,000 bytes/s with unit MiBs (offset=2) and read the Buggy output column.
  4. 4.Format 1,240,000,000 bytes/s with unit GiBs (offset=3) and read the Buggy output column.
  5. 5.Control: format 1,210,000 bytes/s with unit MBs (SI, offset=0) and compare the two output columns.

Expected

IEC data rate units keep the correct prefix. KiBs with 1,200 bytes/s shows 1.17 KiB/s. MiBs with 1,210,000 bytes/s shows 1.15 MiB/s. GiBs with 1,240,000,000 bytes/s shows 1.15 GiB/s.

Actual

The prefix moves up by the unit offset. KiBs shows 1.17 MiB/s (+1 step). MiBs shows 1.15 TiB/s (+2 steps). GiBs shows 1.15 EiB/s (+3 steps). The numeric value is correct but the unit label is wrong.

Evidence

visualPage subtitle cites symbolFormatters.ts, scaledUnits(1024, extArray, offset), and says extArray[offset + siIndex] counts offset twice.
visualKiBs (offset=1), 1,200 bytes/s: Buggy output '1.17 MiB/s', Expected '1.17 KiB/s', Shift '+1 prefix steps (offset double-counted)'.
visualRed banner: KiBs, 1,200 bytes/s shows '1.17 MiB/s' (expected: '1.17 KiB/s').
visualRed banner: MiBs, 1,210,000 bytes/s shows '1.15 TiB/s' (expected: '1.15 MiB/s'). Shift column shows +2 prefix steps.
visualRed banner: GiBs, 1.24 GB/s shows '1.15 EiB/s' (3 prefix steps too high). Shift column shows +3 prefix steps.
visualControl works: MBs (SI, offset=0), 1,210,000 bytes/s shows '1.21 MB/s' in both columns. Green banner says correct (no double-count). Shift column says 'no shift'.
visualBuggy outputs for KiBs, MiBs and GiBs are still shown at the end of the recording.
Issue markdown (copy-paste ready)
## Summary
IEC data rate units (KiBs, MiBs, GiBs) display a scale prefix that is too high by the unit offset. The numbers are right but the unit label is wrong. The SI control (MBs, offset=0) is correct.

## Environment
- Chromium 151.0.7922.34, macOS
- Viewport 1280x720, dpr 1, en-US, Europe/Berlin

## Steps to reproduce
1. Open the Grafana #137111 repro page (1.0s).
2. Format 1,200 bytes/s as KiBs (offset=1) (7.0s).
3. Format 1,210,000 bytes/s as MiBs (offset=2) (11.0s).
4. Format 1,240,000,000 bytes/s as GiBs (offset=3) (15.0s).
5. Control: format 1,210,000 bytes/s as MBs (SI, offset=0) (17.0s).

## Expected
- KiBs: `1.17 KiB/s`
- MiBs: `1.15 MiB/s`
- GiBs: `1.15 GiB/s`

## Actual
| Unit (offset) | Input (bytes/s) | Buggy output | Expected | Shift |
|---|---|---|---|---|
| KiBs (1) | 1,200 | 1.17 MiB/s | 1.17 KiB/s | +1 |
| MiBs (2) | 1,210,000 | 1.15 TiB/s | 1.15 MiB/s | +2 |
| GiBs (3) | 1,240,000,000 | 1.15 EiB/s | 1.15 GiB/s | +3 |

The shift equals the offset (seen from 1.0s, banners at 7.0s, 11.0s and 15.0s).

## Control (works)
MBs (SI, offset=0), 1,210,000 bytes/s shows `1.21 MB/s` in both columns with no shift (17.0s, 19.0s). This fits a double-counted offset, since adding 0 twice changes nothing.

## Evidence
- 1.0s: subtitle cites `symbolFormatters.ts`, `scaledUnits(1024, extArray, offset)`, and says `extArray[offset + siIndex]` counts offset twice.
- 7.0s / 11.0s / 15.0s: red banners show each wrong prefix.
- 17.0s: green banner confirms the SI control is correct.
- 31.0s: buggy outputs still shown.
- No console or network events were captured.

## Suggested area
`symbolFormatters.ts`, `scaledUnits()`: the prefix lookup `extArray[offset + siIndex]` seems to add the offset a second time. The expected column uses `extArray[siIndex]`.

*Recorded with SceneRecap.*

Your recordings could explain themselves too.

Free plan · silent recordings welcome · bug reports included.

Try SceneRecap free →
Grafana: IEC data rate units (KiBs/MiBs/GiBs) display wrong SI prefix — scale shifted up by offset · SceneRecap