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