Skip to content
Permalink
Browse files

glow: rename some counters (#4171)

Summary:
Pull Request resolved: #4171

Renamed some host manager counters so they are more descriptive.

Reviewed By: yinghai

Differential Revision: D19899412

fbshipit-source-id: 80a2cd816bfef5d810972b513d214d7c357c0c8a
  • Loading branch information
tracelogfb authored and facebook-github-bot committed Feb 14, 2020
1 parent 085341b commit a1f405788684035fe869c9b729c1ec0faf577c21
Showing with 15 additions and 9 deletions.
  1. +2 −1 include/glow/Runtime/HostManager/HostManager.h
  2. +13 −8 lib/Runtime/HostManager/HostManager.cpp
@@ -152,7 +152,8 @@ class HostManager final {

/// Execution stats update.
void updateExecutionStats(uint64_t startTime,
std::unique_ptr<ExecutionContext> &context);
std::unique_ptr<ExecutionContext> &context,
llvm::StringRef name, const Error &error);

/// Keeps the stats exporter registry object alive till destructor.
std::shared_ptr<StatsExporterRegistry> statsExporterRegistry_;
@@ -409,7 +409,7 @@ void HostManager::dispatchNextRun() {
TRACE_EVENT_LOG_ID(context->getTraceContext(), TraceLevel::REQUEST,
"network_execution_e2e", TraceEvent::AsyncEndType,
TraceEvent::now(), requestId);
updateExecutionStats(startTime, context);
updateExecutionStats(startTime, context, name, err);
callback(runID, std::move(err), std::move(context));
dispatchNextRun();
});
@@ -485,14 +485,19 @@ HostManager::runNetwork(llvm::StringRef networkName,

/// Helper to update execution stats
void HostManager::updateExecutionStats(
uint64_t startTime, std::unique_ptr<ExecutionContext> &context) {
uint64_t startTime, std::unique_ptr<ExecutionContext> &context,
llvm::StringRef networkName, const Error &error) {
auto duration = TraceEvent::now() - startTime;
statsExporterRegistry_->addTimeSeriesValue("network_execution_e2e", duration);
statsExporterRegistry_->incrementCounter("network_execution");
if (context && context->getPlaceholderBindings() && duration > 0) {
statsExporterRegistry_->addTimeSeriesValue(
"network_execution_throughput",
context->getPlaceholderBindings()->getDataSize() * 1000000 / duration);
statsExporterRegistry_->addTimeSeriesValue(
("glow.execution_duration_e2e." + networkName).str(), duration);
statsExporterRegistry_->incrementCounter(
("glow.requests_processed." + networkName).str());
if (error.peekErrorValue()) {
statsExporterRegistry_->incrementCounter(
("glow.requests_failed." + networkName).str());
} else {
statsExporterRegistry_->incrementCounter(
("glow.requests_succeeded." + networkName).str());
}
}

0 comments on commit a1f4057

Please sign in to comment.
You can’t perform that action at this time.