risingwave_pb/sim/
telemetry.rs

1// This file is @generated by prost-build.
2#[derive(prost_helpers::AnyPB)]
3#[derive(Clone, Copy, PartialEq, ::prost::Message)]
4pub struct SystemMemory {
5    #[prost(uint64, tag = "1")]
6    pub used: u64,
7    #[prost(uint64, tag = "2")]
8    pub total: u64,
9}
10#[derive(prost_helpers::AnyPB)]
11#[derive(Clone, PartialEq, ::prost::Message)]
12pub struct SystemOs {
13    #[prost(string, tag = "1")]
14    pub name: ::prost::alloc::string::String,
15    #[prost(string, tag = "2")]
16    pub version: ::prost::alloc::string::String,
17    #[prost(string, tag = "3")]
18    pub kernel_version: ::prost::alloc::string::String,
19}
20#[derive(prost_helpers::AnyPB)]
21#[derive(Clone, Copy, PartialEq, ::prost::Message)]
22pub struct SystemCpu {
23    #[prost(float, tag = "1")]
24    pub available: f32,
25}
26#[derive(prost_helpers::AnyPB)]
27#[derive(Clone, PartialEq, ::prost::Message)]
28pub struct SystemData {
29    #[prost(message, optional, tag = "1")]
30    pub memory: ::core::option::Option<SystemMemory>,
31    #[prost(message, optional, tag = "2")]
32    pub os: ::core::option::Option<SystemOs>,
33    #[prost(message, optional, tag = "3")]
34    pub cpu: ::core::option::Option<SystemCpu>,
35}
36/// NodeCount represents how many nodes in this cluster
37#[derive(prost_helpers::AnyPB)]
38#[derive(Clone, Copy, PartialEq, ::prost::Message)]
39pub struct NodeCount {
40    #[prost(uint32, tag = "1")]
41    pub meta: u32,
42    #[prost(uint32, tag = "2")]
43    pub compute: u32,
44    #[prost(uint32, tag = "3")]
45    pub frontend: u32,
46    #[prost(uint32, tag = "4")]
47    pub compactor: u32,
48}
49/// RwVersion represents the version of RisingWave
50#[derive(prost_helpers::AnyPB)]
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct RwVersion {
53    /// Version is the Cargo package version of RisingWave
54    #[prost(string, tag = "1")]
55    pub rw_version: ::prost::alloc::string::String,
56    /// GitSHA is the Git commit SHA of RisingWave
57    #[prost(string, tag = "2")]
58    pub git_sha: ::prost::alloc::string::String,
59}
60#[derive(prost_helpers::AnyPB)]
61#[derive(Clone, PartialEq, ::prost::Message)]
62pub struct ReportBase {
63    /// tracking_id is persistent in meta data
64    #[prost(string, tag = "1")]
65    pub tracking_id: ::prost::alloc::string::String,
66    /// session_id is reset every time node restarts
67    #[prost(string, tag = "2")]
68    pub session_id: ::prost::alloc::string::String,
69    /// system_data is hardware and os info
70    #[prost(message, optional, tag = "3")]
71    pub system_data: ::core::option::Option<SystemData>,
72    /// up_time is how long the node has been running
73    #[prost(uint64, tag = "4")]
74    pub up_time: u64,
75    /// report_time is when the report is created
76    #[prost(uint64, tag = "5")]
77    pub report_time: u64,
78    /// node_type is the node that creates the report
79    #[prost(enumeration = "TelemetryNodeType", tag = "6")]
80    pub node_type: i32,
81    /// mark the report is a test message
82    /// if so, the backend do validations but not store it
83    #[prost(bool, tag = "7")]
84    pub is_test: bool,
85}
86#[derive(prost_helpers::AnyPB)]
87#[derive(Clone, PartialEq, ::prost::Message)]
88pub struct MetaReport {
89    #[prost(message, optional, tag = "1")]
90    pub base: ::core::option::Option<ReportBase>,
91    /// meta_backend is the backend of meta data
92    #[prost(enumeration = "MetaBackend", tag = "2")]
93    pub meta_backend: i32,
94    /// node_count is the count of each node type
95    #[prost(message, optional, tag = "3")]
96    pub node_count: ::core::option::Option<NodeCount>,
97    /// rw_version is the version of RisingWave
98    #[prost(message, optional, tag = "4")]
99    pub rw_version: ::core::option::Option<RwVersion>,
100    /// This field represents the "number of running streaming jobs"
101    /// and is used to indicate whether the cluster is active.
102    #[prost(uint32, tag = "5")]
103    pub stream_job_count: u32,
104    /// stream_jobs is the list of running streaming jobs
105    /// and is used to collect the table_id, connector_name and table_optimizations
106    #[prost(message, repeated, tag = "6")]
107    pub stream_jobs: ::prost::alloc::vec::Vec<StreamJobDesc>,
108    /// How the cluster is deployed
109    #[prost(enumeration = "TelemetryClusterType", tag = "7")]
110    pub cluster_type: i32,
111    /// The object store media type obtained from ObjectStore::store_media_type
112    #[prost(string, tag = "8")]
113    pub object_store_media_type: ::prost::alloc::string::String,
114    /// The connector usage of the cluster
115    #[prost(string, tag = "9")]
116    pub connector_usage_json_str: ::prost::alloc::string::String,
117    /// The license information of the cluster (JSON serialized).
118    /// If there's any error, it will be like `{"error": "error message"}`.
119    #[prost(string, tag = "10")]
120    pub license_info_json_str: ::prost::alloc::string::String,
121}
122#[derive(prost_helpers::AnyPB)]
123#[derive(Clone, PartialEq, ::prost::Message)]
124pub struct StreamJobDesc {
125    #[prost(int32, tag = "1")]
126    pub table_id: i32,
127    #[prost(string, optional, tag = "2")]
128    pub connector_name: ::core::option::Option<::prost::alloc::string::String>,
129    #[prost(enumeration = "PlanOptimization", repeated, tag = "3")]
130    pub plan_optimizations: ::prost::alloc::vec::Vec<i32>,
131}
132#[derive(prost_helpers::AnyPB)]
133#[derive(Clone, PartialEq, ::prost::Message)]
134pub struct ComputeReport {
135    #[prost(message, optional, tag = "1")]
136    pub base: ::core::option::Option<ReportBase>,
137}
138#[derive(prost_helpers::AnyPB)]
139#[derive(Clone, PartialEq, ::prost::Message)]
140pub struct FrontendReport {
141    #[prost(message, optional, tag = "1")]
142    pub base: ::core::option::Option<ReportBase>,
143}
144#[derive(prost_helpers::AnyPB)]
145#[derive(Clone, PartialEq, ::prost::Message)]
146pub struct CompactorReport {
147    #[prost(message, optional, tag = "1")]
148    pub base: ::core::option::Option<ReportBase>,
149}
150#[derive(prost_helpers::AnyPB)]
151#[derive(Clone, PartialEq, ::prost::Message)]
152pub struct EventMessage {
153    /// tracking_id is persistent in meta data
154    #[prost(string, tag = "1")]
155    pub tracking_id: ::prost::alloc::string::String,
156    /// event_time is when the event is created
157    #[prost(uint64, tag = "3")]
158    pub event_time_sec: u64,
159    /// event_stage describes in which process the event happens
160    #[prost(enumeration = "TelemetryEventStage", tag = "4")]
161    pub event_stage: i32,
162    /// feature_name is the name of the feature triggered the event
163    #[prost(string, tag = "5")]
164    pub event_name: ::prost::alloc::string::String,
165    /// connector_name is the name of the connector involves
166    #[prost(string, optional, tag = "6")]
167    pub connector_name: ::core::option::Option<::prost::alloc::string::String>,
168    /// connector_direction is the direction of data flow, can be source or sink
169    #[prost(enumeration = "TelemetryDatabaseObject", optional, tag = "10")]
170    pub object: ::core::option::Option<i32>,
171    /// catalog_id is the id of the catalog involves (table_id/source_id/...)
172    #[prost(int64, tag = "7")]
173    pub catalog_id: i64,
174    /// attributes is the additional information of the event: json format ser to string
175    #[prost(string, optional, tag = "8")]
176    pub attributes: ::core::option::Option<::prost::alloc::string::String>,
177    /// node is the node that creates the event
178    #[prost(string, tag = "9")]
179    pub node: ::prost::alloc::string::String,
180    /// mark the event is a test message
181    #[prost(bool, tag = "11")]
182    pub is_test: bool,
183}
184#[derive(prost_helpers::AnyPB)]
185#[derive(Clone, PartialEq, ::prost::Message)]
186pub struct BatchEventMessage {
187    #[prost(message, repeated, tag = "1")]
188    pub events: ::prost::alloc::vec::Vec<EventMessage>,
189}
190#[derive(prost_helpers::AnyPB)]
191#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
192#[repr(i32)]
193pub enum MetaBackend {
194    Unspecified = 0,
195    Memory = 1,
196    Etcd = 2,
197    Rdb = 3,
198}
199impl MetaBackend {
200    /// String value of the enum field names used in the ProtoBuf definition.
201    ///
202    /// The values are not transformed in any way and thus are considered stable
203    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
204    pub fn as_str_name(&self) -> &'static str {
205        match self {
206            Self::Unspecified => "META_BACKEND_UNSPECIFIED",
207            Self::Memory => "META_BACKEND_MEMORY",
208            Self::Etcd => "META_BACKEND_ETCD",
209            Self::Rdb => "META_BACKEND_RDB",
210        }
211    }
212    /// Creates an enum from field names used in the ProtoBuf definition.
213    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
214        match value {
215            "META_BACKEND_UNSPECIFIED" => Some(Self::Unspecified),
216            "META_BACKEND_MEMORY" => Some(Self::Memory),
217            "META_BACKEND_ETCD" => Some(Self::Etcd),
218            "META_BACKEND_RDB" => Some(Self::Rdb),
219            _ => None,
220        }
221    }
222}
223#[derive(prost_helpers::AnyPB)]
224#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
225#[repr(i32)]
226pub enum TelemetryNodeType {
227    Unspecified = 0,
228    Meta = 1,
229    Compute = 2,
230    Frontend = 3,
231    Compactor = 4,
232}
233impl TelemetryNodeType {
234    /// String value of the enum field names used in the ProtoBuf definition.
235    ///
236    /// The values are not transformed in any way and thus are considered stable
237    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
238    pub fn as_str_name(&self) -> &'static str {
239        match self {
240            Self::Unspecified => "TELEMETRY_NODE_TYPE_UNSPECIFIED",
241            Self::Meta => "TELEMETRY_NODE_TYPE_META",
242            Self::Compute => "TELEMETRY_NODE_TYPE_COMPUTE",
243            Self::Frontend => "TELEMETRY_NODE_TYPE_FRONTEND",
244            Self::Compactor => "TELEMETRY_NODE_TYPE_COMPACTOR",
245        }
246    }
247    /// Creates an enum from field names used in the ProtoBuf definition.
248    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
249        match value {
250            "TELEMETRY_NODE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
251            "TELEMETRY_NODE_TYPE_META" => Some(Self::Meta),
252            "TELEMETRY_NODE_TYPE_COMPUTE" => Some(Self::Compute),
253            "TELEMETRY_NODE_TYPE_FRONTEND" => Some(Self::Frontend),
254            "TELEMETRY_NODE_TYPE_COMPACTOR" => Some(Self::Compactor),
255            _ => None,
256        }
257    }
258}
259#[derive(prost_helpers::AnyPB)]
260#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
261#[repr(i32)]
262pub enum TelemetryClusterType {
263    Unspecified = 0,
264    SingleNode = 1,
265    DockerCompose = 2,
266    Kubernetes = 3,
267    CloudHosted = 4,
268}
269impl TelemetryClusterType {
270    /// String value of the enum field names used in the ProtoBuf definition.
271    ///
272    /// The values are not transformed in any way and thus are considered stable
273    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
274    pub fn as_str_name(&self) -> &'static str {
275        match self {
276            Self::Unspecified => "TELEMETRY_CLUSTER_TYPE_UNSPECIFIED",
277            Self::SingleNode => "TELEMETRY_CLUSTER_TYPE_SINGLE_NODE",
278            Self::DockerCompose => "TELEMETRY_CLUSTER_TYPE_DOCKER_COMPOSE",
279            Self::Kubernetes => "TELEMETRY_CLUSTER_TYPE_KUBERNETES",
280            Self::CloudHosted => "TELEMETRY_CLUSTER_TYPE_CLOUD_HOSTED",
281        }
282    }
283    /// Creates an enum from field names used in the ProtoBuf definition.
284    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
285        match value {
286            "TELEMETRY_CLUSTER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
287            "TELEMETRY_CLUSTER_TYPE_SINGLE_NODE" => Some(Self::SingleNode),
288            "TELEMETRY_CLUSTER_TYPE_DOCKER_COMPOSE" => Some(Self::DockerCompose),
289            "TELEMETRY_CLUSTER_TYPE_KUBERNETES" => Some(Self::Kubernetes),
290            "TELEMETRY_CLUSTER_TYPE_CLOUD_HOSTED" => Some(Self::CloudHosted),
291            _ => None,
292        }
293    }
294}
295#[derive(prost_helpers::AnyPB)]
296#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
297#[repr(i32)]
298pub enum PlanOptimization {
299    TableOptimizationUnspecified = 0,
300}
301impl PlanOptimization {
302    /// String value of the enum field names used in the ProtoBuf definition.
303    ///
304    /// The values are not transformed in any way and thus are considered stable
305    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
306    pub fn as_str_name(&self) -> &'static str {
307        match self {
308            Self::TableOptimizationUnspecified => "TABLE_OPTIMIZATION_UNSPECIFIED",
309        }
310    }
311    /// Creates an enum from field names used in the ProtoBuf definition.
312    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
313        match value {
314            "TABLE_OPTIMIZATION_UNSPECIFIED" => Some(Self::TableOptimizationUnspecified),
315            _ => None,
316        }
317    }
318}
319#[derive(prost_helpers::AnyPB)]
320#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
321#[repr(i32)]
322pub enum TelemetryEventStage {
323    Unspecified = 0,
324    CreateStreamJob = 1,
325    UpdateStreamJob = 2,
326    DropStreamJob = 3,
327    Query = 4,
328    Recovery = 5,
329}
330impl TelemetryEventStage {
331    /// String value of the enum field names used in the ProtoBuf definition.
332    ///
333    /// The values are not transformed in any way and thus are considered stable
334    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
335    pub fn as_str_name(&self) -> &'static str {
336        match self {
337            Self::Unspecified => "TELEMETRY_EVENT_STAGE_UNSPECIFIED",
338            Self::CreateStreamJob => "TELEMETRY_EVENT_STAGE_CREATE_STREAM_JOB",
339            Self::UpdateStreamJob => "TELEMETRY_EVENT_STAGE_UPDATE_STREAM_JOB",
340            Self::DropStreamJob => "TELEMETRY_EVENT_STAGE_DROP_STREAM_JOB",
341            Self::Query => "TELEMETRY_EVENT_STAGE_QUERY",
342            Self::Recovery => "TELEMETRY_EVENT_STAGE_RECOVERY",
343        }
344    }
345    /// Creates an enum from field names used in the ProtoBuf definition.
346    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
347        match value {
348            "TELEMETRY_EVENT_STAGE_UNSPECIFIED" => Some(Self::Unspecified),
349            "TELEMETRY_EVENT_STAGE_CREATE_STREAM_JOB" => Some(Self::CreateStreamJob),
350            "TELEMETRY_EVENT_STAGE_UPDATE_STREAM_JOB" => Some(Self::UpdateStreamJob),
351            "TELEMETRY_EVENT_STAGE_DROP_STREAM_JOB" => Some(Self::DropStreamJob),
352            "TELEMETRY_EVENT_STAGE_QUERY" => Some(Self::Query),
353            "TELEMETRY_EVENT_STAGE_RECOVERY" => Some(Self::Recovery),
354            _ => None,
355        }
356    }
357}
358#[derive(prost_helpers::AnyPB)]
359#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
360#[repr(i32)]
361pub enum TelemetryDatabaseObject {
362    Unspecified = 0,
363    Source = 1,
364    Mv = 2,
365    Table = 3,
366    Sink = 4,
367    Index = 5,
368}
369impl TelemetryDatabaseObject {
370    /// String value of the enum field names used in the ProtoBuf definition.
371    ///
372    /// The values are not transformed in any way and thus are considered stable
373    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
374    pub fn as_str_name(&self) -> &'static str {
375        match self {
376            Self::Unspecified => "TELEMETRY_DATABASE_OBJECT_UNSPECIFIED",
377            Self::Source => "TELEMETRY_DATABASE_OBJECT_SOURCE",
378            Self::Mv => "TELEMETRY_DATABASE_OBJECT_MV",
379            Self::Table => "TELEMETRY_DATABASE_OBJECT_TABLE",
380            Self::Sink => "TELEMETRY_DATABASE_OBJECT_SINK",
381            Self::Index => "TELEMETRY_DATABASE_OBJECT_INDEX",
382        }
383    }
384    /// Creates an enum from field names used in the ProtoBuf definition.
385    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
386        match value {
387            "TELEMETRY_DATABASE_OBJECT_UNSPECIFIED" => Some(Self::Unspecified),
388            "TELEMETRY_DATABASE_OBJECT_SOURCE" => Some(Self::Source),
389            "TELEMETRY_DATABASE_OBJECT_MV" => Some(Self::Mv),
390            "TELEMETRY_DATABASE_OBJECT_TABLE" => Some(Self::Table),
391            "TELEMETRY_DATABASE_OBJECT_SINK" => Some(Self::Sink),
392            "TELEMETRY_DATABASE_OBJECT_INDEX" => Some(Self::Index),
393            _ => None,
394        }
395    }
396}