Commit c3861022 authored by Rayan Kanso's avatar Rayan Kanso Committed by Commit Bot

[WebAPK] Collect RequestTokenDurationV2 for new webapks.

WebAPKs using the new minting mechanism, identified by their package
name, should have a separate latency histogram to track if overall
latency will be affected.

Bug: 1134173
Change-Id: Ib75ec57828c1df1f038c2a1bf383a52cc602647f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2443011Reviewed-by: default avatarGlenn Hartmann <hartmanng@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarPeter Kotwicz <pkotwicz@chromium.org>
Commit-Queue: Rayan Kanso <rayankans@chromium.org>
Auto-Submit: Rayan Kanso <rayankans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812842}
parent 2e8ed515
......@@ -478,7 +478,8 @@ void WebApkInstaller::InstallOrUpdateWebApk(const std::string& package_name,
base::android::ConvertUTF8ToJavaString(env, token);
if (task_type_ == WebApkInstaller::INSTALL) {
webapk::TrackRequestTokenDuration(install_duration_timer_->Elapsed());
webapk::TrackRequestTokenDuration(install_duration_timer_->Elapsed(),
package_name);
base::android::ScopedJavaLocalRef<jobject> java_primary_icon =
gfx::ConvertToJavaBitmap(&install_primary_icon_);
Java_WebApkInstaller_installWebApkAsync(
......
......@@ -5,15 +5,19 @@
#include "chrome/browser/android/webapk/webapk_metrics.h"
#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
#include "base/strings/string_util.h"
namespace webapk {
const char kInstallDurationHistogram[] = "WebApk.Install.InstallDuration";
const char kInstallEventHistogram[] = "WebApk.Install.InstallEvent";
void TrackRequestTokenDuration(base::TimeDelta delta) {
UMA_HISTOGRAM_TIMES("WebApk.Install.RequestTokenDuration", delta);
void TrackRequestTokenDuration(base::TimeDelta delta,
const std::string& webapk_package) {
if (base::EndsWith(webapk_package, "_v2"))
UMA_HISTOGRAM_MEDIUM_TIMES("WebApk.Install.RequestTokenDurationV2", delta);
else
UMA_HISTOGRAM_TIMES("WebApk.Install.RequestTokenDuration", delta);
}
void TrackInstallDuration(base::TimeDelta delta) {
......
......@@ -5,9 +5,9 @@
#ifndef CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_METRICS_H_
#define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_METRICS_H_
namespace base {
class TimeDelta;
}
#include <string>
#include "base/time/time.h"
namespace webapk {
......@@ -25,7 +25,8 @@ enum InstallEvent {
INSTALL_EVENT_MAX = 5,
};
void TrackRequestTokenDuration(base::TimeDelta delta);
void TrackRequestTokenDuration(base::TimeDelta delta,
const std::string& webapk_package);
void TrackInstallDuration(base::TimeDelta delta);
void TrackInstallEvent(InstallEvent event);
......
......@@ -104,6 +104,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="WebApk.Install.RequestTokenDuration" units="ms"
expires_after="2021-03-15">
<owner>hartmanng@chromium.org</owner>
<owner>rayankans@chromium.org</owner>
<owner>
src/chrome/android/java/src/org/chromium/chrome/browser/webapps/OWNERS
</owner>
......@@ -116,6 +117,19 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</histogram>
<histogram name="WebApk.Install.RequestTokenDurationV2" units="ms"
expires_after="2021-03-15">
<owner>hartmanng@chromium.org</owner>
<owner>rayankans@chromium.org</owner>
<owner>
src/chrome/android/java/src/org/chromium/chrome/browser/webapps/OWNERS
</owner>
<summary>
Same as WebApk.Install.RequestTokenDuration, but for WebAPKs minted using
the new architecture (v2).
</summary>
</histogram>
<histogram name="WebApk.Launch.NetworkError" enum="NetErrorCodes"
expires_after="2021-02-01">
<owner>hartmanng@chromium.org</owner>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment