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

Unified Diff: tools/android/loading/metrics.py

Issue 2021093002: clovis: Report the number and cost of DNS requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/android/loading/metrics_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/metrics.py
diff --git a/tools/android/loading/metrics.py b/tools/android/loading/metrics.py
index deb4619f70c3a5515aa50aa819d28b7b83d32395..59a307754595db74e741b0b1dc221f68d149029c 100644
--- a/tools/android/loading/metrics.py
+++ b/tools/android/loading/metrics.py
@@ -106,6 +106,16 @@ def AdsAndTrackingTransferSize(trace, ad_rules_filename,
return TransferSize(requests)
+def DnsRequestsAndCost(trace):
+ """Returns the number and cost of DNS requests for a trace."""
+ requests = trace.request_track.GetEvents()
+ requests_with_dns = [r for r in requests if r.timing.dns_start != -1]
+ dns_requests_count = len(requests_with_dns)
+ dns_cost = sum(r.timing.dns_end - r.timing.dns_start
+ for r in requests_with_dns)
+ return (dns_requests_count, dns_cost)
+
+
def PlotTransferSizeVsTimeBetweenVisits(trace):
times = [10, 60, 300, 600, 3600, 4 * 3600, 12 * 3600, 24 * 3600]
labels = ['10s', '1m', '10m', '1h', '4h', '12h', '1d']
« no previous file with comments | « no previous file | tools/android/loading/metrics_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698