Commit d8bb8d2
authored
[auto-jira][AGENTCFG-70] display uptime in days when >= 24h (#48416)
### What does this PR do?
Updates `mkHumanDuration` in `comp/core/status/render_helpers.go` to format durations >= 24 hours using a days-based representation.
Before: `554h54m59s`
After: `23d2h54m59s`
### Motivation
Fixes https://datadoghq.atlassian.net/browse/AGENTCFG-70
The `datadog-agent status` output uses `mkHumanDuration` to display uptime. For long-running agents, Go's default `Duration.String()` produces output like `554h54m59s`, which is hard to read. This change adds a days component when the duration is >= 24 hours.
### Describe how you validated your changes
Added unit tests covering sub-day durations, exact 24h boundary, and multi-day durations including the example from the ticket (554h54m59s → 23d2h54m59s).
### Additional Notes
_Created by [Auto-JIRA](https://github.com/DataDog/datadog-agent/blob/main/.claude/skills/auto-jira/SKILL.md)._
Co-authored-by: rahul.kaukuntla <[email protected]>1 parent ab3b6ca commit d8bb8d2
File tree
3 files changed
+39
-1
lines changed- comp/core/status
- releasenotes/notes
3 files changed
+39
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
260 | 265 | | |
261 | 266 | | |
262 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
33 | 54 | | |
34 | 55 | | |
35 | 56 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments