Commit 8604e081 authored by mvanouwerkerk's avatar mvanouwerkerk Committed by Commit bot

Add histograms in Blink for Geolocation request timeouts.

BUG=581816

Review URL: https://codereview.chromium.org/1705073003

Cr-Commit-Position: refs/heads/master@{#376145}
parent 9ae0388c
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "modules/geolocation/Geolocation.h" #include "modules/geolocation/Geolocation.h"
#include "modules/geolocation/PositionError.h" #include "modules/geolocation/PositionError.h"
#include "modules/geolocation/PositionOptions.h" #include "modules/geolocation/PositionOptions.h"
#include "platform/Histogram.h"
namespace blink { namespace blink {
...@@ -20,6 +21,9 @@ GeoNotifier::GeoNotifier(Geolocation* geolocation, PositionCallback* successCall ...@@ -20,6 +21,9 @@ GeoNotifier::GeoNotifier(Geolocation* geolocation, PositionCallback* successCall
{ {
ASSERT(m_geolocation); ASSERT(m_geolocation);
ASSERT(m_successCallback); ASSERT(m_successCallback);
DEFINE_STATIC_LOCAL(CustomCountHistogram, timeoutHistogram, ("Geolocation.Timeout", 0, 1000 * 60 * 10 /* 10 minute max */, 20 /* buckets */));
timeoutHistogram.count(m_options.timeout());
} }
DEFINE_TRACE(GeoNotifier) DEFINE_TRACE(GeoNotifier)
...@@ -94,6 +98,10 @@ void GeoNotifier::timerFired(Timer<GeoNotifier>*) ...@@ -94,6 +98,10 @@ void GeoNotifier::timerFired(Timer<GeoNotifier>*)
if (m_errorCallback) if (m_errorCallback)
m_errorCallback->handleEvent(PositionError::create(PositionError::TIMEOUT, "Timeout expired")); m_errorCallback->handleEvent(PositionError::create(PositionError::TIMEOUT, "Timeout expired"));
DEFINE_STATIC_LOCAL(CustomCountHistogram, timeoutExpiredHistogram, ("Geolocation.TimeoutExpired", 0, 1000 * 60 * 10 /* 10 minute max */, 20 /* buckets */));
timeoutExpiredHistogram.count(m_options.timeout());
m_geolocation->requestTimedOut(this); m_geolocation->requestTimedOut(this);
} }
......
...@@ -15244,6 +15244,25 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. ...@@ -15244,6 +15244,25 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
<summary>Http response codes in NetworkLocationRequest.</summary> <summary>Http response codes in NetworkLocationRequest.</summary>
</histogram> </histogram>
<histogram name="Geolocation.Timeout">
<owner>mvanouwerkerk@chromium.org</owner>
<summary>
Counts Geolocation request timeout values, bucketing by timeout duration.
This is recorded for all requests upon creation, see
Geolocation.TimeoutExpired for timeouts that actually expired.
</summary>
</histogram>
<histogram name="Geolocation.TimeoutExpired">
<owner>mvanouwerkerk@chromium.org</owner>
<summary>
Counts Geolocation request timeout expirations, bucketing by timeout
duration. This means no position was received within the allowed time from
the browser process due to e.g. a slow network or an unresponsive system
location provider.
</summary>
</histogram>
<histogram name="GoogleNow.Card.Button.Clicked0" enum="GoogleNowCardTypeId"> <histogram name="GoogleNow.Card.Button.Clicked0" enum="GoogleNowCardTypeId">
<owner>robliao@chromium.org</owner> <owner>robliao@chromium.org</owner>
<owner>skare@chromium.org</owner> <owner>skare@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