Skip to main content

wire/answer/
metrics.rs

1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4// Copyright (c) 2026 2youg1 and the sprawling contributors
5
6//! The city's vital signs, counted once so a readout is one question.
7
8use serde::{Deserialize, Serialize};
9
10/// The city's vital signs: the counts a page would otherwise assemble
11/// by asking four questions and adding up the answers.
12///
13/// Every number here is already proven by another view; this query
14/// exists so that drawing one readout costs one question. It holds no
15/// money - that is `CostView`'s, and one figure with two owners is how
16/// two figures start disagreeing.
17#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
18#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
19pub struct MetricsAnswer {
20    pub events: u64,
21    pub runs_active: u64,
22    pub runs_frozen: u64,
23    pub buildings: u64,
24    pub approvals_waiting: u64,
25    pub signals_waiting: u64,
26    /// Discarded and not yet restored.
27    pub discards_outstanding: u64,
28}