Skip to content

feat: add humanize value helper with SI metric prefixes - #276

Merged
onedr0p merged 1 commit into
home-operations:mainfrom
gabrielcosi:feature/humanize-value-helper
Jun 26, 2026
Merged

onedr0p merged 1 commit into
home-operations:mainfrom
gabrielcosi:feature/humanize-value-helper

Conversation

@gabrielcosi

@gabrielcosi gabrielcosi commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Adds a humanize CEL helper for valueExpr/colorExpr, matching Prometheus's humanize: it scales by powers of 1000 to four significant figures with an SI metric prefix — humanize(93166031.0) → 93.17M, humanize(1000.0) → 1k. Unit-less, so humanize(result) + " tokens" renders large counts compactly. Fills the gap next to humanizeBytes (same scaling, but byte-unit-locked); hand-rolled, with tests and a README row.

Requirements


Assisted by Claude Code. Design, code, and tests were directed, reviewed, and manually verified by the author.

Signed-off-by: Gabriel Cosi <contact@gabrielcosi.dev>
@onedr0p
onedr0p merged commit a55cbd1 into home-operations:main Jun 26, 2026
6 checks passed
ajgon pushed a commit to deedee-ops/home-ops that referenced this pull request Jun 26, 2026
….14.10 ➔ 0.14.11) (#162)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/home-operations/charts/kromgo](https://github.com/home-operations/kromgo) | patch | `0.14.10` → `0.14.11` |

---

### Release Notes

<details>
<summary>home-operations/kromgo (ghcr.io/home-operations/charts/kromgo)</summary>

### [`v0.14.11`](https://github.com/home-operations/kromgo/blob/HEAD/CHANGELOG.md#01411-2026-06-26)

[Compare Source](home-operations/kromgo@0.14.10...0.14.11)

##### Features

- add humanize value helper with SI metric prefixes ([#&#8203;276](home-operations/kromgo#276)) ([a55cbd1](home-operations/kromgo@a55cbd1))
- **container:** update image mirror.gcr.io/curlimages/curl (8.20.0 → 8.21.0) ([#&#8203;275](home-operations/kromgo#275)) ([cb7863e](home-operations/kromgo@cb7863e))
- **deps:** update dependency simple-icons (16.23.0 → 16.24.0) ([#&#8203;270](home-operations/kromgo#270)) ([9b49e38](home-operations/kromgo@9b49e38))
- **deps:** update module github.com/go-analyze/charts (v0.5.27 → v0.6.0) ([#&#8203;274](home-operations/kromgo#274)) ([bd53d31](home-operations/kromgo@bd53d31))
- **deps:** update module golang.org/x/image (v0.42.0 → v0.43.0) ([#&#8203;266](home-operations/kromgo#266)) ([96e4774](home-operations/kromgo@96e4774))

##### Bug Fixes

- **deps:** update module go.yaml.in/yaml/v4 (v4.0.0-rc.5 → v4.0.0-rc.6) ([#&#8203;268](home-operations/kromgo#268)) ([64a8a99](home-operations/kromgo@64a8a99))

##### Miscellaneous Chores

- add minimumGroupSize to Go and Node toolchain groups ([c90f50d](home-operations/kromgo@c90f50d))
- **mise:** Update tool oxfmt (0.55.0 → 0.56.0) ([#&#8203;271](home-operations/kromgo#271)) ([2597efd](home-operations/kromgo@2597efd))
- **mise:** Update tool zizmor (1.25.2 → 1.26.1) ([#&#8203;269](home-operations/kromgo#269)) ([f3daed1](home-operations/kromgo@f3daed1))

</details>

---

### Configuration

📅 **Schedule**: (in timezone Europe/Warsaw)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDMuMiIsInVwZGF0ZWRJblZlciI6IjQzLjI0My4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbInJlbm92YXRlL2NvbnRhaW5lciIsInR5cGUvcGF0Y2giXX0=-->

Reviewed-on: https://git.ajgon.casa/deedee/mark13/pulls/162
eleboucher pushed a commit to eleboucher/homelab that referenced this pull request Jun 26, 2026
….14.10 ➔ 0.14.11) (#1284)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/home-operations/charts/kromgo](https://github.com/home-operations/kromgo) | patch | `0.14.10` → `0.14.11` |

---

### Release Notes

<details>
<summary>home-operations/kromgo (ghcr.io/home-operations/charts/kromgo)</summary>

### [`v0.14.11`](https://github.com/home-operations/kromgo/blob/HEAD/CHANGELOG.md#01411-2026-06-26)

[Compare Source](home-operations/kromgo@0.14.10...0.14.11)

##### Features

- add humanize value helper with SI metric prefixes ([#&#8203;276](home-operations/kromgo#276)) ([a55cbd1](home-operations/kromgo@a55cbd1))
- **container:** update image mirror.gcr.io/curlimages/curl (8.20.0 → 8.21.0) ([#&#8203;275](home-operations/kromgo#275)) ([cb7863e](home-operations/kromgo@cb7863e))
- **deps:** update dependency simple-icons (16.23.0 → 16.24.0) ([#&#8203;270](home-operations/kromgo#270)) ([9b49e38](home-operations/kromgo@9b49e38))
- **deps:** update module github.com/go-analyze/charts (v0.5.27 → v0.6.0) ([#&#8203;274](home-operations/kromgo#274)) ([bd53d31](home-operations/kromgo@bd53d31))
- **deps:** update module golang.org/x/image (v0.42.0 → v0.43.0) ([#&#8203;266](home-operations/kromgo#266)) ([96e4774](home-operations/kromgo@96e4774))

##### Bug Fixes

- **deps:** update module go.yaml.in/yaml/v4 (v4.0.0-rc.5 → v4.0.0-rc.6) ([#&#8203;268](home-operations/kromgo#268)) ([64a8a99](home-operations/kromgo@64a8a99))

##### Miscellaneous Chores

- add minimumGroupSize to Go and Node toolchain groups ([c90f50d](home-operations/kromgo@c90f50d))
- **mise:** Update tool oxfmt (0.55.0 → 0.56.0) ([#&#8203;271](home-operations/kromgo#271)) ([2597efd](home-operations/kromgo@2597efd))
- **mise:** Update tool zizmor (1.25.2 → 1.26.1) ([#&#8203;269](home-operations/kromgo#269)) ([f3daed1](home-operations/kromgo@f3daed1))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/1284
ajgon pushed a commit to deedee-ops/home-ops that referenced this pull request Jul 20, 2026
….14.10 ➔ 0.14.11) (#162)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/home-operations/charts/kromgo](https://github.com/home-operations/kromgo) | patch | `0.14.10` → `0.14.11` |

---

### Release Notes

<details>
<summary>home-operations/kromgo (ghcr.io/home-operations/charts/kromgo)</summary>

### [`v0.14.11`](https://github.com/home-operations/kromgo/blob/HEAD/CHANGELOG.md#01411-2026-06-26)

[Compare Source](home-operations/kromgo@0.14.10...0.14.11)

##### Features

- add humanize value helper with SI metric prefixes ([#&#8203;276](home-operations/kromgo#276)) ([a55cbd1](home-operations/kromgo@a55cbd1))
- **container:** update image mirror.gcr.io/curlimages/curl (8.20.0 → 8.21.0) ([#&#8203;275](home-operations/kromgo#275)) ([cb7863e](home-operations/kromgo@cb7863e))
- **deps:** update dependency simple-icons (16.23.0 → 16.24.0) ([#&#8203;270](home-operations/kromgo#270)) ([9b49e38](home-operations/kromgo@9b49e38))
- **deps:** update module github.com/go-analyze/charts (v0.5.27 → v0.6.0) ([#&#8203;274](home-operations/kromgo#274)) ([bd53d31](home-operations/kromgo@bd53d31))
- **deps:** update module golang.org/x/image (v0.42.0 → v0.43.0) ([#&#8203;266](home-operations/kromgo#266)) ([96e4774](home-operations/kromgo@96e4774))

##### Bug Fixes

- **deps:** update module go.yaml.in/yaml/v4 (v4.0.0-rc.5 → v4.0.0-rc.6) ([#&#8203;268](home-operations/kromgo#268)) ([64a8a99](home-operations/kromgo@64a8a99))

##### Miscellaneous Chores

- add minimumGroupSize to Go and Node toolchain groups ([c90f50d](home-operations/kromgo@c90f50d))
- **mise:** Update tool oxfmt (0.55.0 → 0.56.0) ([#&#8203;271](home-operations/kromgo#271)) ([2597efd](home-operations/kromgo@2597efd))
- **mise:** Update tool zizmor (1.25.2 → 1.26.1) ([#&#8203;269](home-operations/kromgo#269)) ([f3daed1](home-operations/kromgo@f3daed1))

</details>

---

### Configuration

📅 **Schedule**: (in timezone Europe/Warsaw)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDMuMiIsInVwZGF0ZWRJblZlciI6IjQzLjI0My4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbInJlbm92YXRlL2NvbnRhaW5lciIsInR5cGUvcGF0Y2giXX0=-->

Reviewed-on: https://git.ajgon.casa/deedee/mark13/pulls/162
ajgon pushed a commit to deedee-ops/home-ops that referenced this pull request Jul 28, 2026
….14.10 ➔ 0.14.11) (#162)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/home-operations/charts/kromgo](https://github.com/home-operations/kromgo) | patch | `0.14.10` → `0.14.11` |

---

### Release Notes

<details>
<summary>home-operations/kromgo (ghcr.io/home-operations/charts/kromgo)</summary>

### [`v0.14.11`](https://github.com/home-operations/kromgo/blob/HEAD/CHANGELOG.md#01411-2026-06-26)

[Compare Source](home-operations/kromgo@0.14.10...0.14.11)

##### Features

- add humanize value helper with SI metric prefixes ([#&#8203;276](home-operations/kromgo#276)) ([a55cbd1](home-operations/kromgo@a55cbd1))
- **container:** update image mirror.gcr.io/curlimages/curl (8.20.0 → 8.21.0) ([#&#8203;275](home-operations/kromgo#275)) ([cb7863e](home-operations/kromgo@cb7863e))
- **deps:** update dependency simple-icons (16.23.0 → 16.24.0) ([#&#8203;270](home-operations/kromgo#270)) ([9b49e38](home-operations/kromgo@9b49e38))
- **deps:** update module github.com/go-analyze/charts (v0.5.27 → v0.6.0) ([#&#8203;274](home-operations/kromgo#274)) ([bd53d31](home-operations/kromgo@bd53d31))
- **deps:** update module golang.org/x/image (v0.42.0 → v0.43.0) ([#&#8203;266](home-operations/kromgo#266)) ([96e4774](home-operations/kromgo@96e4774))

##### Bug Fixes

- **deps:** update module go.yaml.in/yaml/v4 (v4.0.0-rc.5 → v4.0.0-rc.6) ([#&#8203;268](home-operations/kromgo#268)) ([64a8a99](home-operations/kromgo@64a8a99))

##### Miscellaneous Chores

- add minimumGroupSize to Go and Node toolchain groups ([c90f50d](home-operations/kromgo@c90f50d))
- **mise:** Update tool oxfmt (0.55.0 → 0.56.0) ([#&#8203;271](home-operations/kromgo#271)) ([2597efd](home-operations/kromgo@2597efd))
- **mise:** Update tool zizmor (1.25.2 → 1.26.1) ([#&#8203;269](home-operations/kromgo#269)) ([f3daed1](home-operations/kromgo@f3daed1))

</details>

---

### Configuration

📅 **Schedule**: (in timezone Europe/Warsaw)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDMuMiIsInVwZGF0ZWRJblZlciI6IjQzLjI0My4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbInJlbm92YXRlL2NvbnRhaW5lciIsInR5cGUvcGF0Y2giXX0=-->

Reviewed-on: https://git.ajgon.casa/deedee/mark13/pulls/162
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants