Project import generated by Copybara.

PiperOrigin-RevId: 256060078
This commit is contained in:
MediaPipe Team
2019-07-01 17:05:57 -07:00
committed by jqtang
parent 37c93d54a5
commit dc40414468
8 changed files with 144 additions and 4 deletions
+10
View File
@@ -73,6 +73,16 @@ Counter* CounterSet::Get(const std::string& name) LOCKS_EXCLUDED(mu_) {
return counters_[name].get();
}
std::map<std::string, int64> CounterSet::GetCountersValues()
LOCKS_EXCLUDED(mu_) {
absl::ReaderMutexLock lock(&mu_);
std::map<std::string, int64> result;
for (const auto& it : counters_) {
result[it.first] = it.second->Get();
}
return result;
}
Counter* BasicCounterFactory::GetCounter(const std::string& name) {
return counter_set_.Emplace<BasicCounter>(name, name);
}