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