File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ class MetricsConfig {
74
74
75
75
class PrometheusInstance {
76
76
public:
77
- using Labels = std::map<std::string, std::string> ;
77
+ using Labels = prometheus::Labels ;
78
78
79
79
static std::shared_ptr<PrometheusInstance> instance ();
80
80
@@ -182,11 +182,9 @@ class PrometheusInstance {
182
182
183
183
struct MetricKeyHash {
184
184
std::size_t operator ()(const MetricKey& key) const noexcept {
185
- auto hash = std::hash<std::string>()(key.name );
186
- for (const auto & [name, value] : key.labels ) {
187
- hash = folly::hash::commutative_hash_combine (hash, name, value);
188
- }
189
- return hash;
185
+ auto labels_hash = folly::hash::commutative_hash_combine_range (
186
+ key.labels .begin (), key.labels .end ());
187
+ return folly::hash::commutative_hash_combine (labels_hash, key.name );
190
188
}
191
189
};
192
190
You can’t perform that action at this time.
0 commit comments