1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
//! `ServiceConnector` implementation for the console itself (#6908).
//!
//! Why: every trusty-* daemon the console can see appears in the Services
//! roster except the one serving the page. An operator looking at the roster to
//! answer "what is running on this machine, and what is it costing me" got six
//! answers and a blind spot, and the console is the process holding the SSE
//! fan-out and the sampling loop — the one whose cost the operator cannot check
//! anywhere else.
//!
//! Why this connector does no I/O at all, unlike every sibling in this module:
//! the sibling connectors answer "is that other process alive", which needs a
//! binary lookup, a discovery file and a socket probe. This one answers "am I
//! alive", and the fact that `detect()` was called is the whole proof. There is
//! no code path on which the console can report itself `Absent` or `Available`:
//! both would mean this process is not running, and a process that is not
//! running does not serve the roster.
//! What: [`ConsoleConnector`], registered in
//! [`all_connectors`](super::all_connectors), reporting `Running`, the
//! `Daemon` lifecycle, and the compiled-in crate version. CPU and RSS are left
//! `None` here and overlaid by the route from the sampler's rings, exactly as
//! they are for every other member — see
//! [`crate::service_metrics::apply_metrics_overlay`].
//! Test: `console_connector_reports_itself_running`,
//! `console_connector_reports_the_crate_version`,
//! `super::tests::test_all_connectors_returns_seven`,
//! `crate::server::tests::services_route_lists_the_console_itself`.
use crate;
/// The console's own row in the Services roster (#6908).
///
/// Why a connector rather than a special case in the route: the roster's shape,
/// its ordering, and the CPU/RSS overlay all run off `all_connectors()`. A row
/// synthesised anywhere else would need the route, the poller cache and the
/// sampler each taught about one exception, and the UI would need a branch to
/// render it. As a connector it is the same row as the other six.
/// What: a zero-sized struct — it holds nothing because `detect()` reads
/// nothing.
/// Test: `console_connector_reports_itself_running`.
;
// ─── tests ────────────────────────────────────────────────────────────────────