| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | package nagios |
| 4 | |
| 5 | type executionMetrics struct { |
| 6 | durationSeconds float64 |
| 7 | cpuTotalSeconds float64 |
| 8 | maxRSSBytes float64 |
| 9 | } |
| 10 | |
| 11 | func executionMetricsFromResult(result checkRunResult) executionMetrics { |
| 12 | return executionMetrics{ |
| 13 | durationSeconds: result.Duration.Seconds(), |
| 14 | cpuTotalSeconds: (result.Usage.User + result.Usage.System).Seconds(), |
| 15 | maxRSSBytes: float64(result.Usage.MaxRSSBytes), |
| 16 | } |
| 17 | } |