|
|
|
|
@ -203,7 +203,17 @@ static void statistics(struct lab *lab, uint64_t id, int loads) {
|
|
|
|
|
stream_buffer_path(local.buffer, last, sub, &path) != STREAM_OK) continue; |
|
|
|
|
printf("%s{\"sub\":%u,\"seq\":%" PRIu64 ",\"nodes\":[", path_separator++ ? "," : "", sub, last); |
|
|
|
|
for (unsigned p = 0; p < path.count; p++) printf("%s\"%" PRIu64 "\"", p ? "," : "", path.nodes[p]); |
|
|
|
|
printf("]}"); |
|
|
|
|
printf("]"); |
|
|
|
|
const uint8_t *wire; size_t length; uint64_t actual; |
|
|
|
|
if (stream_buffer_read(local.buffer, last, sub, &wire, &length, &actual) == STREAM_OK) |
|
|
|
|
printf(",\"source_timestamp_ms\":%u", (unsigned)stream_read_be(wire + STREAM_BLOCK_TIMESTAMP_OFF, 2)); |
|
|
|
|
struct stream_metric_snapshot metric; |
|
|
|
|
if (stream_local_metrics(lab->inst, &info.descriptor, sub, now_ns() / UINT64_C(1000000), &metric) == STREAM_OK) |
|
|
|
|
printf(",\"lag_ms\":%" PRIu64 ",\"source_rate\":%" PRIu64 ",\"receive_rate\":%" PRIu64 |
|
|
|
|
",\"late_blocks\":%" PRIu64 ",\"stops\":%" PRIu64 ",\"stopped\":%d", |
|
|
|
|
metric.lag_ms, metric.source_rate_bytes_sec, metric.receive_rate_bytes_sec, |
|
|
|
|
metric.late_blocks, metric.stops, metric.stopped); |
|
|
|
|
printf("}"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
printf("]"); |
|
|
|
|
|