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