Skip to content

feat(diagnose): show per-check execution time in text output - #57

Merged
francomano merged 1 commit into
francomano:masterfrom
MsfPablo:feat/43-per-check-execution-time
Sep 2, 2026
Merged

feat(diagnose): show per-check execution time in text output#57
francomano merged 1 commit into
francomano:masterfrom
MsfPablo:feat/43-per-check-execution-time

Conversation

@MsfPablo

@MsfPablo MsfPablo commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Closes #43

Summary

formatText rendered each check's status, severity and confidence but dropped the ExecutionTime that every check already records via SetExecutionTime. Users could not tell which check was slow from the text output, even though the data was already on CheckResult and present in the JSON/HTML/Markdown outputs.

Append the duration to each result's status line, human-readable via time.Duration.String():

  1. ✅ public_ip
     Status: passed | Severity: info | Confidence: 95% [1.2s]

Changes

  • cmd/cli/commands/diagnose.goformatText appends [%s] (the result's ExecutionTime) to the status line.
  • cmd/cli/commands/diagnose_test.goTestFormatTextIncludesPerCheckExecutionTime builds a report with per-result durations (1.2s, 350ms) and asserts both bracketed, human-readable forms appear.

Acceptance criteria (#43)

  • Each check result in text output shows its execution time in brackets
  • Time is formatted as human-readable (1.2s, 350ms)
  • JSON/HTML/Markdown output already includes the field — no changes there
  • A test verifies the time appears in text output

Verification

go build ./...
go test ./cmd/cli/commands/ ./core/check/ ./core/checks/...
gofmt -l cmd/cli/commands/
go vet ./cmd/cli/commands/

formatText rendered each check's status, severity and confidence but
dropped the ExecutionTime that every check already records, so users
could not tell which check was slow. Append the duration, human-readable
via time.Duration.String() (e.g. [1.2s], [350ms]), to each result's
status line. JSON/HTML/Markdown output already carried the field.

Closes francomano#43
@francomano
francomano merged commit af499b6 into francomano:master Sep 2, 2026
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.

Show per-check execution time in text output

2 participants