(&mut self)
| 27 | } |
| 28 | |
| 29 | async fn stop(&mut self) -> Result<()> { |
| 30 | let Some((receiver, profile_folder)) = self.started.take() else { |
| 31 | return Ok(()); |
| 32 | }; |
| 33 | let requests = receiver.stop().await; |
| 34 | let (request_count, received_bytes) = (requests.count, requests.received_bytes); |
| 35 | let stats = write_telemetry_artifacts(requests, &profile_folder) |
| 36 | .await |
| 37 | .context("Failed to write the OpenTelemetry data")?; |
| 38 | |
| 39 | if request_count == 0 { |
| 40 | warn!( |
| 41 | "The benchmarks exported no OpenTelemetry data. Make sure their integration \ |
| 42 | exports it, e.g. with the `telemetry` feature of `codspeed-divan-compat`." |
| 43 | ); |
| 44 | } else { |
| 45 | info!( |
| 46 | "Collected {} spans and {} logs from {request_count} OpenTelemetry export \ |
| 47 | requests ({received_bytes} bytes)", |
| 48 | stats.spans, stats.logs |
| 49 | ); |
| 50 | } |
| 51 | if stats.invalid_spans > 0 { |
| 52 | warn!( |
| 53 | "Left out {} spans with an invalid trace or span id", |
| 54 | stats.invalid_spans |
| 55 | ); |
| 56 | } |
| 57 | if stats.without_monotonic_time > 0 { |
| 58 | warn!( |
| 59 | "{} spans and logs carry no time on the clock of the benchmarks, they won't be \ |
| 60 | attributed to their benchmark. Update their integration.", |
| 61 | stats.without_monotonic_time |
| 62 | ); |
| 63 | } |
| 64 | Ok(()) |
| 65 | } |
| 66 | } |
no test coverage detected