Chromium Code Reviews| Index: extensions/renderer/script_injection.cc |
| diff --git a/extensions/renderer/script_injection.cc b/extensions/renderer/script_injection.cc |
| index 519dce0ba520efa0ae83a0ab0ad8b745364942e7..b372a04edd9aab744470a4f2c9378ab9c7a7a3ec 100644 |
| --- a/extensions/renderer/script_injection.cc |
| +++ b/extensions/renderer/script_injection.cc |
| @@ -323,8 +323,22 @@ void ScriptInjection::OnJsInjectionCompleted( |
| base::TimeDelta elapsed) { |
| DCHECK(!did_inject_js_); |
| - if (injection_host_->id().type() == HostID::EXTENSIONS) |
| + if (injection_host_->id().type() == HostID::EXTENSIONS) { |
| UMA_HISTOGRAM_TIMES("Extensions.InjectedScriptExecutionTime", elapsed); |
| + switch (run_location_) { |
| + case UserScript::DOCUMENT_START: |
| + UMA_HISTOGRAM_TIMES("Extensions.InjectStart_ExecutionTime", elapsed); |
|
Devlin
2017/03/21 20:40:47
I'd recommend using a histogram suffix here, and m
Kunihiko Sakamoto
2017/03/22 07:46:34
Ah I've forgotten about histogram_suffixes.
Done,
|
| + break; |
| + case UserScript::DOCUMENT_END: |
| + UMA_HISTOGRAM_TIMES("Extensions.InjectEnd_ExecutionTime", elapsed); |
| + break; |
| + case UserScript::DOCUMENT_IDLE: |
| + UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_ExecutionTime", elapsed); |
| + break; |
| + default: |
| + break; |
| + } |
| + } |
| bool expects_results = injector_->ExpectsResults(); |
| if (expects_results) { |