Details
-
New Feature
-
Resolution: Fixed
-
Major - P3
-
None
-
Fully Compatible
-
Sharding 2022-02-21
-
2
Description
Simple example of what the class could look like
class CumulativeMetrics { |
|
|
std::atomic<counter> _cumulativeAggregatedValue;
|
std::mutex _lock;
|
std::list<SharedMetricsPtr> _instanceMetrics;
|
|
SharedMetricsPtr createRegisteredSharedMetrics() {
|
auto result = std::make_shared<SharedMetrics>();
|
std::unique_lock guard(_lock);
|
_instanceMetrics.push_back(result);
|
return result; |
}
|
|
void deregisterSharedMetrics(SharedMetricsPtr metrics) { |
std::unique_lock guard(_lock);
|
_instanceMetrics.remove(metrics); |
}
|
}
|
This class will utilized the SharedMetrics class to manage the cross-instance metrics. It will be utilized by the external-facing CollectionDataCopyTransformedMetrics metrics class.