risingwave_pb/
monitor_service.rs

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