Skip to content

Commit

Permalink
Merge pull request #76 from kujeger/limit_feature_metrics
Browse files Browse the repository at this point in the history
Limit feature metrics
  • Loading branch information
sjaanus authored Jan 11, 2024
2 parents 020cd74 + 39d88e1 commit 8a63028
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,15 @@ where
feature.into(),
);
}
for (name, feature) in &old.str_features {
bucket.toggles.insert(name.clone(), feature.into());
// Only create metrics for used str_features.
if self.enable_str_features {
for (name, feature) in &old.str_features {
if feature.enabled.load(Ordering::Relaxed) != 0
|| feature.disabled.load(Ordering::Relaxed) != 0
{
bucket.toggles.insert(name.clone(), feature.into());
}
}
}
let metrics = Metrics {
app_name: self.app_name.clone(),
Expand Down

0 comments on commit 8a63028

Please sign in to comment.