pull/35871/head
yijiem 11 months ago
parent 37d087a030
commit 86ebe484ae
  1. 12
      src/core/lib/channel/metrics.cc

@ -42,8 +42,7 @@ GlobalInstrumentsRegistry::RegisterUInt64Counter(
bool enable_by_default) {
auto& instruments = GetInstrumentList();
if (instruments.find(name) != instruments.end()) {
grpc_core::Crash(
absl::StrFormat("Metric name %s has already been registered.", name));
Crash(absl::StrFormat("Metric name %s has already been registered.", name));
}
uint32_t index = instruments.size();
GPR_ASSERT(index < std::numeric_limits<uint32_t>::max());
@ -72,8 +71,7 @@ GlobalInstrumentsRegistry::RegisterDoubleCounter(
bool enable_by_default) {
auto& instruments = GetInstrumentList();
if (instruments.find(name) != instruments.end()) {
grpc_core::Crash(
absl::StrFormat("Metric name %s has already been registered.", name));
Crash(absl::StrFormat("Metric name %s has already been registered.", name));
}
uint32_t index = instruments.size();
GPR_ASSERT(index < std::numeric_limits<uint32_t>::max());
@ -102,8 +100,7 @@ GlobalInstrumentsRegistry::RegisterUInt64Histogram(
bool enable_by_default) {
auto& instruments = GetInstrumentList();
if (instruments.find(name) != instruments.end()) {
grpc_core::Crash(
absl::StrFormat("Metric name %s has already been registered.", name));
Crash(absl::StrFormat("Metric name %s has already been registered.", name));
}
uint32_t index = instruments.size();
GPR_ASSERT(index < std::numeric_limits<uint32_t>::max());
@ -132,8 +129,7 @@ GlobalInstrumentsRegistry::RegisterDoubleHistogram(
bool enable_by_default) {
auto& instruments = GetInstrumentList();
if (instruments.find(name) != instruments.end()) {
grpc_core::Crash(
absl::StrFormat("Metric name %s has already been registered.", name));
Crash(absl::StrFormat("Metric name %s has already been registered.", name));
}
uint32_t index = instruments.size();
GPR_ASSERT(index < std::numeric_limits<uint32_t>::max());

Loading…
Cancel
Save