Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3178)

Unified Diff: extensions/renderer/module_system.cc

Issue 2102383002: [Extensions] Add metrics for API binding generation time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mark's Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/module_system.cc
diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc
index dd13786f198f9267b084caa0b810259205ef1e0e..6bf090f9cf165b2ddb76076e6e85a12d0e480d2f 100644
--- a/extensions/renderer/module_system.cc
+++ b/extensions/renderer/module_system.cc
@@ -8,8 +8,10 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/metrics/histogram_macros.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "base/timer/elapsed_timer.h"
#include "base/trace_event/trace_event.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_view.h"
@@ -379,6 +381,7 @@ void ModuleSystem::LazyFieldGetterInner(
v8::Local<v8::String> property,
const v8::PropertyCallbackInfo<v8::Value>& info,
RequireFunction require_function) {
+ base::ElapsedTimer timer;
CHECK(!info.Data().IsEmpty());
CHECK(info.Data()->IsObject());
v8::Isolate* isolate = info.GetIsolate();
@@ -460,6 +463,8 @@ void ModuleSystem::LazyFieldGetterInner(
NOTREACHED();
}
info.GetReturnValue().Set(new_field);
+
+ UMA_HISTOGRAM_TIMES("Extensions.ApiBindingGenerationTime", timer.Elapsed());
}
void ModuleSystem::SetLazyField(v8::Local<v8::Object> object,
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698