outputHealthTable outputs health summary as a formatted table
(summary HealthSummary, threshold float64)
| 319 | |
| 320 | // outputHealthTable outputs health summary as a formatted table |
| 321 | func outputHealthTable(summary HealthSummary, threshold float64) error { |
| 322 | fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Workflow Health Summary (%s)", summary.Period))) |
| 323 | fmt.Fprintln(os.Stderr, "") |
| 324 | |
| 325 | // Render table |
| 326 | fmt.Fprint(os.Stderr, console.RenderStruct(summary.Workflows)) |
| 327 | fmt.Fprintln(os.Stderr, "") |
| 328 | |
| 329 | // Display summary message |
| 330 | if summary.BelowThreshold > 0 { |
| 331 | fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("%d workflow(s) below %.0f%% success threshold", summary.BelowThreshold, threshold))) |
| 332 | fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Run '%s health <workflow-name>' for details", string(constants.CLIExtensionPrefix)))) |
| 333 | } else { |
| 334 | fmt.Fprintln(os.Stderr, console.FormatSuccessMessage(fmt.Sprintf("All workflows above %.0f%% success threshold", threshold))) |
| 335 | } |
| 336 | |
| 337 | return nil |
| 338 | } |
no test coverage detected