risingwave_pb/
monitor_service.rs

1// This file is @generated by prost-build.
2#[derive(prost_helpers::AnyPB)]
3#[derive(Clone, Copy, PartialEq, ::prost::Message)]
4pub struct StackTraceRequest {
5    #[prost(enumeration = "stack_trace_request::ActorTracesFormat", tag = "1")]
6    pub actor_traces_format: i32,
7}
8/// Nested message and enum types in `StackTraceRequest`.
9pub mod stack_trace_request {
10    #[derive(prost_helpers::AnyPB)]
11    #[derive(
12        Clone,
13        Copy,
14        Debug,
15        PartialEq,
16        Eq,
17        Hash,
18        PartialOrd,
19        Ord,
20        ::prost::Enumeration
21    )]
22    #[repr(i32)]
23    pub enum ActorTracesFormat {
24        Unspecified = 0,
25        Json = 1,
26        Text = 2,
27    }
28    impl ActorTracesFormat {
29        /// String value of the enum field names used in the ProtoBuf definition.
30        ///
31        /// The values are not transformed in any way and thus are considered stable
32        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
33        pub fn as_str_name(&self) -> &'static str {
34            match self {
35                Self::Unspecified => "UNSPECIFIED",
36                Self::Json => "JSON",
37                Self::Text => "TEXT",
38            }
39        }
40        /// Creates an enum from field names used in the ProtoBuf definition.
41        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
42            match value {
43                "UNSPECIFIED" => Some(Self::Unspecified),
44                "JSON" => Some(Self::Json),
45                "TEXT" => Some(Self::Text),
46                _ => None,
47            }
48        }
49    }
50}
51#[derive(prost_helpers::AnyPB)]
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct StackTraceResponse {
54    #[prost(btree_map = "uint32, string", tag = "1")]
55    pub actor_traces: ::prost::alloc::collections::BTreeMap<
56        u32,
57        ::prost::alloc::string::String,
58    >,
59    #[prost(btree_map = "string, string", tag = "2")]
60    pub rpc_traces: ::prost::alloc::collections::BTreeMap<
61        ::prost::alloc::string::String,
62        ::prost::alloc::string::String,
63    >,
64    #[prost(btree_map = "string, string", tag = "3")]
65    pub compaction_task_traces: ::prost::alloc::collections::BTreeMap<
66        ::prost::alloc::string::String,
67        ::prost::alloc::string::String,
68    >,
69    #[prost(btree_map = "uint64, string", tag = "4")]
70    pub inflight_barrier_traces: ::prost::alloc::collections::BTreeMap<
71        u64,
72        ::prost::alloc::string::String,
73    >,
74    /// key: worker id
75    #[prost(btree_map = "uint32, string", tag = "5", wrapper = "crate::id::WorkerId")]
76    pub barrier_worker_state: ::prost::alloc::collections::BTreeMap<
77        crate::id::WorkerId,
78        ::prost::alloc::string::String,
79    >,
80    /// key: worker id. Might be empty if the worker doesn't run JVM.
81    #[prost(btree_map = "uint32, string", tag = "6", wrapper = "crate::id::WorkerId")]
82    pub jvm_stack_traces: ::prost::alloc::collections::BTreeMap<
83        crate::id::WorkerId,
84        ::prost::alloc::string::String,
85    >,
86    #[prost(btree_map = "string, string", tag = "7")]
87    pub meta_traces: ::prost::alloc::collections::BTreeMap<
88        ::prost::alloc::string::String,
89        ::prost::alloc::string::String,
90    >,
91    /// Per-worker error messages when collecting stack traces from the cluster.
92    /// Key: worker id.
93    #[prost(btree_map = "uint32, string", tag = "8", wrapper = "crate::id::WorkerId")]
94    pub node_errors: ::prost::alloc::collections::BTreeMap<
95        crate::id::WorkerId,
96        ::prost::alloc::string::String,
97    >,
98}
99/// CPU profiling
100#[derive(prost_helpers::AnyPB)]
101#[derive(Clone, Copy, PartialEq, ::prost::Message)]
102pub struct ProfilingRequest {
103    /// How long the profiling should last.
104    #[prost(uint64, tag = "1")]
105    pub sleep_s: u64,
106}
107#[derive(prost_helpers::AnyPB)]
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct ProfilingResponse {
110    #[prost(bytes = "vec", tag = "1")]
111    pub result: ::prost::alloc::vec::Vec<u8>,
112}
113/// Heap profiling
114#[derive(prost_helpers::AnyPB)]
115#[derive(Clone, PartialEq, ::prost::Message)]
116pub struct HeapProfilingRequest {
117    /// The directory that the dumped file in
118    #[prost(string, tag = "1")]
119    pub dir: ::prost::alloc::string::String,
120}
121#[derive(prost_helpers::AnyPB)]
122#[derive(Clone, Copy, PartialEq, ::prost::Message)]
123pub struct HeapProfilingResponse {}
124#[derive(prost_helpers::AnyPB)]
125#[derive(Clone, Copy, PartialEq, ::prost::Message)]
126pub struct ListHeapProfilingRequest {}
127#[derive(prost_helpers::AnyPB)]
128#[derive(Clone, PartialEq, ::prost::Message)]
129pub struct ListHeapProfilingResponse {
130    #[prost(string, tag = "1")]
131    pub dir: ::prost::alloc::string::String,
132    #[prost(string, repeated, tag = "2")]
133    pub name_manually: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
134    #[prost(string, repeated, tag = "3")]
135    pub name_auto: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
136}
137/// Analyze dumped files
138#[derive(prost_helpers::AnyPB)]
139#[derive(Clone, PartialEq, ::prost::Message)]
140pub struct AnalyzeHeapRequest {
141    /// The file path
142    #[prost(string, tag = "1")]
143    pub path: ::prost::alloc::string::String,
144}
145#[derive(prost_helpers::AnyPB)]
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct AnalyzeHeapResponse {
148    #[prost(bytes = "vec", tag = "1")]
149    pub result: ::prost::alloc::vec::Vec<u8>,
150}
151/// Streaming Runtime Stats
152#[derive(prost_helpers::AnyPB)]
153#[derive(Clone, Copy, PartialEq, ::prost::Message)]
154pub struct GetStreamingStatsRequest {}
155#[derive(prost_helpers::AnyPB)]
156#[derive(Clone, Copy, PartialEq, ::prost::Message)]
157pub struct ChannelStats {
158    /// Total number of actors. This field is very important because the rest fields are `SUM` of all the actors.
159    ///
160    /// Use shorter name in JSON to reduce message size.
161    #[prost(uint32, tag = "1")]
162    pub actor_count: u32,
163    /// Sum of output blocking duration of all actors in nanoseconds
164    #[prost(double, tag = "2")]
165    pub output_blocking_duration: f64,
166    /// Sum of input row count of all actors
167    #[prost(uint64, tag = "3")]
168    pub recv_row_count: u64,
169    /// Sum of output row count of all actors
170    #[prost(uint64, tag = "4")]
171    pub send_row_count: u64,
172}
173#[derive(prost_helpers::AnyPB)]
174#[derive(Clone, Copy, PartialEq, ::prost::Message)]
175pub struct ChannelDeltaStats {
176    #[prost(uint32, tag = "1")]
177    pub actor_count: u32,
178    /// Sum of output blocking duration of all actors in nanoseconds
179    #[prost(double, tag = "2")]
180    pub backpressure_rate: f64,
181    /// Sum of input row count of all actors
182    #[prost(double, tag = "3")]
183    pub recv_throughput: f64,
184    /// Sum of output row count of all actors
185    #[prost(double, tag = "4")]
186    pub send_throughput: f64,
187}
188#[derive(prost_helpers::AnyPB)]
189#[derive(Clone, Copy, PartialEq, ::prost::Message)]
190pub struct FragmentStats {
191    #[prost(uint32, tag = "2")]
192    pub actor_count: u32,
193    #[prost(uint64, tag = "3")]
194    pub current_epoch: u64,
195}
196#[derive(prost_helpers::AnyPB)]
197#[derive(Clone, Copy, PartialEq, ::prost::Message)]
198pub struct RelationStats {
199    #[prost(uint32, tag = "2")]
200    pub actor_count: u32,
201    #[prost(uint64, tag = "3")]
202    pub current_epoch: u64,
203}
204#[derive(prost_helpers::AnyPB)]
205#[derive(Clone, PartialEq, ::prost::Message)]
206pub struct GetStreamingStatsResponse {
207    /// Key: "<upstream_fragment_id>_<downstream_fragment_id>"
208    #[prost(map = "string, message", tag = "1")]
209    pub channel_stats: ::std::collections::HashMap<
210        ::prost::alloc::string::String,
211        ChannelStats,
212    >,
213    #[prost(map = "uint32, message", tag = "2")]
214    pub fragment_stats: ::std::collections::HashMap<u32, FragmentStats>,
215    #[prost(map = "uint32, message", tag = "3")]
216    pub relation_stats: ::std::collections::HashMap<u32, RelationStats>,
217}
218#[derive(prost_helpers::AnyPB)]
219#[derive(Clone, PartialEq, ::prost::Message)]
220pub struct GetStreamingPrometheusStatsResponse {
221    /// Key: "<upstream_fragment_id>_<downstream_fragment_id>"
222    #[prost(map = "string, message", tag = "1")]
223    pub channel_stats: ::std::collections::HashMap<
224        ::prost::alloc::string::String,
225        ChannelDeltaStats,
226    >,
227    #[prost(map = "uint32, message", tag = "2")]
228    pub fragment_stats: ::std::collections::HashMap<u32, FragmentStats>,
229    #[prost(map = "uint32, message", tag = "3")]
230    pub relation_stats: ::std::collections::HashMap<u32, RelationStats>,
231}
232#[derive(prost_helpers::AnyPB)]
233#[derive(Clone, Copy, PartialEq, ::prost::Message)]
234pub struct TieredCacheTracingRequest {
235    #[prost(bool, tag = "1")]
236    pub enable: bool,
237    #[prost(uint32, optional, tag = "2")]
238    pub record_hybrid_insert_threshold_ms: ::core::option::Option<u32>,
239    #[prost(uint32, optional, tag = "3")]
240    pub record_hybrid_get_threshold_ms: ::core::option::Option<u32>,
241    #[prost(uint32, optional, tag = "4")]
242    pub record_hybrid_obtain_threshold_ms: ::core::option::Option<u32>,
243    #[prost(uint32, optional, tag = "5")]
244    pub record_hybrid_remove_threshold_ms: ::core::option::Option<u32>,
245    #[prost(uint32, optional, tag = "6")]
246    pub record_hybrid_fetch_threshold_ms: ::core::option::Option<u32>,
247}
248#[derive(prost_helpers::AnyPB)]
249#[derive(Clone, Copy, PartialEq, ::prost::Message)]
250pub struct TieredCacheTracingResponse {}
251#[derive(prost_helpers::AnyPB)]
252#[derive(Clone, PartialEq, ::prost::Message)]
253pub struct GetProfileStatsRequest {
254    /// Executors to fetch statistics for.
255    #[prost(uint64, repeated, tag = "1", wrapper = "crate::id::ExecutorId")]
256    pub executor_ids: ::prost::alloc::vec::Vec<crate::id::ExecutorId>,
257    /// Dispatchers do not have executors.
258    /// We have to fetch their statistics separately.
259    #[prost(uint32, repeated, tag = "2", wrapper = "crate::id::FragmentId")]
260    pub dispatcher_fragment_ids: ::prost::alloc::vec::Vec<crate::id::FragmentId>,
261}
262#[derive(prost_helpers::AnyPB)]
263#[derive(Clone, PartialEq, ::prost::Message)]
264pub struct GetProfileStatsResponse {
265    #[prost(map = "uint64, uint64", tag = "1", wrapper = "crate::id::ExecutorId")]
266    pub stream_node_output_row_count: ::std::collections::HashMap<
267        crate::id::ExecutorId,
268        u64,
269    >,
270    #[prost(map = "uint64, uint64", tag = "2", wrapper = "crate::id::ExecutorId")]
271    pub stream_node_output_blocking_duration_ns: ::std::collections::HashMap<
272        crate::id::ExecutorId,
273        u64,
274    >,
275    #[prost(map = "uint32, uint64", tag = "3", wrapper = "crate::id::FragmentId")]
276    pub dispatch_fragment_output_row_count: ::std::collections::HashMap<
277        crate::id::FragmentId,
278        u64,
279    >,
280    #[prost(map = "uint32, uint64", tag = "4", wrapper = "crate::id::FragmentId")]
281    pub dispatch_fragment_output_blocking_duration_ns: ::std::collections::HashMap<
282        crate::id::FragmentId,
283        u64,
284    >,
285}
286/// Generated client implementations.
287pub mod monitor_service_client {
288    #![allow(
289        unused_variables,
290        dead_code,
291        missing_docs,
292        clippy::wildcard_imports,
293        clippy::let_unit_value,
294    )]
295    use tonic::codegen::*;
296    use tonic::codegen::http::Uri;
297    #[derive(Debug, Clone)]
298    pub struct MonitorServiceClient<T> {
299        inner: tonic::client::Grpc<T>,
300    }
301    impl MonitorServiceClient<tonic::transport::Channel> {
302        /// Attempt to create a new client by connecting to a given endpoint.
303        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
304        where
305            D: TryInto<tonic::transport::Endpoint>,
306            D::Error: Into<StdError>,
307        {
308            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
309            Ok(Self::new(conn))
310        }
311    }
312    impl<T> MonitorServiceClient<T>
313    where
314        T: tonic::client::GrpcService<tonic::body::BoxBody>,
315        T::Error: Into<StdError>,
316        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
317        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
318    {
319        pub fn new(inner: T) -> Self {
320            let inner = tonic::client::Grpc::new(inner);
321            Self { inner }
322        }
323        pub fn with_origin(inner: T, origin: Uri) -> Self {
324            let inner = tonic::client::Grpc::with_origin(inner, origin);
325            Self { inner }
326        }
327        pub fn with_interceptor<F>(
328            inner: T,
329            interceptor: F,
330        ) -> MonitorServiceClient<InterceptedService<T, F>>
331        where
332            F: tonic::service::Interceptor,
333            T::ResponseBody: Default,
334            T: tonic::codegen::Service<
335                http::Request<tonic::body::BoxBody>,
336                Response = http::Response<
337                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
338                >,
339            >,
340            <T as tonic::codegen::Service<
341                http::Request<tonic::body::BoxBody>,
342            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
343        {
344            MonitorServiceClient::new(InterceptedService::new(inner, interceptor))
345        }
346        /// Compress requests with the given encoding.
347        ///
348        /// This requires the server to support it otherwise it might respond with an
349        /// error.
350        #[must_use]
351        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
352            self.inner = self.inner.send_compressed(encoding);
353            self
354        }
355        /// Enable decompressing responses.
356        #[must_use]
357        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
358            self.inner = self.inner.accept_compressed(encoding);
359            self
360        }
361        /// Limits the maximum size of a decoded message.
362        ///
363        /// Default: `4MB`
364        #[must_use]
365        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
366            self.inner = self.inner.max_decoding_message_size(limit);
367            self
368        }
369        /// Limits the maximum size of an encoded message.
370        ///
371        /// Default: `usize::MAX`
372        #[must_use]
373        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
374            self.inner = self.inner.max_encoding_message_size(limit);
375            self
376        }
377        pub async fn stack_trace(
378            &mut self,
379            request: impl tonic::IntoRequest<super::StackTraceRequest>,
380        ) -> std::result::Result<
381            tonic::Response<super::StackTraceResponse>,
382            tonic::Status,
383        > {
384            self.inner
385                .ready()
386                .await
387                .map_err(|e| {
388                    tonic::Status::unknown(
389                        format!("Service was not ready: {}", e.into()),
390                    )
391                })?;
392            let codec = tonic::codec::ProstCodec::default();
393            let path = http::uri::PathAndQuery::from_static(
394                "/monitor_service.MonitorService/StackTrace",
395            );
396            let mut req = request.into_request();
397            req.extensions_mut()
398                .insert(GrpcMethod::new("monitor_service.MonitorService", "StackTrace"));
399            self.inner.unary(req, path, codec).await
400        }
401        pub async fn profiling(
402            &mut self,
403            request: impl tonic::IntoRequest<super::ProfilingRequest>,
404        ) -> std::result::Result<
405            tonic::Response<super::ProfilingResponse>,
406            tonic::Status,
407        > {
408            self.inner
409                .ready()
410                .await
411                .map_err(|e| {
412                    tonic::Status::unknown(
413                        format!("Service was not ready: {}", e.into()),
414                    )
415                })?;
416            let codec = tonic::codec::ProstCodec::default();
417            let path = http::uri::PathAndQuery::from_static(
418                "/monitor_service.MonitorService/Profiling",
419            );
420            let mut req = request.into_request();
421            req.extensions_mut()
422                .insert(GrpcMethod::new("monitor_service.MonitorService", "Profiling"));
423            self.inner.unary(req, path, codec).await
424        }
425        pub async fn heap_profiling(
426            &mut self,
427            request: impl tonic::IntoRequest<super::HeapProfilingRequest>,
428        ) -> std::result::Result<
429            tonic::Response<super::HeapProfilingResponse>,
430            tonic::Status,
431        > {
432            self.inner
433                .ready()
434                .await
435                .map_err(|e| {
436                    tonic::Status::unknown(
437                        format!("Service was not ready: {}", e.into()),
438                    )
439                })?;
440            let codec = tonic::codec::ProstCodec::default();
441            let path = http::uri::PathAndQuery::from_static(
442                "/monitor_service.MonitorService/HeapProfiling",
443            );
444            let mut req = request.into_request();
445            req.extensions_mut()
446                .insert(
447                    GrpcMethod::new("monitor_service.MonitorService", "HeapProfiling"),
448                );
449            self.inner.unary(req, path, codec).await
450        }
451        pub async fn list_heap_profiling(
452            &mut self,
453            request: impl tonic::IntoRequest<super::ListHeapProfilingRequest>,
454        ) -> std::result::Result<
455            tonic::Response<super::ListHeapProfilingResponse>,
456            tonic::Status,
457        > {
458            self.inner
459                .ready()
460                .await
461                .map_err(|e| {
462                    tonic::Status::unknown(
463                        format!("Service was not ready: {}", e.into()),
464                    )
465                })?;
466            let codec = tonic::codec::ProstCodec::default();
467            let path = http::uri::PathAndQuery::from_static(
468                "/monitor_service.MonitorService/ListHeapProfiling",
469            );
470            let mut req = request.into_request();
471            req.extensions_mut()
472                .insert(
473                    GrpcMethod::new(
474                        "monitor_service.MonitorService",
475                        "ListHeapProfiling",
476                    ),
477                );
478            self.inner.unary(req, path, codec).await
479        }
480        pub async fn analyze_heap(
481            &mut self,
482            request: impl tonic::IntoRequest<super::AnalyzeHeapRequest>,
483        ) -> std::result::Result<
484            tonic::Response<super::AnalyzeHeapResponse>,
485            tonic::Status,
486        > {
487            self.inner
488                .ready()
489                .await
490                .map_err(|e| {
491                    tonic::Status::unknown(
492                        format!("Service was not ready: {}", e.into()),
493                    )
494                })?;
495            let codec = tonic::codec::ProstCodec::default();
496            let path = http::uri::PathAndQuery::from_static(
497                "/monitor_service.MonitorService/AnalyzeHeap",
498            );
499            let mut req = request.into_request();
500            req.extensions_mut()
501                .insert(
502                    GrpcMethod::new("monitor_service.MonitorService", "AnalyzeHeap"),
503                );
504            self.inner.unary(req, path, codec).await
505        }
506        pub async fn get_streaming_stats(
507            &mut self,
508            request: impl tonic::IntoRequest<super::GetStreamingStatsRequest>,
509        ) -> std::result::Result<
510            tonic::Response<super::GetStreamingStatsResponse>,
511            tonic::Status,
512        > {
513            self.inner
514                .ready()
515                .await
516                .map_err(|e| {
517                    tonic::Status::unknown(
518                        format!("Service was not ready: {}", e.into()),
519                    )
520                })?;
521            let codec = tonic::codec::ProstCodec::default();
522            let path = http::uri::PathAndQuery::from_static(
523                "/monitor_service.MonitorService/GetStreamingStats",
524            );
525            let mut req = request.into_request();
526            req.extensions_mut()
527                .insert(
528                    GrpcMethod::new(
529                        "monitor_service.MonitorService",
530                        "GetStreamingStats",
531                    ),
532                );
533            self.inner.unary(req, path, codec).await
534        }
535        pub async fn tiered_cache_tracing(
536            &mut self,
537            request: impl tonic::IntoRequest<super::TieredCacheTracingRequest>,
538        ) -> std::result::Result<
539            tonic::Response<super::TieredCacheTracingResponse>,
540            tonic::Status,
541        > {
542            self.inner
543                .ready()
544                .await
545                .map_err(|e| {
546                    tonic::Status::unknown(
547                        format!("Service was not ready: {}", e.into()),
548                    )
549                })?;
550            let codec = tonic::codec::ProstCodec::default();
551            let path = http::uri::PathAndQuery::from_static(
552                "/monitor_service.MonitorService/TieredCacheTracing",
553            );
554            let mut req = request.into_request();
555            req.extensions_mut()
556                .insert(
557                    GrpcMethod::new(
558                        "monitor_service.MonitorService",
559                        "TieredCacheTracing",
560                    ),
561                );
562            self.inner.unary(req, path, codec).await
563        }
564        pub async fn get_profile_stats(
565            &mut self,
566            request: impl tonic::IntoRequest<super::GetProfileStatsRequest>,
567        ) -> std::result::Result<
568            tonic::Response<super::GetProfileStatsResponse>,
569            tonic::Status,
570        > {
571            self.inner
572                .ready()
573                .await
574                .map_err(|e| {
575                    tonic::Status::unknown(
576                        format!("Service was not ready: {}", e.into()),
577                    )
578                })?;
579            let codec = tonic::codec::ProstCodec::default();
580            let path = http::uri::PathAndQuery::from_static(
581                "/monitor_service.MonitorService/GetProfileStats",
582            );
583            let mut req = request.into_request();
584            req.extensions_mut()
585                .insert(
586                    GrpcMethod::new("monitor_service.MonitorService", "GetProfileStats"),
587                );
588            self.inner.unary(req, path, codec).await
589        }
590    }
591}
592/// Generated server implementations.
593pub mod monitor_service_server {
594    #![allow(
595        unused_variables,
596        dead_code,
597        missing_docs,
598        clippy::wildcard_imports,
599        clippy::let_unit_value,
600    )]
601    use tonic::codegen::*;
602    /// Generated trait containing gRPC methods that should be implemented for use with MonitorServiceServer.
603    #[async_trait]
604    pub trait MonitorService: std::marker::Send + std::marker::Sync + 'static {
605        async fn stack_trace(
606            &self,
607            request: tonic::Request<super::StackTraceRequest>,
608        ) -> std::result::Result<
609            tonic::Response<super::StackTraceResponse>,
610            tonic::Status,
611        >;
612        async fn profiling(
613            &self,
614            request: tonic::Request<super::ProfilingRequest>,
615        ) -> std::result::Result<
616            tonic::Response<super::ProfilingResponse>,
617            tonic::Status,
618        >;
619        async fn heap_profiling(
620            &self,
621            request: tonic::Request<super::HeapProfilingRequest>,
622        ) -> std::result::Result<
623            tonic::Response<super::HeapProfilingResponse>,
624            tonic::Status,
625        >;
626        async fn list_heap_profiling(
627            &self,
628            request: tonic::Request<super::ListHeapProfilingRequest>,
629        ) -> std::result::Result<
630            tonic::Response<super::ListHeapProfilingResponse>,
631            tonic::Status,
632        >;
633        async fn analyze_heap(
634            &self,
635            request: tonic::Request<super::AnalyzeHeapRequest>,
636        ) -> std::result::Result<
637            tonic::Response<super::AnalyzeHeapResponse>,
638            tonic::Status,
639        >;
640        async fn get_streaming_stats(
641            &self,
642            request: tonic::Request<super::GetStreamingStatsRequest>,
643        ) -> std::result::Result<
644            tonic::Response<super::GetStreamingStatsResponse>,
645            tonic::Status,
646        >;
647        async fn tiered_cache_tracing(
648            &self,
649            request: tonic::Request<super::TieredCacheTracingRequest>,
650        ) -> std::result::Result<
651            tonic::Response<super::TieredCacheTracingResponse>,
652            tonic::Status,
653        >;
654        async fn get_profile_stats(
655            &self,
656            request: tonic::Request<super::GetProfileStatsRequest>,
657        ) -> std::result::Result<
658            tonic::Response<super::GetProfileStatsResponse>,
659            tonic::Status,
660        >;
661    }
662    #[derive(Debug)]
663    pub struct MonitorServiceServer<T> {
664        inner: Arc<T>,
665        accept_compression_encodings: EnabledCompressionEncodings,
666        send_compression_encodings: EnabledCompressionEncodings,
667        max_decoding_message_size: Option<usize>,
668        max_encoding_message_size: Option<usize>,
669    }
670    impl<T> MonitorServiceServer<T> {
671        pub fn new(inner: T) -> Self {
672            Self::from_arc(Arc::new(inner))
673        }
674        pub fn from_arc(inner: Arc<T>) -> Self {
675            Self {
676                inner,
677                accept_compression_encodings: Default::default(),
678                send_compression_encodings: Default::default(),
679                max_decoding_message_size: None,
680                max_encoding_message_size: None,
681            }
682        }
683        pub fn with_interceptor<F>(
684            inner: T,
685            interceptor: F,
686        ) -> InterceptedService<Self, F>
687        where
688            F: tonic::service::Interceptor,
689        {
690            InterceptedService::new(Self::new(inner), interceptor)
691        }
692        /// Enable decompressing requests with the given encoding.
693        #[must_use]
694        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
695            self.accept_compression_encodings.enable(encoding);
696            self
697        }
698        /// Compress responses with the given encoding, if the client supports it.
699        #[must_use]
700        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
701            self.send_compression_encodings.enable(encoding);
702            self
703        }
704        /// Limits the maximum size of a decoded message.
705        ///
706        /// Default: `4MB`
707        #[must_use]
708        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
709            self.max_decoding_message_size = Some(limit);
710            self
711        }
712        /// Limits the maximum size of an encoded message.
713        ///
714        /// Default: `usize::MAX`
715        #[must_use]
716        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
717            self.max_encoding_message_size = Some(limit);
718            self
719        }
720    }
721    impl<T, B> tonic::codegen::Service<http::Request<B>> for MonitorServiceServer<T>
722    where
723        T: MonitorService,
724        B: Body + std::marker::Send + 'static,
725        B::Error: Into<StdError> + std::marker::Send + 'static,
726    {
727        type Response = http::Response<tonic::body::BoxBody>;
728        type Error = std::convert::Infallible;
729        type Future = BoxFuture<Self::Response, Self::Error>;
730        fn poll_ready(
731            &mut self,
732            _cx: &mut Context<'_>,
733        ) -> Poll<std::result::Result<(), Self::Error>> {
734            Poll::Ready(Ok(()))
735        }
736        fn call(&mut self, req: http::Request<B>) -> Self::Future {
737            match req.uri().path() {
738                "/monitor_service.MonitorService/StackTrace" => {
739                    #[allow(non_camel_case_types)]
740                    struct StackTraceSvc<T: MonitorService>(pub Arc<T>);
741                    impl<
742                        T: MonitorService,
743                    > tonic::server::UnaryService<super::StackTraceRequest>
744                    for StackTraceSvc<T> {
745                        type Response = super::StackTraceResponse;
746                        type Future = BoxFuture<
747                            tonic::Response<Self::Response>,
748                            tonic::Status,
749                        >;
750                        fn call(
751                            &mut self,
752                            request: tonic::Request<super::StackTraceRequest>,
753                        ) -> Self::Future {
754                            let inner = Arc::clone(&self.0);
755                            let fut = async move {
756                                <T as MonitorService>::stack_trace(&inner, request).await
757                            };
758                            Box::pin(fut)
759                        }
760                    }
761                    let accept_compression_encodings = self.accept_compression_encodings;
762                    let send_compression_encodings = self.send_compression_encodings;
763                    let max_decoding_message_size = self.max_decoding_message_size;
764                    let max_encoding_message_size = self.max_encoding_message_size;
765                    let inner = self.inner.clone();
766                    let fut = async move {
767                        let method = StackTraceSvc(inner);
768                        let codec = tonic::codec::ProstCodec::default();
769                        let mut grpc = tonic::server::Grpc::new(codec)
770                            .apply_compression_config(
771                                accept_compression_encodings,
772                                send_compression_encodings,
773                            )
774                            .apply_max_message_size_config(
775                                max_decoding_message_size,
776                                max_encoding_message_size,
777                            );
778                        let res = grpc.unary(method, req).await;
779                        Ok(res)
780                    };
781                    Box::pin(fut)
782                }
783                "/monitor_service.MonitorService/Profiling" => {
784                    #[allow(non_camel_case_types)]
785                    struct ProfilingSvc<T: MonitorService>(pub Arc<T>);
786                    impl<
787                        T: MonitorService,
788                    > tonic::server::UnaryService<super::ProfilingRequest>
789                    for ProfilingSvc<T> {
790                        type Response = super::ProfilingResponse;
791                        type Future = BoxFuture<
792                            tonic::Response<Self::Response>,
793                            tonic::Status,
794                        >;
795                        fn call(
796                            &mut self,
797                            request: tonic::Request<super::ProfilingRequest>,
798                        ) -> Self::Future {
799                            let inner = Arc::clone(&self.0);
800                            let fut = async move {
801                                <T as MonitorService>::profiling(&inner, request).await
802                            };
803                            Box::pin(fut)
804                        }
805                    }
806                    let accept_compression_encodings = self.accept_compression_encodings;
807                    let send_compression_encodings = self.send_compression_encodings;
808                    let max_decoding_message_size = self.max_decoding_message_size;
809                    let max_encoding_message_size = self.max_encoding_message_size;
810                    let inner = self.inner.clone();
811                    let fut = async move {
812                        let method = ProfilingSvc(inner);
813                        let codec = tonic::codec::ProstCodec::default();
814                        let mut grpc = tonic::server::Grpc::new(codec)
815                            .apply_compression_config(
816                                accept_compression_encodings,
817                                send_compression_encodings,
818                            )
819                            .apply_max_message_size_config(
820                                max_decoding_message_size,
821                                max_encoding_message_size,
822                            );
823                        let res = grpc.unary(method, req).await;
824                        Ok(res)
825                    };
826                    Box::pin(fut)
827                }
828                "/monitor_service.MonitorService/HeapProfiling" => {
829                    #[allow(non_camel_case_types)]
830                    struct HeapProfilingSvc<T: MonitorService>(pub Arc<T>);
831                    impl<
832                        T: MonitorService,
833                    > tonic::server::UnaryService<super::HeapProfilingRequest>
834                    for HeapProfilingSvc<T> {
835                        type Response = super::HeapProfilingResponse;
836                        type Future = BoxFuture<
837                            tonic::Response<Self::Response>,
838                            tonic::Status,
839                        >;
840                        fn call(
841                            &mut self,
842                            request: tonic::Request<super::HeapProfilingRequest>,
843                        ) -> Self::Future {
844                            let inner = Arc::clone(&self.0);
845                            let fut = async move {
846                                <T as MonitorService>::heap_profiling(&inner, request).await
847                            };
848                            Box::pin(fut)
849                        }
850                    }
851                    let accept_compression_encodings = self.accept_compression_encodings;
852                    let send_compression_encodings = self.send_compression_encodings;
853                    let max_decoding_message_size = self.max_decoding_message_size;
854                    let max_encoding_message_size = self.max_encoding_message_size;
855                    let inner = self.inner.clone();
856                    let fut = async move {
857                        let method = HeapProfilingSvc(inner);
858                        let codec = tonic::codec::ProstCodec::default();
859                        let mut grpc = tonic::server::Grpc::new(codec)
860                            .apply_compression_config(
861                                accept_compression_encodings,
862                                send_compression_encodings,
863                            )
864                            .apply_max_message_size_config(
865                                max_decoding_message_size,
866                                max_encoding_message_size,
867                            );
868                        let res = grpc.unary(method, req).await;
869                        Ok(res)
870                    };
871                    Box::pin(fut)
872                }
873                "/monitor_service.MonitorService/ListHeapProfiling" => {
874                    #[allow(non_camel_case_types)]
875                    struct ListHeapProfilingSvc<T: MonitorService>(pub Arc<T>);
876                    impl<
877                        T: MonitorService,
878                    > tonic::server::UnaryService<super::ListHeapProfilingRequest>
879                    for ListHeapProfilingSvc<T> {
880                        type Response = super::ListHeapProfilingResponse;
881                        type Future = BoxFuture<
882                            tonic::Response<Self::Response>,
883                            tonic::Status,
884                        >;
885                        fn call(
886                            &mut self,
887                            request: tonic::Request<super::ListHeapProfilingRequest>,
888                        ) -> Self::Future {
889                            let inner = Arc::clone(&self.0);
890                            let fut = async move {
891                                <T as MonitorService>::list_heap_profiling(&inner, request)
892                                    .await
893                            };
894                            Box::pin(fut)
895                        }
896                    }
897                    let accept_compression_encodings = self.accept_compression_encodings;
898                    let send_compression_encodings = self.send_compression_encodings;
899                    let max_decoding_message_size = self.max_decoding_message_size;
900                    let max_encoding_message_size = self.max_encoding_message_size;
901                    let inner = self.inner.clone();
902                    let fut = async move {
903                        let method = ListHeapProfilingSvc(inner);
904                        let codec = tonic::codec::ProstCodec::default();
905                        let mut grpc = tonic::server::Grpc::new(codec)
906                            .apply_compression_config(
907                                accept_compression_encodings,
908                                send_compression_encodings,
909                            )
910                            .apply_max_message_size_config(
911                                max_decoding_message_size,
912                                max_encoding_message_size,
913                            );
914                        let res = grpc.unary(method, req).await;
915                        Ok(res)
916                    };
917                    Box::pin(fut)
918                }
919                "/monitor_service.MonitorService/AnalyzeHeap" => {
920                    #[allow(non_camel_case_types)]
921                    struct AnalyzeHeapSvc<T: MonitorService>(pub Arc<T>);
922                    impl<
923                        T: MonitorService,
924                    > tonic::server::UnaryService<super::AnalyzeHeapRequest>
925                    for AnalyzeHeapSvc<T> {
926                        type Response = super::AnalyzeHeapResponse;
927                        type Future = BoxFuture<
928                            tonic::Response<Self::Response>,
929                            tonic::Status,
930                        >;
931                        fn call(
932                            &mut self,
933                            request: tonic::Request<super::AnalyzeHeapRequest>,
934                        ) -> Self::Future {
935                            let inner = Arc::clone(&self.0);
936                            let fut = async move {
937                                <T as MonitorService>::analyze_heap(&inner, request).await
938                            };
939                            Box::pin(fut)
940                        }
941                    }
942                    let accept_compression_encodings = self.accept_compression_encodings;
943                    let send_compression_encodings = self.send_compression_encodings;
944                    let max_decoding_message_size = self.max_decoding_message_size;
945                    let max_encoding_message_size = self.max_encoding_message_size;
946                    let inner = self.inner.clone();
947                    let fut = async move {
948                        let method = AnalyzeHeapSvc(inner);
949                        let codec = tonic::codec::ProstCodec::default();
950                        let mut grpc = tonic::server::Grpc::new(codec)
951                            .apply_compression_config(
952                                accept_compression_encodings,
953                                send_compression_encodings,
954                            )
955                            .apply_max_message_size_config(
956                                max_decoding_message_size,
957                                max_encoding_message_size,
958                            );
959                        let res = grpc.unary(method, req).await;
960                        Ok(res)
961                    };
962                    Box::pin(fut)
963                }
964                "/monitor_service.MonitorService/GetStreamingStats" => {
965                    #[allow(non_camel_case_types)]
966                    struct GetStreamingStatsSvc<T: MonitorService>(pub Arc<T>);
967                    impl<
968                        T: MonitorService,
969                    > tonic::server::UnaryService<super::GetStreamingStatsRequest>
970                    for GetStreamingStatsSvc<T> {
971                        type Response = super::GetStreamingStatsResponse;
972                        type Future = BoxFuture<
973                            tonic::Response<Self::Response>,
974                            tonic::Status,
975                        >;
976                        fn call(
977                            &mut self,
978                            request: tonic::Request<super::GetStreamingStatsRequest>,
979                        ) -> Self::Future {
980                            let inner = Arc::clone(&self.0);
981                            let fut = async move {
982                                <T as MonitorService>::get_streaming_stats(&inner, request)
983                                    .await
984                            };
985                            Box::pin(fut)
986                        }
987                    }
988                    let accept_compression_encodings = self.accept_compression_encodings;
989                    let send_compression_encodings = self.send_compression_encodings;
990                    let max_decoding_message_size = self.max_decoding_message_size;
991                    let max_encoding_message_size = self.max_encoding_message_size;
992                    let inner = self.inner.clone();
993                    let fut = async move {
994                        let method = GetStreamingStatsSvc(inner);
995                        let codec = tonic::codec::ProstCodec::default();
996                        let mut grpc = tonic::server::Grpc::new(codec)
997                            .apply_compression_config(
998                                accept_compression_encodings,
999                                send_compression_encodings,
1000                            )
1001                            .apply_max_message_size_config(
1002                                max_decoding_message_size,
1003                                max_encoding_message_size,
1004                            );
1005                        let res = grpc.unary(method, req).await;
1006                        Ok(res)
1007                    };
1008                    Box::pin(fut)
1009                }
1010                "/monitor_service.MonitorService/TieredCacheTracing" => {
1011                    #[allow(non_camel_case_types)]
1012                    struct TieredCacheTracingSvc<T: MonitorService>(pub Arc<T>);
1013                    impl<
1014                        T: MonitorService,
1015                    > tonic::server::UnaryService<super::TieredCacheTracingRequest>
1016                    for TieredCacheTracingSvc<T> {
1017                        type Response = super::TieredCacheTracingResponse;
1018                        type Future = BoxFuture<
1019                            tonic::Response<Self::Response>,
1020                            tonic::Status,
1021                        >;
1022                        fn call(
1023                            &mut self,
1024                            request: tonic::Request<super::TieredCacheTracingRequest>,
1025                        ) -> Self::Future {
1026                            let inner = Arc::clone(&self.0);
1027                            let fut = async move {
1028                                <T as MonitorService>::tiered_cache_tracing(&inner, request)
1029                                    .await
1030                            };
1031                            Box::pin(fut)
1032                        }
1033                    }
1034                    let accept_compression_encodings = self.accept_compression_encodings;
1035                    let send_compression_encodings = self.send_compression_encodings;
1036                    let max_decoding_message_size = self.max_decoding_message_size;
1037                    let max_encoding_message_size = self.max_encoding_message_size;
1038                    let inner = self.inner.clone();
1039                    let fut = async move {
1040                        let method = TieredCacheTracingSvc(inner);
1041                        let codec = tonic::codec::ProstCodec::default();
1042                        let mut grpc = tonic::server::Grpc::new(codec)
1043                            .apply_compression_config(
1044                                accept_compression_encodings,
1045                                send_compression_encodings,
1046                            )
1047                            .apply_max_message_size_config(
1048                                max_decoding_message_size,
1049                                max_encoding_message_size,
1050                            );
1051                        let res = grpc.unary(method, req).await;
1052                        Ok(res)
1053                    };
1054                    Box::pin(fut)
1055                }
1056                "/monitor_service.MonitorService/GetProfileStats" => {
1057                    #[allow(non_camel_case_types)]
1058                    struct GetProfileStatsSvc<T: MonitorService>(pub Arc<T>);
1059                    impl<
1060                        T: MonitorService,
1061                    > tonic::server::UnaryService<super::GetProfileStatsRequest>
1062                    for GetProfileStatsSvc<T> {
1063                        type Response = super::GetProfileStatsResponse;
1064                        type Future = BoxFuture<
1065                            tonic::Response<Self::Response>,
1066                            tonic::Status,
1067                        >;
1068                        fn call(
1069                            &mut self,
1070                            request: tonic::Request<super::GetProfileStatsRequest>,
1071                        ) -> Self::Future {
1072                            let inner = Arc::clone(&self.0);
1073                            let fut = async move {
1074                                <T as MonitorService>::get_profile_stats(&inner, request)
1075                                    .await
1076                            };
1077                            Box::pin(fut)
1078                        }
1079                    }
1080                    let accept_compression_encodings = self.accept_compression_encodings;
1081                    let send_compression_encodings = self.send_compression_encodings;
1082                    let max_decoding_message_size = self.max_decoding_message_size;
1083                    let max_encoding_message_size = self.max_encoding_message_size;
1084                    let inner = self.inner.clone();
1085                    let fut = async move {
1086                        let method = GetProfileStatsSvc(inner);
1087                        let codec = tonic::codec::ProstCodec::default();
1088                        let mut grpc = tonic::server::Grpc::new(codec)
1089                            .apply_compression_config(
1090                                accept_compression_encodings,
1091                                send_compression_encodings,
1092                            )
1093                            .apply_max_message_size_config(
1094                                max_decoding_message_size,
1095                                max_encoding_message_size,
1096                            );
1097                        let res = grpc.unary(method, req).await;
1098                        Ok(res)
1099                    };
1100                    Box::pin(fut)
1101                }
1102                _ => {
1103                    Box::pin(async move {
1104                        let mut response = http::Response::new(empty_body());
1105                        let headers = response.headers_mut();
1106                        headers
1107                            .insert(
1108                                tonic::Status::GRPC_STATUS,
1109                                (tonic::Code::Unimplemented as i32).into(),
1110                            );
1111                        headers
1112                            .insert(
1113                                http::header::CONTENT_TYPE,
1114                                tonic::metadata::GRPC_CONTENT_TYPE,
1115                            );
1116                        Ok(response)
1117                    })
1118                }
1119            }
1120        }
1121    }
1122    impl<T> Clone for MonitorServiceServer<T> {
1123        fn clone(&self) -> Self {
1124            let inner = self.inner.clone();
1125            Self {
1126                inner,
1127                accept_compression_encodings: self.accept_compression_encodings,
1128                send_compression_encodings: self.send_compression_encodings,
1129                max_decoding_message_size: self.max_decoding_message_size,
1130                max_encoding_message_size: self.max_encoding_message_size,
1131            }
1132        }
1133    }
1134    /// Generated gRPC service name
1135    pub const SERVICE_NAME: &str = "monitor_service.MonitorService";
1136    impl<T> tonic::server::NamedService for MonitorServiceServer<T> {
1137        const NAME: &'static str = SERVICE_NAME;
1138    }
1139}