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

Unified Diff: content/browser/loader/async_resource_handler.cc

Issue 1025813002: Remove the majority of the high-traffic Net.Async* histograms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/async_resource_handler.cc
diff --git a/content/browser/loader/async_resource_handler.cc b/content/browser/loader/async_resource_handler.cc
index 7c1ad3386958c28c75d3a5e05375b2b79d4e4e22..c2b5fe71d9fffe84d8b507b224e7fb41c80ed0b6 100644
--- a/content/browser/loader/async_resource_handler.cc
+++ b/content/browser/loader/async_resource_handler.cc
@@ -12,7 +12,7 @@
#include "base/debug/alias.h"
#include "base/logging.h"
#include "base/memory/shared_memory.h"
-#include "base/metrics/histogram.h"
+#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "content/browser/devtools/devtools_netlog_observer.h"
@@ -59,11 +59,6 @@ void InitializeResourceBufferConstants() {
GetNumericArg("resource-buffer-max-allocation-size", &kMaxAllocationSize);
}
-int CalcUsedPercentage(int bytes_read, int buffer_size) {
- double ratio = static_cast<double>(bytes_read) / buffer_size;
- return static_cast<int>(ratio * 100.0 + 0.5); // Round to nearest integer.
-}
-
} // namespace
class DependentIOBuffer : public net::WrappedIOBuffer {
@@ -256,9 +251,6 @@ bool AsyncResourceHandler::OnWillRead(scoped_refptr<net::IOBuffer>* buf,
*buf = new DependentIOBuffer(buffer_.get(), memory);
*buf_size = allocation_size_;
- UMA_HISTOGRAM_CUSTOM_COUNTS(
- "Net.AsyncResourceHandler_SharedIOBuffer_Alloc",
- *buf_size, 0, kMaxAllocationSize, 100);
return true;
}
@@ -274,13 +266,6 @@ bool AsyncResourceHandler::OnReadCompleted(int bytes_read, bool* defer) {
buffer_->ShrinkLastAllocation(bytes_read);
- UMA_HISTOGRAM_CUSTOM_COUNTS(
- "Net.AsyncResourceHandler_SharedIOBuffer_Used",
- bytes_read, 0, kMaxAllocationSize, 100);
- UMA_HISTOGRAM_PERCENTAGE(
- "Net.AsyncResourceHandler_SharedIOBuffer_UsedPercentage",
- CalcUsedPercentage(bytes_read, allocation_size_));
-
if (!sent_first_data_msg_) {
base::SharedMemoryHandle handle;
int size;
@@ -300,14 +285,8 @@ bool AsyncResourceHandler::OnReadCompleted(int bytes_read, bool* defer) {
filter->Send(new ResourceMsg_DataReceived(
GetRequestID(), data_offset, bytes_read, encoded_data_length));
++pending_data_count_;
- UMA_HISTOGRAM_CUSTOM_COUNTS(
- "Net.AsyncResourceHandler_PendingDataCount",
- pending_data_count_, 0, 100, 100);
if (!buffer_->CanAllocate()) {
- UMA_HISTOGRAM_CUSTOM_COUNTS(
- "Net.AsyncResourceHandler_PendingDataCount_WhenFull",
- pending_data_count_, 0, 100, 100);
*defer = did_defer_ = true;
OnDefer();
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698