1// Copyright 2025 RisingWave Labs
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
1415mod hummock_state_store_metrics;
16use futures::Future;
17pub use hummock_state_store_metrics::*;
18mod monitored_store;
19pub use monitored_store::*;
20mod hummock_metrics;
21pub use hummock_metrics::*;
2223mod monitored_storage_metrics;
24pub use monitored_storage_metrics::*;
2526mod compactor_metrics;
27pub use compactor_metrics::*;
2829mod local_metrics;
30pub use local_metrics::*;
3132mod hitmap;
33pub use hitmap::*;
34pub use risingwave_object_store::object::object_metrics::{
35 GLOBAL_OBJECT_STORE_METRICS, ObjectStoreMetrics,
36};
3738// include only when hummock trace enabled
39#[cfg(all(not(madsim), feature = "hm-trace"))]
40pub(crate) mod traced_store;
4142pub trait HummockTraceFutureExt: Sized + Future {
43type TraceOutput;
44fn may_trace_hummock(self) -> Self::TraceOutput;
45}
4647impl<F: Future> HummockTraceFutureExt for F {
48type TraceOutput = impl Future<Output = F::Output>;
4950// simply return a future that does nothing if trace is not enabled
51fn may_trace_hummock(self) -> Self::TraceOutput {
52#[cfg(not(all(not(madsim), feature = "hm-trace")))]
53{
54self
55}
56#[cfg(all(not(madsim), feature = "hm-trace"))]
57{
58use risingwave_hummock_trace::hummock_trace_scope;
59 hummock_trace_scope(self)
60 }
61 }
62}