majordomus_cli/bench/
system.rs1use schemars::JsonSchema;
7use serde::{Deserialize, Serialize};
8
9#[derive(
11 Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, JsonSchema,
12)]
13#[serde(rename_all = "snake_case")]
14pub enum SystemTarget {
15 McpProcessCold,
17 McpInitialize,
19 McpPing,
21 McpToolsList,
23 McpResourcesList,
25 McpResourcesRead,
27 HttpIndex,
29 HttpHome,
31 HttpOpenApi,
33 HttpSwagger,
35 HttpCockpitOverview,
37 HttpCockpitCapabilities,
39 HttpCockpitGraph,
41 HttpIndexLive,
46}
47
48impl SystemTarget {
49 pub const ALL: [SystemTarget; 14] = [
51 SystemTarget::McpProcessCold,
52 SystemTarget::McpInitialize,
53 SystemTarget::McpPing,
54 SystemTarget::McpToolsList,
55 SystemTarget::McpResourcesList,
56 SystemTarget::McpResourcesRead,
57 SystemTarget::HttpIndex,
58 SystemTarget::HttpHome,
59 SystemTarget::HttpOpenApi,
60 SystemTarget::HttpSwagger,
61 SystemTarget::HttpCockpitOverview,
62 SystemTarget::HttpCockpitCapabilities,
63 SystemTarget::HttpCockpitGraph,
64 SystemTarget::HttpIndexLive,
65 ];
66
67 pub fn key(self) -> &'static str {
69 match self {
70 SystemTarget::McpProcessCold => "system.mcp.process_cold",
71 SystemTarget::McpInitialize => "system.mcp.initialize",
72 SystemTarget::McpPing => "system.mcp.ping",
73 SystemTarget::McpToolsList => "system.mcp.tools_list",
74 SystemTarget::McpResourcesList => "system.mcp.resources_list",
75 SystemTarget::McpResourcesRead => "system.mcp.resources_read",
76 SystemTarget::HttpIndex => "system.http.index",
77 SystemTarget::HttpHome => "system.http.home",
78 SystemTarget::HttpOpenApi => "system.http.openapi",
79 SystemTarget::HttpSwagger => "system.http.swagger",
80 SystemTarget::HttpCockpitOverview => "system.http.cockpit_overview",
81 SystemTarget::HttpCockpitCapabilities => "system.http.cockpit_capabilities",
82 SystemTarget::HttpCockpitGraph => "system.http.cockpit_graph",
83 SystemTarget::HttpIndexLive => "system.http.live.index",
84 }
85 }
86
87 pub fn transport(self) -> super::Transport {
89 match self {
90 SystemTarget::McpProcessCold
91 | SystemTarget::McpInitialize
92 | SystemTarget::McpPing
93 | SystemTarget::McpToolsList
94 | SystemTarget::McpResourcesList
95 | SystemTarget::McpResourcesRead => super::Transport::Mcp,
96 SystemTarget::HttpIndex
97 | SystemTarget::HttpHome
98 | SystemTarget::HttpOpenApi
99 | SystemTarget::HttpSwagger
100 | SystemTarget::HttpCockpitOverview
101 | SystemTarget::HttpCockpitCapabilities
102 | SystemTarget::HttpCockpitGraph
103 | SystemTarget::HttpIndexLive => super::Transport::Http,
104 }
105 }
106
107 pub fn description(self) -> &'static str {
109 match self {
110 SystemTarget::McpProcessCold => {
111 "spawn a majordomus mcp process, initialize, first tools/list"
112 }
113 SystemTarget::McpInitialize => "initialize on a running process",
114 SystemTarget::McpPing => "ping: the protocol round trip with nothing behind it",
115 SystemTarget::McpToolsList => "tools/list",
116 SystemTarget::McpResourcesList => "resources/list",
117 SystemTarget::McpResourcesRead => "resources/read of the first declarative resource",
118 SystemTarget::HttpIndex => "GET / (the topology as JSON)",
119 SystemTarget::HttpHome => {
120 "GET / with Accept: text/html (the home page, rendered from the topology)"
121 }
122 SystemTarget::HttpOpenApi => "GET /openapi.json",
123 SystemTarget::HttpSwagger => "GET /swagger (the Swagger UI shell)",
124 SystemTarget::HttpCockpitOverview => {
125 "GET /cockpit (the Cockpit's landing page, server-rendered)"
126 }
127 SystemTarget::HttpCockpitCapabilities => {
128 "GET /cockpit/capabilities (every capability as a table: the widest page)"
129 }
130 SystemTarget::HttpCockpitGraph => {
131 "GET /cockpit/graphs/registry (a page whose content is a derived graph)"
132 }
133 SystemTarget::HttpIndexLive => {
134 "GET / over the live view a served process uses (the per-request git stamp and surface resolution)"
135 }
136 }
137 }
138}