1#[derive(prost_helpers::AnyPB)]
3#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct StackTraceRequest {
5 #[prost(enumeration = "stack_trace_request::ActorTracesFormat", tag = "1")]
6 pub actor_traces_format: i32,
7}
8pub 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 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 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 #[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 #[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 #[prost(btree_map = "uint32, string", tag = "8", wrapper = "crate::id::WorkerId")]
94 pub node_errors: ::prost::alloc::collections::BTreeMap<
95 crate::id::WorkerId,
96 ::prost::alloc::string::String,
97 >,
98 #[prost(btree_map = "string, string", tag = "9")]
100 pub batch_traces: ::prost::alloc::collections::BTreeMap<
101 ::prost::alloc::string::String,
102 ::prost::alloc::string::String,
103 >,
104}
105#[derive(prost_helpers::AnyPB)]
107#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
108pub struct ProfilingRequest {
109 #[prost(uint64, tag = "1")]
111 pub sleep_s: u64,
112}
113#[derive(prost_helpers::AnyPB)]
114#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
115pub struct ProfilingResponse {
116 #[prost(bytes = "vec", tag = "1")]
117 pub result: ::prost::alloc::vec::Vec<u8>,
118}
119#[derive(prost_helpers::AnyPB)]
121#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
122pub struct HeapProfilingRequest {
123 #[prost(string, tag = "1")]
125 pub dir: ::prost::alloc::string::String,
126}
127#[derive(prost_helpers::AnyPB)]
128#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
129pub struct HeapProfilingResponse {}
130#[derive(prost_helpers::AnyPB)]
131#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
132pub struct ListHeapProfilingRequest {}
133#[derive(prost_helpers::AnyPB)]
134#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
135pub struct ListHeapProfilingResponse {
136 #[prost(string, tag = "1")]
137 pub dir: ::prost::alloc::string::String,
138 #[prost(string, repeated, tag = "2")]
139 pub name_manually: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
140 #[prost(string, repeated, tag = "3")]
141 pub name_auto: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
142}
143#[derive(prost_helpers::AnyPB)]
145#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
146pub struct AnalyzeHeapRequest {
147 #[prost(string, tag = "1")]
149 pub path: ::prost::alloc::string::String,
150}
151#[derive(prost_helpers::AnyPB)]
152#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
153pub struct AnalyzeHeapResponse {
154 #[prost(bytes = "vec", tag = "1")]
155 pub result: ::prost::alloc::vec::Vec<u8>,
156}
157#[derive(prost_helpers::AnyPB)]
159#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
160pub struct GetStreamingStatsRequest {}
161#[derive(prost_helpers::AnyPB)]
162#[derive(Clone, Copy, PartialEq, ::prost::Message)]
163pub struct ChannelStats {
164 #[prost(uint32, tag = "1")]
168 pub actor_count: u32,
169 #[prost(double, tag = "2")]
171 pub output_blocking_duration: f64,
172 #[prost(uint64, tag = "3")]
174 pub recv_row_count: u64,
175 #[prost(uint64, tag = "4")]
177 pub send_row_count: u64,
178}
179#[derive(prost_helpers::AnyPB)]
180#[derive(Clone, Copy, PartialEq, ::prost::Message)]
181pub struct ChannelDeltaStats {
182 #[prost(uint32, tag = "1")]
183 pub actor_count: u32,
184 #[prost(double, tag = "2")]
186 pub backpressure_rate: f64,
187 #[prost(double, tag = "3")]
189 pub recv_throughput: f64,
190 #[prost(double, tag = "4")]
192 pub send_throughput: f64,
193}
194#[derive(prost_helpers::AnyPB)]
195#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
196pub struct FragmentStats {
197 #[prost(uint32, tag = "2")]
198 pub actor_count: u32,
199 #[prost(uint64, tag = "3")]
200 pub current_epoch: u64,
201}
202#[derive(prost_helpers::AnyPB)]
203#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
204pub struct RelationStats {
205 #[prost(uint32, tag = "2")]
206 pub actor_count: u32,
207 #[prost(uint64, tag = "3")]
208 pub current_epoch: u64,
209}
210#[derive(prost_helpers::AnyPB)]
211#[derive(Clone, PartialEq, ::prost::Message)]
212pub struct GetStreamingStatsResponse {
213 #[prost(map = "string, message", tag = "1")]
215 pub channel_stats: ::std::collections::HashMap<
216 ::prost::alloc::string::String,
217 ChannelStats,
218 >,
219 #[prost(map = "uint32, message", tag = "2")]
220 pub fragment_stats: ::std::collections::HashMap<u32, FragmentStats>,
221 #[prost(map = "uint32, message", tag = "3")]
222 pub relation_stats: ::std::collections::HashMap<u32, RelationStats>,
223}
224#[derive(prost_helpers::AnyPB)]
225#[derive(Clone, PartialEq, ::prost::Message)]
226pub struct GetStreamingPrometheusStatsResponse {
227 #[prost(map = "string, message", tag = "1")]
229 pub channel_stats: ::std::collections::HashMap<
230 ::prost::alloc::string::String,
231 ChannelDeltaStats,
232 >,
233 #[prost(map = "uint32, message", tag = "2")]
234 pub fragment_stats: ::std::collections::HashMap<u32, FragmentStats>,
235 #[prost(map = "uint32, message", tag = "3")]
236 pub relation_stats: ::std::collections::HashMap<u32, RelationStats>,
237}
238#[derive(prost_helpers::AnyPB)]
239#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
240pub struct TieredCacheTracingRequest {
241 #[prost(bool, tag = "1")]
242 pub enable: bool,
243 #[prost(uint32, optional, tag = "2")]
244 pub record_hybrid_insert_threshold_ms: ::core::option::Option<u32>,
245 #[prost(uint32, optional, tag = "3")]
246 pub record_hybrid_get_threshold_ms: ::core::option::Option<u32>,
247 #[prost(uint32, optional, tag = "4")]
248 pub record_hybrid_obtain_threshold_ms: ::core::option::Option<u32>,
249 #[prost(uint32, optional, tag = "5")]
250 pub record_hybrid_remove_threshold_ms: ::core::option::Option<u32>,
251 #[prost(uint32, optional, tag = "6")]
252 pub record_hybrid_fetch_threshold_ms: ::core::option::Option<u32>,
253}
254#[derive(prost_helpers::AnyPB)]
255#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
256pub struct TieredCacheTracingResponse {}
257#[derive(prost_helpers::AnyPB)]
258#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
259pub struct GetProfileStatsRequest {
260 #[prost(uint64, repeated, tag = "1", wrapper = "crate::id::ExecutorId")]
262 pub executor_ids: ::prost::alloc::vec::Vec<crate::id::ExecutorId>,
263 #[prost(uint32, repeated, tag = "2", wrapper = "crate::id::FragmentId")]
266 pub dispatcher_fragment_ids: ::prost::alloc::vec::Vec<crate::id::FragmentId>,
267}
268#[derive(prost_helpers::AnyPB)]
269#[derive(Clone, PartialEq, ::prost::Message)]
270pub struct GetProfileStatsResponse {
271 #[prost(map = "uint64, uint64", tag = "1", wrapper = "crate::id::ExecutorId")]
272 pub stream_node_output_row_count: ::std::collections::HashMap<
273 crate::id::ExecutorId,
274 u64,
275 >,
276 #[prost(map = "uint64, uint64", tag = "2", wrapper = "crate::id::ExecutorId")]
277 pub stream_node_output_blocking_duration_ns: ::std::collections::HashMap<
278 crate::id::ExecutorId,
279 u64,
280 >,
281 #[prost(map = "uint32, uint64", tag = "3", wrapper = "crate::id::FragmentId")]
282 pub dispatch_fragment_output_row_count: ::std::collections::HashMap<
283 crate::id::FragmentId,
284 u64,
285 >,
286 #[prost(map = "uint32, uint64", tag = "4", wrapper = "crate::id::FragmentId")]
287 pub dispatch_fragment_output_blocking_duration_ns: ::std::collections::HashMap<
288 crate::id::FragmentId,
289 u64,
290 >,
291}
292#[derive(prost_helpers::AnyPB)]
293#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
294pub struct GetTableCacheRefillStatsRequest {}
295#[derive(prost_helpers::AnyPB)]
296#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
297pub struct GetTableCacheRefillStatsResponse {
298 #[prost(string, tag = "1")]
300 pub stats: ::prost::alloc::string::String,
301}
302pub mod monitor_service_client {
304 #![allow(
305 unused_variables,
306 dead_code,
307 missing_docs,
308 clippy::wildcard_imports,
309 clippy::let_unit_value,
310 )]
311 use tonic::codegen::*;
312 use tonic::codegen::http::Uri;
313 #[derive(Debug, Clone)]
314 pub struct MonitorServiceClient<T> {
315 inner: tonic::client::Grpc<T>,
316 }
317 impl MonitorServiceClient<tonic::transport::Channel> {
318 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
320 where
321 D: TryInto<tonic::transport::Endpoint>,
322 D::Error: Into<StdError>,
323 {
324 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
325 Ok(Self::new(conn))
326 }
327 }
328 impl<T> MonitorServiceClient<T>
329 where
330 T: tonic::client::GrpcService<tonic::body::Body>,
331 T::Error: Into<StdError>,
332 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
333 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
334 {
335 pub fn new(inner: T) -> Self {
336 let inner = tonic::client::Grpc::new(inner);
337 Self { inner }
338 }
339 pub fn with_origin(inner: T, origin: Uri) -> Self {
340 let inner = tonic::client::Grpc::with_origin(inner, origin);
341 Self { inner }
342 }
343 pub fn with_interceptor<F>(
344 inner: T,
345 interceptor: F,
346 ) -> MonitorServiceClient<InterceptedService<T, F>>
347 where
348 F: tonic::service::Interceptor,
349 T::ResponseBody: Default,
350 T: tonic::codegen::Service<
351 http::Request<tonic::body::Body>,
352 Response = http::Response<
353 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
354 >,
355 >,
356 <T as tonic::codegen::Service<
357 http::Request<tonic::body::Body>,
358 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
359 {
360 MonitorServiceClient::new(InterceptedService::new(inner, interceptor))
361 }
362 #[must_use]
367 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
368 self.inner = self.inner.send_compressed(encoding);
369 self
370 }
371 #[must_use]
373 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
374 self.inner = self.inner.accept_compressed(encoding);
375 self
376 }
377 #[must_use]
381 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
382 self.inner = self.inner.max_decoding_message_size(limit);
383 self
384 }
385 #[must_use]
389 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
390 self.inner = self.inner.max_encoding_message_size(limit);
391 self
392 }
393 pub async fn stack_trace(
394 &mut self,
395 request: impl tonic::IntoRequest<super::StackTraceRequest>,
396 ) -> std::result::Result<
397 tonic::Response<super::StackTraceResponse>,
398 tonic::Status,
399 > {
400 self.inner
401 .ready()
402 .await
403 .map_err(|e| {
404 tonic::Status::unknown(
405 format!("Service was not ready: {}", e.into()),
406 )
407 })?;
408 let codec = tonic_prost::ProstCodec::default();
409 let path = http::uri::PathAndQuery::from_static(
410 "/monitor_service.MonitorService/StackTrace",
411 );
412 let mut req = request.into_request();
413 req.extensions_mut()
414 .insert(GrpcMethod::new("monitor_service.MonitorService", "StackTrace"));
415 self.inner.unary(req, path, codec).await
416 }
417 pub async fn profiling(
418 &mut self,
419 request: impl tonic::IntoRequest<super::ProfilingRequest>,
420 ) -> std::result::Result<
421 tonic::Response<super::ProfilingResponse>,
422 tonic::Status,
423 > {
424 self.inner
425 .ready()
426 .await
427 .map_err(|e| {
428 tonic::Status::unknown(
429 format!("Service was not ready: {}", e.into()),
430 )
431 })?;
432 let codec = tonic_prost::ProstCodec::default();
433 let path = http::uri::PathAndQuery::from_static(
434 "/monitor_service.MonitorService/Profiling",
435 );
436 let mut req = request.into_request();
437 req.extensions_mut()
438 .insert(GrpcMethod::new("monitor_service.MonitorService", "Profiling"));
439 self.inner.unary(req, path, codec).await
440 }
441 pub async fn heap_profiling(
442 &mut self,
443 request: impl tonic::IntoRequest<super::HeapProfilingRequest>,
444 ) -> std::result::Result<
445 tonic::Response<super::HeapProfilingResponse>,
446 tonic::Status,
447 > {
448 self.inner
449 .ready()
450 .await
451 .map_err(|e| {
452 tonic::Status::unknown(
453 format!("Service was not ready: {}", e.into()),
454 )
455 })?;
456 let codec = tonic_prost::ProstCodec::default();
457 let path = http::uri::PathAndQuery::from_static(
458 "/monitor_service.MonitorService/HeapProfiling",
459 );
460 let mut req = request.into_request();
461 req.extensions_mut()
462 .insert(
463 GrpcMethod::new("monitor_service.MonitorService", "HeapProfiling"),
464 );
465 self.inner.unary(req, path, codec).await
466 }
467 pub async fn list_heap_profiling(
468 &mut self,
469 request: impl tonic::IntoRequest<super::ListHeapProfilingRequest>,
470 ) -> std::result::Result<
471 tonic::Response<super::ListHeapProfilingResponse>,
472 tonic::Status,
473 > {
474 self.inner
475 .ready()
476 .await
477 .map_err(|e| {
478 tonic::Status::unknown(
479 format!("Service was not ready: {}", e.into()),
480 )
481 })?;
482 let codec = tonic_prost::ProstCodec::default();
483 let path = http::uri::PathAndQuery::from_static(
484 "/monitor_service.MonitorService/ListHeapProfiling",
485 );
486 let mut req = request.into_request();
487 req.extensions_mut()
488 .insert(
489 GrpcMethod::new(
490 "monitor_service.MonitorService",
491 "ListHeapProfiling",
492 ),
493 );
494 self.inner.unary(req, path, codec).await
495 }
496 pub async fn analyze_heap(
497 &mut self,
498 request: impl tonic::IntoRequest<super::AnalyzeHeapRequest>,
499 ) -> std::result::Result<
500 tonic::Response<super::AnalyzeHeapResponse>,
501 tonic::Status,
502 > {
503 self.inner
504 .ready()
505 .await
506 .map_err(|e| {
507 tonic::Status::unknown(
508 format!("Service was not ready: {}", e.into()),
509 )
510 })?;
511 let codec = tonic_prost::ProstCodec::default();
512 let path = http::uri::PathAndQuery::from_static(
513 "/monitor_service.MonitorService/AnalyzeHeap",
514 );
515 let mut req = request.into_request();
516 req.extensions_mut()
517 .insert(
518 GrpcMethod::new("monitor_service.MonitorService", "AnalyzeHeap"),
519 );
520 self.inner.unary(req, path, codec).await
521 }
522 pub async fn get_streaming_stats(
523 &mut self,
524 request: impl tonic::IntoRequest<super::GetStreamingStatsRequest>,
525 ) -> std::result::Result<
526 tonic::Response<super::GetStreamingStatsResponse>,
527 tonic::Status,
528 > {
529 self.inner
530 .ready()
531 .await
532 .map_err(|e| {
533 tonic::Status::unknown(
534 format!("Service was not ready: {}", e.into()),
535 )
536 })?;
537 let codec = tonic_prost::ProstCodec::default();
538 let path = http::uri::PathAndQuery::from_static(
539 "/monitor_service.MonitorService/GetStreamingStats",
540 );
541 let mut req = request.into_request();
542 req.extensions_mut()
543 .insert(
544 GrpcMethod::new(
545 "monitor_service.MonitorService",
546 "GetStreamingStats",
547 ),
548 );
549 self.inner.unary(req, path, codec).await
550 }
551 pub async fn tiered_cache_tracing(
552 &mut self,
553 request: impl tonic::IntoRequest<super::TieredCacheTracingRequest>,
554 ) -> std::result::Result<
555 tonic::Response<super::TieredCacheTracingResponse>,
556 tonic::Status,
557 > {
558 self.inner
559 .ready()
560 .await
561 .map_err(|e| {
562 tonic::Status::unknown(
563 format!("Service was not ready: {}", e.into()),
564 )
565 })?;
566 let codec = tonic_prost::ProstCodec::default();
567 let path = http::uri::PathAndQuery::from_static(
568 "/monitor_service.MonitorService/TieredCacheTracing",
569 );
570 let mut req = request.into_request();
571 req.extensions_mut()
572 .insert(
573 GrpcMethod::new(
574 "monitor_service.MonitorService",
575 "TieredCacheTracing",
576 ),
577 );
578 self.inner.unary(req, path, codec).await
579 }
580 pub async fn get_profile_stats(
581 &mut self,
582 request: impl tonic::IntoRequest<super::GetProfileStatsRequest>,
583 ) -> std::result::Result<
584 tonic::Response<super::GetProfileStatsResponse>,
585 tonic::Status,
586 > {
587 self.inner
588 .ready()
589 .await
590 .map_err(|e| {
591 tonic::Status::unknown(
592 format!("Service was not ready: {}", e.into()),
593 )
594 })?;
595 let codec = tonic_prost::ProstCodec::default();
596 let path = http::uri::PathAndQuery::from_static(
597 "/monitor_service.MonitorService/GetProfileStats",
598 );
599 let mut req = request.into_request();
600 req.extensions_mut()
601 .insert(
602 GrpcMethod::new("monitor_service.MonitorService", "GetProfileStats"),
603 );
604 self.inner.unary(req, path, codec).await
605 }
606 pub async fn get_table_cache_refill_stats(
607 &mut self,
608 request: impl tonic::IntoRequest<super::GetTableCacheRefillStatsRequest>,
609 ) -> std::result::Result<
610 tonic::Response<super::GetTableCacheRefillStatsResponse>,
611 tonic::Status,
612 > {
613 self.inner
614 .ready()
615 .await
616 .map_err(|e| {
617 tonic::Status::unknown(
618 format!("Service was not ready: {}", e.into()),
619 )
620 })?;
621 let codec = tonic_prost::ProstCodec::default();
622 let path = http::uri::PathAndQuery::from_static(
623 "/monitor_service.MonitorService/GetTableCacheRefillStats",
624 );
625 let mut req = request.into_request();
626 req.extensions_mut()
627 .insert(
628 GrpcMethod::new(
629 "monitor_service.MonitorService",
630 "GetTableCacheRefillStats",
631 ),
632 );
633 self.inner.unary(req, path, codec).await
634 }
635 }
636}
637pub mod monitor_service_server {
639 #![allow(
640 unused_variables,
641 dead_code,
642 missing_docs,
643 clippy::wildcard_imports,
644 clippy::let_unit_value,
645 )]
646 use tonic::codegen::*;
647 #[async_trait]
649 pub trait MonitorService: std::marker::Send + std::marker::Sync + 'static {
650 async fn stack_trace(
651 &self,
652 request: tonic::Request<super::StackTraceRequest>,
653 ) -> std::result::Result<
654 tonic::Response<super::StackTraceResponse>,
655 tonic::Status,
656 >;
657 async fn profiling(
658 &self,
659 request: tonic::Request<super::ProfilingRequest>,
660 ) -> std::result::Result<
661 tonic::Response<super::ProfilingResponse>,
662 tonic::Status,
663 >;
664 async fn heap_profiling(
665 &self,
666 request: tonic::Request<super::HeapProfilingRequest>,
667 ) -> std::result::Result<
668 tonic::Response<super::HeapProfilingResponse>,
669 tonic::Status,
670 >;
671 async fn list_heap_profiling(
672 &self,
673 request: tonic::Request<super::ListHeapProfilingRequest>,
674 ) -> std::result::Result<
675 tonic::Response<super::ListHeapProfilingResponse>,
676 tonic::Status,
677 >;
678 async fn analyze_heap(
679 &self,
680 request: tonic::Request<super::AnalyzeHeapRequest>,
681 ) -> std::result::Result<
682 tonic::Response<super::AnalyzeHeapResponse>,
683 tonic::Status,
684 >;
685 async fn get_streaming_stats(
686 &self,
687 request: tonic::Request<super::GetStreamingStatsRequest>,
688 ) -> std::result::Result<
689 tonic::Response<super::GetStreamingStatsResponse>,
690 tonic::Status,
691 >;
692 async fn tiered_cache_tracing(
693 &self,
694 request: tonic::Request<super::TieredCacheTracingRequest>,
695 ) -> std::result::Result<
696 tonic::Response<super::TieredCacheTracingResponse>,
697 tonic::Status,
698 >;
699 async fn get_profile_stats(
700 &self,
701 request: tonic::Request<super::GetProfileStatsRequest>,
702 ) -> std::result::Result<
703 tonic::Response<super::GetProfileStatsResponse>,
704 tonic::Status,
705 >;
706 async fn get_table_cache_refill_stats(
707 &self,
708 request: tonic::Request<super::GetTableCacheRefillStatsRequest>,
709 ) -> std::result::Result<
710 tonic::Response<super::GetTableCacheRefillStatsResponse>,
711 tonic::Status,
712 >;
713 }
714 #[derive(Debug)]
715 pub struct MonitorServiceServer<T> {
716 inner: Arc<T>,
717 accept_compression_encodings: EnabledCompressionEncodings,
718 send_compression_encodings: EnabledCompressionEncodings,
719 max_decoding_message_size: Option<usize>,
720 max_encoding_message_size: Option<usize>,
721 }
722 impl<T> MonitorServiceServer<T> {
723 pub fn new(inner: T) -> Self {
724 Self::from_arc(Arc::new(inner))
725 }
726 pub fn from_arc(inner: Arc<T>) -> Self {
727 Self {
728 inner,
729 accept_compression_encodings: Default::default(),
730 send_compression_encodings: Default::default(),
731 max_decoding_message_size: None,
732 max_encoding_message_size: None,
733 }
734 }
735 pub fn with_interceptor<F>(
736 inner: T,
737 interceptor: F,
738 ) -> InterceptedService<Self, F>
739 where
740 F: tonic::service::Interceptor,
741 {
742 InterceptedService::new(Self::new(inner), interceptor)
743 }
744 #[must_use]
746 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
747 self.accept_compression_encodings.enable(encoding);
748 self
749 }
750 #[must_use]
752 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
753 self.send_compression_encodings.enable(encoding);
754 self
755 }
756 #[must_use]
760 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
761 self.max_decoding_message_size = Some(limit);
762 self
763 }
764 #[must_use]
768 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
769 self.max_encoding_message_size = Some(limit);
770 self
771 }
772 }
773 impl<T, B> tonic::codegen::Service<http::Request<B>> for MonitorServiceServer<T>
774 where
775 T: MonitorService,
776 B: Body + std::marker::Send + 'static,
777 B::Error: Into<StdError> + std::marker::Send + 'static,
778 {
779 type Response = http::Response<tonic::body::Body>;
780 type Error = std::convert::Infallible;
781 type Future = BoxFuture<Self::Response, Self::Error>;
782 fn poll_ready(
783 &mut self,
784 _cx: &mut Context<'_>,
785 ) -> Poll<std::result::Result<(), Self::Error>> {
786 Poll::Ready(Ok(()))
787 }
788 fn call(&mut self, req: http::Request<B>) -> Self::Future {
789 match req.uri().path() {
790 "/monitor_service.MonitorService/StackTrace" => {
791 #[allow(non_camel_case_types)]
792 struct StackTraceSvc<T: MonitorService>(pub Arc<T>);
793 impl<
794 T: MonitorService,
795 > tonic::server::UnaryService<super::StackTraceRequest>
796 for StackTraceSvc<T> {
797 type Response = super::StackTraceResponse;
798 type Future = BoxFuture<
799 tonic::Response<Self::Response>,
800 tonic::Status,
801 >;
802 fn call(
803 &mut self,
804 request: tonic::Request<super::StackTraceRequest>,
805 ) -> Self::Future {
806 let inner = Arc::clone(&self.0);
807 let fut = async move {
808 <T as MonitorService>::stack_trace(&inner, request).await
809 };
810 Box::pin(fut)
811 }
812 }
813 let accept_compression_encodings = self.accept_compression_encodings;
814 let send_compression_encodings = self.send_compression_encodings;
815 let max_decoding_message_size = self.max_decoding_message_size;
816 let max_encoding_message_size = self.max_encoding_message_size;
817 let inner = self.inner.clone();
818 let fut = async move {
819 let method = StackTraceSvc(inner);
820 let codec = tonic_prost::ProstCodec::default();
821 let mut grpc = tonic::server::Grpc::new(codec)
822 .apply_compression_config(
823 accept_compression_encodings,
824 send_compression_encodings,
825 )
826 .apply_max_message_size_config(
827 max_decoding_message_size,
828 max_encoding_message_size,
829 );
830 let res = grpc.unary(method, req).await;
831 Ok(res)
832 };
833 Box::pin(fut)
834 }
835 "/monitor_service.MonitorService/Profiling" => {
836 #[allow(non_camel_case_types)]
837 struct ProfilingSvc<T: MonitorService>(pub Arc<T>);
838 impl<
839 T: MonitorService,
840 > tonic::server::UnaryService<super::ProfilingRequest>
841 for ProfilingSvc<T> {
842 type Response = super::ProfilingResponse;
843 type Future = BoxFuture<
844 tonic::Response<Self::Response>,
845 tonic::Status,
846 >;
847 fn call(
848 &mut self,
849 request: tonic::Request<super::ProfilingRequest>,
850 ) -> Self::Future {
851 let inner = Arc::clone(&self.0);
852 let fut = async move {
853 <T as MonitorService>::profiling(&inner, request).await
854 };
855 Box::pin(fut)
856 }
857 }
858 let accept_compression_encodings = self.accept_compression_encodings;
859 let send_compression_encodings = self.send_compression_encodings;
860 let max_decoding_message_size = self.max_decoding_message_size;
861 let max_encoding_message_size = self.max_encoding_message_size;
862 let inner = self.inner.clone();
863 let fut = async move {
864 let method = ProfilingSvc(inner);
865 let codec = tonic_prost::ProstCodec::default();
866 let mut grpc = tonic::server::Grpc::new(codec)
867 .apply_compression_config(
868 accept_compression_encodings,
869 send_compression_encodings,
870 )
871 .apply_max_message_size_config(
872 max_decoding_message_size,
873 max_encoding_message_size,
874 );
875 let res = grpc.unary(method, req).await;
876 Ok(res)
877 };
878 Box::pin(fut)
879 }
880 "/monitor_service.MonitorService/HeapProfiling" => {
881 #[allow(non_camel_case_types)]
882 struct HeapProfilingSvc<T: MonitorService>(pub Arc<T>);
883 impl<
884 T: MonitorService,
885 > tonic::server::UnaryService<super::HeapProfilingRequest>
886 for HeapProfilingSvc<T> {
887 type Response = super::HeapProfilingResponse;
888 type Future = BoxFuture<
889 tonic::Response<Self::Response>,
890 tonic::Status,
891 >;
892 fn call(
893 &mut self,
894 request: tonic::Request<super::HeapProfilingRequest>,
895 ) -> Self::Future {
896 let inner = Arc::clone(&self.0);
897 let fut = async move {
898 <T as MonitorService>::heap_profiling(&inner, request).await
899 };
900 Box::pin(fut)
901 }
902 }
903 let accept_compression_encodings = self.accept_compression_encodings;
904 let send_compression_encodings = self.send_compression_encodings;
905 let max_decoding_message_size = self.max_decoding_message_size;
906 let max_encoding_message_size = self.max_encoding_message_size;
907 let inner = self.inner.clone();
908 let fut = async move {
909 let method = HeapProfilingSvc(inner);
910 let codec = tonic_prost::ProstCodec::default();
911 let mut grpc = tonic::server::Grpc::new(codec)
912 .apply_compression_config(
913 accept_compression_encodings,
914 send_compression_encodings,
915 )
916 .apply_max_message_size_config(
917 max_decoding_message_size,
918 max_encoding_message_size,
919 );
920 let res = grpc.unary(method, req).await;
921 Ok(res)
922 };
923 Box::pin(fut)
924 }
925 "/monitor_service.MonitorService/ListHeapProfiling" => {
926 #[allow(non_camel_case_types)]
927 struct ListHeapProfilingSvc<T: MonitorService>(pub Arc<T>);
928 impl<
929 T: MonitorService,
930 > tonic::server::UnaryService<super::ListHeapProfilingRequest>
931 for ListHeapProfilingSvc<T> {
932 type Response = super::ListHeapProfilingResponse;
933 type Future = BoxFuture<
934 tonic::Response<Self::Response>,
935 tonic::Status,
936 >;
937 fn call(
938 &mut self,
939 request: tonic::Request<super::ListHeapProfilingRequest>,
940 ) -> Self::Future {
941 let inner = Arc::clone(&self.0);
942 let fut = async move {
943 <T as MonitorService>::list_heap_profiling(&inner, request)
944 .await
945 };
946 Box::pin(fut)
947 }
948 }
949 let accept_compression_encodings = self.accept_compression_encodings;
950 let send_compression_encodings = self.send_compression_encodings;
951 let max_decoding_message_size = self.max_decoding_message_size;
952 let max_encoding_message_size = self.max_encoding_message_size;
953 let inner = self.inner.clone();
954 let fut = async move {
955 let method = ListHeapProfilingSvc(inner);
956 let codec = tonic_prost::ProstCodec::default();
957 let mut grpc = tonic::server::Grpc::new(codec)
958 .apply_compression_config(
959 accept_compression_encodings,
960 send_compression_encodings,
961 )
962 .apply_max_message_size_config(
963 max_decoding_message_size,
964 max_encoding_message_size,
965 );
966 let res = grpc.unary(method, req).await;
967 Ok(res)
968 };
969 Box::pin(fut)
970 }
971 "/monitor_service.MonitorService/AnalyzeHeap" => {
972 #[allow(non_camel_case_types)]
973 struct AnalyzeHeapSvc<T: MonitorService>(pub Arc<T>);
974 impl<
975 T: MonitorService,
976 > tonic::server::UnaryService<super::AnalyzeHeapRequest>
977 for AnalyzeHeapSvc<T> {
978 type Response = super::AnalyzeHeapResponse;
979 type Future = BoxFuture<
980 tonic::Response<Self::Response>,
981 tonic::Status,
982 >;
983 fn call(
984 &mut self,
985 request: tonic::Request<super::AnalyzeHeapRequest>,
986 ) -> Self::Future {
987 let inner = Arc::clone(&self.0);
988 let fut = async move {
989 <T as MonitorService>::analyze_heap(&inner, request).await
990 };
991 Box::pin(fut)
992 }
993 }
994 let accept_compression_encodings = self.accept_compression_encodings;
995 let send_compression_encodings = self.send_compression_encodings;
996 let max_decoding_message_size = self.max_decoding_message_size;
997 let max_encoding_message_size = self.max_encoding_message_size;
998 let inner = self.inner.clone();
999 let fut = async move {
1000 let method = AnalyzeHeapSvc(inner);
1001 let codec = tonic_prost::ProstCodec::default();
1002 let mut grpc = tonic::server::Grpc::new(codec)
1003 .apply_compression_config(
1004 accept_compression_encodings,
1005 send_compression_encodings,
1006 )
1007 .apply_max_message_size_config(
1008 max_decoding_message_size,
1009 max_encoding_message_size,
1010 );
1011 let res = grpc.unary(method, req).await;
1012 Ok(res)
1013 };
1014 Box::pin(fut)
1015 }
1016 "/monitor_service.MonitorService/GetStreamingStats" => {
1017 #[allow(non_camel_case_types)]
1018 struct GetStreamingStatsSvc<T: MonitorService>(pub Arc<T>);
1019 impl<
1020 T: MonitorService,
1021 > tonic::server::UnaryService<super::GetStreamingStatsRequest>
1022 for GetStreamingStatsSvc<T> {
1023 type Response = super::GetStreamingStatsResponse;
1024 type Future = BoxFuture<
1025 tonic::Response<Self::Response>,
1026 tonic::Status,
1027 >;
1028 fn call(
1029 &mut self,
1030 request: tonic::Request<super::GetStreamingStatsRequest>,
1031 ) -> Self::Future {
1032 let inner = Arc::clone(&self.0);
1033 let fut = async move {
1034 <T as MonitorService>::get_streaming_stats(&inner, request)
1035 .await
1036 };
1037 Box::pin(fut)
1038 }
1039 }
1040 let accept_compression_encodings = self.accept_compression_encodings;
1041 let send_compression_encodings = self.send_compression_encodings;
1042 let max_decoding_message_size = self.max_decoding_message_size;
1043 let max_encoding_message_size = self.max_encoding_message_size;
1044 let inner = self.inner.clone();
1045 let fut = async move {
1046 let method = GetStreamingStatsSvc(inner);
1047 let codec = tonic_prost::ProstCodec::default();
1048 let mut grpc = tonic::server::Grpc::new(codec)
1049 .apply_compression_config(
1050 accept_compression_encodings,
1051 send_compression_encodings,
1052 )
1053 .apply_max_message_size_config(
1054 max_decoding_message_size,
1055 max_encoding_message_size,
1056 );
1057 let res = grpc.unary(method, req).await;
1058 Ok(res)
1059 };
1060 Box::pin(fut)
1061 }
1062 "/monitor_service.MonitorService/TieredCacheTracing" => {
1063 #[allow(non_camel_case_types)]
1064 struct TieredCacheTracingSvc<T: MonitorService>(pub Arc<T>);
1065 impl<
1066 T: MonitorService,
1067 > tonic::server::UnaryService<super::TieredCacheTracingRequest>
1068 for TieredCacheTracingSvc<T> {
1069 type Response = super::TieredCacheTracingResponse;
1070 type Future = BoxFuture<
1071 tonic::Response<Self::Response>,
1072 tonic::Status,
1073 >;
1074 fn call(
1075 &mut self,
1076 request: tonic::Request<super::TieredCacheTracingRequest>,
1077 ) -> Self::Future {
1078 let inner = Arc::clone(&self.0);
1079 let fut = async move {
1080 <T as MonitorService>::tiered_cache_tracing(&inner, request)
1081 .await
1082 };
1083 Box::pin(fut)
1084 }
1085 }
1086 let accept_compression_encodings = self.accept_compression_encodings;
1087 let send_compression_encodings = self.send_compression_encodings;
1088 let max_decoding_message_size = self.max_decoding_message_size;
1089 let max_encoding_message_size = self.max_encoding_message_size;
1090 let inner = self.inner.clone();
1091 let fut = async move {
1092 let method = TieredCacheTracingSvc(inner);
1093 let codec = tonic_prost::ProstCodec::default();
1094 let mut grpc = tonic::server::Grpc::new(codec)
1095 .apply_compression_config(
1096 accept_compression_encodings,
1097 send_compression_encodings,
1098 )
1099 .apply_max_message_size_config(
1100 max_decoding_message_size,
1101 max_encoding_message_size,
1102 );
1103 let res = grpc.unary(method, req).await;
1104 Ok(res)
1105 };
1106 Box::pin(fut)
1107 }
1108 "/monitor_service.MonitorService/GetProfileStats" => {
1109 #[allow(non_camel_case_types)]
1110 struct GetProfileStatsSvc<T: MonitorService>(pub Arc<T>);
1111 impl<
1112 T: MonitorService,
1113 > tonic::server::UnaryService<super::GetProfileStatsRequest>
1114 for GetProfileStatsSvc<T> {
1115 type Response = super::GetProfileStatsResponse;
1116 type Future = BoxFuture<
1117 tonic::Response<Self::Response>,
1118 tonic::Status,
1119 >;
1120 fn call(
1121 &mut self,
1122 request: tonic::Request<super::GetProfileStatsRequest>,
1123 ) -> Self::Future {
1124 let inner = Arc::clone(&self.0);
1125 let fut = async move {
1126 <T as MonitorService>::get_profile_stats(&inner, request)
1127 .await
1128 };
1129 Box::pin(fut)
1130 }
1131 }
1132 let accept_compression_encodings = self.accept_compression_encodings;
1133 let send_compression_encodings = self.send_compression_encodings;
1134 let max_decoding_message_size = self.max_decoding_message_size;
1135 let max_encoding_message_size = self.max_encoding_message_size;
1136 let inner = self.inner.clone();
1137 let fut = async move {
1138 let method = GetProfileStatsSvc(inner);
1139 let codec = tonic_prost::ProstCodec::default();
1140 let mut grpc = tonic::server::Grpc::new(codec)
1141 .apply_compression_config(
1142 accept_compression_encodings,
1143 send_compression_encodings,
1144 )
1145 .apply_max_message_size_config(
1146 max_decoding_message_size,
1147 max_encoding_message_size,
1148 );
1149 let res = grpc.unary(method, req).await;
1150 Ok(res)
1151 };
1152 Box::pin(fut)
1153 }
1154 "/monitor_service.MonitorService/GetTableCacheRefillStats" => {
1155 #[allow(non_camel_case_types)]
1156 struct GetTableCacheRefillStatsSvc<T: MonitorService>(pub Arc<T>);
1157 impl<
1158 T: MonitorService,
1159 > tonic::server::UnaryService<super::GetTableCacheRefillStatsRequest>
1160 for GetTableCacheRefillStatsSvc<T> {
1161 type Response = super::GetTableCacheRefillStatsResponse;
1162 type Future = BoxFuture<
1163 tonic::Response<Self::Response>,
1164 tonic::Status,
1165 >;
1166 fn call(
1167 &mut self,
1168 request: tonic::Request<
1169 super::GetTableCacheRefillStatsRequest,
1170 >,
1171 ) -> Self::Future {
1172 let inner = Arc::clone(&self.0);
1173 let fut = async move {
1174 <T as MonitorService>::get_table_cache_refill_stats(
1175 &inner,
1176 request,
1177 )
1178 .await
1179 };
1180 Box::pin(fut)
1181 }
1182 }
1183 let accept_compression_encodings = self.accept_compression_encodings;
1184 let send_compression_encodings = self.send_compression_encodings;
1185 let max_decoding_message_size = self.max_decoding_message_size;
1186 let max_encoding_message_size = self.max_encoding_message_size;
1187 let inner = self.inner.clone();
1188 let fut = async move {
1189 let method = GetTableCacheRefillStatsSvc(inner);
1190 let codec = tonic_prost::ProstCodec::default();
1191 let mut grpc = tonic::server::Grpc::new(codec)
1192 .apply_compression_config(
1193 accept_compression_encodings,
1194 send_compression_encodings,
1195 )
1196 .apply_max_message_size_config(
1197 max_decoding_message_size,
1198 max_encoding_message_size,
1199 );
1200 let res = grpc.unary(method, req).await;
1201 Ok(res)
1202 };
1203 Box::pin(fut)
1204 }
1205 _ => {
1206 Box::pin(async move {
1207 let mut response = http::Response::new(
1208 tonic::body::Body::default(),
1209 );
1210 let headers = response.headers_mut();
1211 headers
1212 .insert(
1213 tonic::Status::GRPC_STATUS,
1214 (tonic::Code::Unimplemented as i32).into(),
1215 );
1216 headers
1217 .insert(
1218 http::header::CONTENT_TYPE,
1219 tonic::metadata::GRPC_CONTENT_TYPE,
1220 );
1221 Ok(response)
1222 })
1223 }
1224 }
1225 }
1226 }
1227 impl<T> Clone for MonitorServiceServer<T> {
1228 fn clone(&self) -> Self {
1229 let inner = self.inner.clone();
1230 Self {
1231 inner,
1232 accept_compression_encodings: self.accept_compression_encodings,
1233 send_compression_encodings: self.send_compression_encodings,
1234 max_decoding_message_size: self.max_decoding_message_size,
1235 max_encoding_message_size: self.max_encoding_message_size,
1236 }
1237 }
1238 }
1239 pub const SERVICE_NAME: &str = "monitor_service.MonitorService";
1241 impl<T> tonic::server::NamedService for MonitorServiceServer<T> {
1242 const NAME: &'static str = SERVICE_NAME;
1243 }
1244}