Skip to content

Commit d88f561

Browse files
committed
Introduce NL_STORE_METRICS variable.
1 parent 158e097 commit d88f561

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

nativelink-store/src/default_store_factory.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// limitations under the License.
1414

1515
use core::pin::Pin;
16+
use std::env;
1617
use std::sync::Arc;
1718
use std::time::SystemTime;
1819

@@ -126,7 +127,7 @@ pub fn store_factory<'a>(
126127

127128
let store = Store::new(store);
128129

129-
return if should_wrap_metrics_store(backend) {
130+
return if should_wrap_in_metrics_store(backend) {
130131
Ok(Store::new(MetricsStore::new(
131132
Arc::new(store),
132133
name,
@@ -138,7 +139,11 @@ pub fn store_factory<'a>(
138139
})
139140
}
140141

141-
fn should_wrap_metrics_store(spec: &StoreSpec) -> bool {
142+
fn should_wrap_in_metrics_store(spec: &StoreSpec) -> bool {
143+
if env::var("NL_STORE_METRICS").is_err() {
144+
return false
145+
}
146+
142147
matches!(
143148
spec,
144149
StoreSpec::Memory(_)

0 commit comments

Comments
 (0)