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

Unified Diff: chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h

Issue 2642553002: Adding UMA for data reduction proxy page load size/savings (Closed)
Patch Set: asvitkine comments Created 3 years, 11 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 | chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h
diff --git a/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h b/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h
index 7a13346dcb575a381aa68a7aefde8b4a26c6f0b8..5dca62a4ffc1018e35b30893c9c4f502a3d45b31 100644
--- a/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h
+++ b/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h
@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRICS_OBSERVER_H_
#define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DATA_REDUCTION_PROXY_METRICS_OBSERVER_H_
+#include <stdint.h>
+
#include <memory>
#include "base/macros.h"
@@ -41,6 +43,21 @@ extern const char kHistogramParseStartSuffix[];
extern const char kHistogramParseBlockedOnScriptLoadSuffix[];
extern const char kHistogramParseDurationSuffix[];
+// Byte and request specific histogram suffixes.
+extern const char kRequestsPercentProxied[];
+extern const char kBytesPercentProxied[];
+extern const char kBytesCompressionRatio[];
+extern const char kBytesInflationPercent[];
+extern const char kNetworkRequests[];
+extern const char kRequestsProxied[];
+extern const char kRequestsNotProxied[];
+extern const char kNetworkBytes[];
+extern const char kBytesProxied[];
+extern const char kBytesNotProxied[];
+extern const char kBytesOriginal[];
+extern const char kBytesSavings[];
+extern const char kBytesInflation[];
+
} // namespace internal
// Observer responsible for recording core page load metrics releveant to
@@ -90,12 +107,17 @@ class DataReductionProxyMetricsObserver
const page_load_metrics::PageLoadExtraInfo& info) override;
void OnParseStop(const page_load_metrics::PageLoadTiming& timing,
const page_load_metrics::PageLoadExtraInfo& info) override;
+ void OnLoadedResource(
+ const page_load_metrics::ExtraRequestInfo& extra_request_info) override;
private:
// Sends the page load information to the pingback client.
void SendPingback(const page_load_metrics::PageLoadTiming& timing,
const page_load_metrics::PageLoadExtraInfo& info);
+ // Records UMA of page size when the observer is about to be deleted.
+ void RecordPageSizeUMA() const;
+
// Gets the default DataReductionProxyPingbackClient. Overridden in testing.
virtual DataReductionProxyPingbackClient* GetPingbackClient() const;
@@ -105,6 +127,22 @@ class DataReductionProxyMetricsObserver
// The browser context this navigation is operating in.
content::BrowserContext* browser_context_;
+ // The number of requests that used data reduction proxy.
+ int num_data_reduction_proxy_requests_;
+
+ // The number of request that did not come from cache.
+ int num_network_requests_;
+
+ // The total content network bytes that the user would have downloaded if they
+ // were not using data reduction proxy.
+ int64_t original_network_bytes_;
+
+ // The total network bytes loaded through data reduction proxy.
+ int64_t network_bytes_proxied_;
+
+ // The total network bytes used.
+ int64_t network_bytes_;
+
DISALLOW_COPY_AND_ASSIGN(DataReductionProxyMetricsObserver);
};
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698