hds_console_api/generated/rs.tokio.console.common.rs
1/// Unique identifier for each task.
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Id {
5 /// The unique identifier's concrete value.
6 #[prost(uint64, tag = "1")]
7 pub id: u64,
8}
9/// A Rust source code location.
10#[allow(clippy::derive_partial_eq_without_eq)]
11#[derive(Clone, PartialEq, ::prost::Message)]
12pub struct Location {
13 /// The file path
14 #[prost(string, optional, tag = "1")]
15 pub file: ::core::option::Option<::prost::alloc::string::String>,
16 /// The Rust module path
17 #[prost(string, optional, tag = "2")]
18 pub module_path: ::core::option::Option<::prost::alloc::string::String>,
19 /// The line number in the source code file.
20 #[prost(uint32, optional, tag = "3")]
21 pub line: ::core::option::Option<u32>,
22 /// The character in `line`.
23 #[prost(uint32, optional, tag = "4")]
24 pub column: ::core::option::Option<u32>,
25}
26/// Unique identifier for metadata.
27#[allow(clippy::derive_partial_eq_without_eq)]
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct MetaId {
30 /// The unique identifier's concrete value.
31 #[prost(uint64, tag = "1")]
32 pub id: u64,
33}
34/// Unique identifier for spans.
35#[allow(clippy::derive_partial_eq_without_eq)]
36#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct SpanId {
38 /// The unique identifier's concrete value.
39 #[prost(uint64, tag = "1")]
40 pub id: u64,
41}
42/// A message representing a key-value pair of data associated with a `Span`
43#[allow(clippy::derive_partial_eq_without_eq)]
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct Field {
46 /// Metadata for the task span that the field came from.
47 #[prost(message, optional, tag = "8")]
48 pub metadata_id: ::core::option::Option<MetaId>,
49 /// The key of the key-value pair.
50 ///
51 /// This is either represented as a string, or as an index into a `Metadata`'s
52 /// array of field name strings.
53 #[prost(oneof = "field::Name", tags = "1, 2")]
54 pub name: ::core::option::Option<field::Name>,
55 /// The value of the key-value pair.
56 #[prost(oneof = "field::Value", tags = "3, 4, 5, 6, 7")]
57 pub value: ::core::option::Option<field::Value>,
58}
59/// Nested message and enum types in `Field`.
60pub mod field {
61 /// The key of the key-value pair.
62 ///
63 /// This is either represented as a string, or as an index into a `Metadata`'s
64 /// array of field name strings.
65 #[allow(clippy::derive_partial_eq_without_eq)]
66 #[derive(Clone, PartialEq, ::prost::Oneof)]
67 pub enum Name {
68 /// The string representation of the name.
69 #[prost(string, tag = "1")]
70 StrName(::prost::alloc::string::String),
71 /// An index position into the `Metadata.field_names` of the metadata
72 /// for the task span that the field came from.
73 #[prost(uint64, tag = "2")]
74 NameIdx(u64),
75 }
76 /// The value of the key-value pair.
77 #[allow(clippy::derive_partial_eq_without_eq)]
78 #[derive(Clone, PartialEq, ::prost::Oneof)]
79 pub enum Value {
80 /// A value serialized to a string using `fmt::Debug`.
81 #[prost(string, tag = "3")]
82 DebugVal(::prost::alloc::string::String),
83 /// A string value.
84 #[prost(string, tag = "4")]
85 StrVal(::prost::alloc::string::String),
86 /// An unsigned integer value.
87 #[prost(uint64, tag = "5")]
88 U64Val(u64),
89 /// A signed integer value.
90 #[prost(sint64, tag = "6")]
91 I64Val(i64),
92 /// A boolean value.
93 #[prost(bool, tag = "7")]
94 BoolVal(bool),
95 }
96}
97/// Represents a period of time in which a program was executing in a particular context.
98///
99/// Corresponds to `Span` in the `tracing` crate.
100#[allow(clippy::derive_partial_eq_without_eq)]
101#[derive(Clone, PartialEq, ::prost::Message)]
102pub struct Span {
103 /// An Id that uniquely identifies it in relation to other spans.
104 #[prost(message, optional, tag = "1")]
105 pub id: ::core::option::Option<SpanId>,
106 /// Identifier for metadata describing static characteristics of all spans originating
107 /// from that callsite, such as its name, source code location, verbosity level, and
108 /// the names of its fields.
109 #[prost(message, optional, tag = "2")]
110 pub metadata_id: ::core::option::Option<MetaId>,
111 /// User-defined key-value pairs of arbitrary data that describe the context the span represents,
112 #[prost(message, repeated, tag = "3")]
113 pub fields: ::prost::alloc::vec::Vec<Field>,
114 /// Timestamp for the span.
115 #[prost(message, optional, tag = "4")]
116 pub at: ::core::option::Option<::prost_types::Timestamp>,
117}
118/// Any new metadata that was registered since the last update.
119#[allow(clippy::derive_partial_eq_without_eq)]
120#[derive(Clone, PartialEq, ::prost::Message)]
121pub struct RegisterMetadata {
122 /// The new metadata that was registered since the last update.
123 #[prost(message, repeated, tag = "1")]
124 pub metadata: ::prost::alloc::vec::Vec<register_metadata::NewMetadata>,
125}
126/// Nested message and enum types in `RegisterMetadata`.
127pub mod register_metadata {
128 /// One metadata element registered since the last update.
129 #[allow(clippy::derive_partial_eq_without_eq)]
130 #[derive(Clone, PartialEq, ::prost::Message)]
131 pub struct NewMetadata {
132 /// Unique identifier for `metadata`.
133 #[prost(message, optional, tag = "1")]
134 pub id: ::core::option::Option<super::MetaId>,
135 /// The metadata payload.
136 #[prost(message, optional, tag = "2")]
137 pub metadata: ::core::option::Option<super::Metadata>,
138 }
139}
140/// Metadata associated with a span or event.
141#[allow(clippy::derive_partial_eq_without_eq)]
142#[derive(Clone, PartialEq, ::prost::Message)]
143pub struct Metadata {
144 /// The name of the span or event.
145 #[prost(string, tag = "1")]
146 pub name: ::prost::alloc::string::String,
147 /// Describes the part of the system where the span or event that this
148 /// metadata describes occurred.
149 #[prost(string, tag = "2")]
150 pub target: ::prost::alloc::string::String,
151 /// The path to the Rust module where the span occurred.
152 #[prost(string, tag = "3")]
153 pub module_path: ::prost::alloc::string::String,
154 /// The Rust source location associated with the span or event.
155 #[prost(message, optional, tag = "4")]
156 pub location: ::core::option::Option<Location>,
157 /// Indicates whether metadata is associated with a span or with an event.
158 #[prost(enumeration = "metadata::Kind", tag = "5")]
159 pub kind: i32,
160 /// Describes the level of verbosity of a span or event.
161 #[prost(enumeration = "metadata::Level", tag = "6")]
162 pub level: i32,
163 /// The names of the key-value fields attached to the
164 /// span or event this metadata is associated with.
165 #[prost(string, repeated, tag = "7")]
166 pub field_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
167}
168/// Nested message and enum types in `Metadata`.
169pub mod metadata {
170 /// Indicates whether metadata is associated with a span or with an event.
171 #[derive(
172 Clone,
173 Copy,
174 Debug,
175 PartialEq,
176 Eq,
177 Hash,
178 PartialOrd,
179 Ord,
180 ::prost::Enumeration
181 )]
182 #[repr(i32)]
183 pub enum Kind {
184 /// Indicates metadata is associated with a span.
185 Span = 0,
186 /// Indicates metadata is associated with an event.
187 Event = 1,
188 }
189 impl Kind {
190 /// String value of the enum field names used in the ProtoBuf definition.
191 ///
192 /// The values are not transformed in any way and thus are considered stable
193 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
194 pub fn as_str_name(&self) -> &'static str {
195 match self {
196 Kind::Span => "SPAN",
197 Kind::Event => "EVENT",
198 }
199 }
200 /// Creates an enum from field names used in the ProtoBuf definition.
201 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
202 match value {
203 "SPAN" => Some(Self::Span),
204 "EVENT" => Some(Self::Event),
205 _ => None,
206 }
207 }
208 }
209 /// Describes the level of verbosity of a span or event.
210 ///
211 /// Corresponds to `Level` in the `tracing` crate.
212 #[derive(
213 Clone,
214 Copy,
215 Debug,
216 PartialEq,
217 Eq,
218 Hash,
219 PartialOrd,
220 Ord,
221 ::prost::Enumeration
222 )]
223 #[repr(i32)]
224 pub enum Level {
225 /// The "error" level.
226 ///
227 /// Designates very serious errors.
228 Error = 0,
229 /// The "warn" level.
230 ///
231 /// Designates hazardous situations.
232 Warn = 1,
233 /// The "info" level.
234 /// Designates useful information.
235 Info = 2,
236 /// The "debug" level.
237 ///
238 /// Designates lower priority information.
239 Debug = 3,
240 /// The "trace" level.
241 ///
242 /// Designates very low priority, often extremely verbose, information.
243 Trace = 4,
244 }
245 impl Level {
246 /// String value of the enum field names used in the ProtoBuf definition.
247 ///
248 /// The values are not transformed in any way and thus are considered stable
249 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
250 pub fn as_str_name(&self) -> &'static str {
251 match self {
252 Level::Error => "ERROR",
253 Level::Warn => "WARN",
254 Level::Info => "INFO",
255 Level::Debug => "DEBUG",
256 Level::Trace => "TRACE",
257 }
258 }
259 /// Creates an enum from field names used in the ProtoBuf definition.
260 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
261 match value {
262 "ERROR" => Some(Self::Error),
263 "WARN" => Some(Self::Warn),
264 "INFO" => Some(Self::Info),
265 "DEBUG" => Some(Self::Debug),
266 "TRACE" => Some(Self::Trace),
267 _ => None,
268 }
269 }
270 }
271}
272/// Contains stats about objects that can be polled. Currently these can be:
273/// - tasks that have been spawned
274/// - async operations on resources that are performed within the context of a task
275#[allow(clippy::derive_partial_eq_without_eq)]
276#[derive(Clone, PartialEq, ::prost::Message)]
277pub struct PollStats {
278 /// The total number of times this object has been polled.
279 #[prost(uint64, tag = "1")]
280 pub polls: u64,
281 /// The timestamp of the first time this object was polled.
282 ///
283 /// If this is `None`, the object has not yet been polled.
284 ///
285 /// Subtracting this timestamp from `created_at` can be used to calculate the
286 /// time to first poll for this object, a measurement of executor latency.
287 #[prost(message, optional, tag = "3")]
288 pub first_poll: ::core::option::Option<::prost_types::Timestamp>,
289 /// The timestamp of the most recent time this objects's poll method was invoked.
290 ///
291 /// If this is `None`, the object has not yet been polled.
292 ///
293 /// If the object has only been polled a single time, then this value may be
294 /// equal to the `first_poll` timestamp.
295 ///
296 #[prost(message, optional, tag = "4")]
297 pub last_poll_started: ::core::option::Option<::prost_types::Timestamp>,
298 /// The timestamp of the most recent time this objects's poll method finished execution.
299 ///
300 /// If this is `None`, the object has not yet been polled or is currently being polled.
301 ///
302 /// If the object does not exist anymore, then this is the time the final invocation of
303 /// its poll method has completed.
304 #[prost(message, optional, tag = "5")]
305 pub last_poll_ended: ::core::option::Option<::prost_types::Timestamp>,
306 /// The total duration this object was being *actively polled*, summed across
307 /// all polls.
308 ///
309 /// Note that this includes only polls that have completed, and does not
310 /// reflect any in-progress polls. Subtracting `busy_time` from the
311 /// total lifetime of the polled object results in the amount of time it
312 /// has spent *waiting* to be polled (including the `scheduled_time` value
313 /// from `TaskStats`, if this is a task).
314 #[prost(message, optional, tag = "6")]
315 pub busy_time: ::core::option::Option<::prost_types::Duration>,
316}
317/// State attributes of an entity. These are dependent on the type of the entity.
318///
319/// For example, a timer resource will have a duration, while a semaphore resource may
320/// have a permit count. Likewise, the async ops of a semaphore may have attributes
321/// indicating how many permits they are trying to acquire vs how many are acquired.
322/// These values may change over time. Therefore, they live in the runtime stats rather
323/// than the static data describing the entity.
324#[allow(clippy::derive_partial_eq_without_eq)]
325#[derive(Clone, PartialEq, ::prost::Message)]
326pub struct Attribute {
327 /// The key-value pair for the attribute
328 #[prost(message, optional, tag = "1")]
329 pub field: ::core::option::Option<Field>,
330 /// Some values carry a unit of measurement. For example, a duration
331 /// carries an associated unit of time, such as "ms" for milliseconds.
332 #[prost(string, optional, tag = "2")]
333 pub unit: ::core::option::Option<::prost::alloc::string::String>,
334}