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

Unified Diff: components/subresource_filter/content/common/document_load_statistics.h

Issue 2600253002: Aggregate DocumentSubresourceFilter counters on page level. (Closed)
Patch Set: rebase 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
Index: components/subresource_filter/content/common/document_load_statistics.h
diff --git a/components/subresource_filter/content/common/document_load_statistics.h b/components/subresource_filter/content/common/document_load_statistics.h
new file mode 100644
index 0000000000000000000000000000000000000000..e05f31666f7aab6540376cc919adc8610bbbc410
--- /dev/null
+++ b/components/subresource_filter/content/common/document_load_statistics.h
@@ -0,0 +1,35 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_SUBRESOURCE_FILTER_CONTENT_COMMON_DOCUMENT_LOAD_STATISTICS_H_
+#define COMPONENTS_SUBRESOURCE_FILTER_CONTENT_COMMON_DOCUMENT_LOAD_STATISTICS_H_
+
+#include <stdint.h>
+
+#include "base/time/time.h"
+
+namespace subresource_filter {
+
+// Contains statistics and performance metrics collected by the
+// DocumentSubresourceFilter.
+struct DocumentLoadStatistics {
+ // The number of subresource loads that went through the
+ // DocumentSubresouceFilter::allowLoad method.
+ int32_t num_loads_total = 0;
+
+ // Statistics on the number of subresource loads that were evaluated, were
+ // matched by filtering rules, and were disallowed, respectively, during the
+ // lifetime of a DocumentSubresourceFilter.
+ int32_t num_loads_evaluated = 0;
+ int32_t num_loads_matching_rules = 0;
+ int32_t num_loads_disallowed = 0;
+
+ // Total time spent in allowLoad() calls while evaluating subresource loads.
+ base::TimeDelta evaluation_total_wall_duration;
+ base::TimeDelta evaluation_total_cpu_duration;
+};
+
+} // namespace subresource_filter
+
+#endif // COMPONENTS_SUBRESOURCE_FILTER_CONTENT_COMMON_DOCUMENT_LOAD_STATISTICS_H_

Powered by Google App Engine
This is Rietveld 408576698