diff options
Diffstat (limited to 'grasp-audit/src/probe.rs')
| -rw-r--r-- | grasp-audit/src/probe.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/grasp-audit/src/probe.rs b/grasp-audit/src/probe.rs index 7158d42..0dca74c 100644 --- a/grasp-audit/src/probe.rs +++ b/grasp-audit/src/probe.rs | |||
| @@ -124,6 +124,26 @@ impl ProbeReport { | |||
| 124 | } | 124 | } |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | impl ProbeReport { | ||
| 128 | /// Build a synthetic report for when the overall probe timeout fires. | ||
| 129 | pub fn overall_timeout(relay_url: &str, duration_ms: u64) -> Self { | ||
| 130 | ProbeReport { | ||
| 131 | relay_url: relay_url.to_string(), | ||
| 132 | timestamp: now_iso8601(), | ||
| 133 | all_passed: false, | ||
| 134 | total_duration_ms: duration_ms, | ||
| 135 | checks: vec![ProbeCheck { | ||
| 136 | name: "overall_timeout", | ||
| 137 | passed: false, | ||
| 138 | skipped: false, | ||
| 139 | duration_ms, | ||
| 140 | detail: None, | ||
| 141 | error: Some("probe exceeded overall timeout".to_string()), | ||
| 142 | }], | ||
| 143 | } | ||
| 144 | } | ||
| 145 | } | ||
| 146 | |||
| 127 | // ============================================================ | 147 | // ============================================================ |
| 128 | // Helpers | 148 | // Helpers |
| 129 | // ============================================================ | 149 | // ============================================================ |