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

Unified Diff: net/base/file_stream_metrics.h

Issue 7583049: Record UMA statistics for file_stream operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed extra logging. Created 9 years, 3 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 | « net/base/file_stream.h ('k') | net/base/file_stream_metrics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/file_stream_metrics.h
diff --git a/net/base/file_stream_metrics.h b/net/base/file_stream_metrics.h
new file mode 100644
index 0000000000000000000000000000000000000000..cdf16e5b01a6d8af980057dac975a2fb92478567
--- /dev/null
+++ b/net/base/file_stream_metrics.h
@@ -0,0 +1,41 @@
+// Copyright (c) 2011 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.
+
+// File error statistics gathering.
+
+#ifndef NET_BASE_FILE_STREAM_METRICS_H_
+#define NET_BASE_FILE_STREAM_METRICS_H_
+#pragma once
+
+namespace net {
+
+enum FileErrorSource {
+ FILE_ERROR_SOURCE_OPEN = 0,
+ FILE_ERROR_SOURCE_WRITE,
+ FILE_ERROR_SOURCE_READ,
+ FILE_ERROR_SOURCE_SEEK,
+ FILE_ERROR_SOURCE_FLUSH,
+ FILE_ERROR_SOURCE_SET_EOF,
+ FILE_ERROR_SOURCE_GET_SIZE,
+ FILE_ERROR_SOURCE_COUNT,
+};
+
+// UMA error statistics gathering.
+// Put the error value into a bucket.
+int GetFileErrorUmaBucket(int error);
+
+// The largest bucket number, plus 1.
+int MaxFileErrorUmaBucket();
+
+// The highest error value we want to individually report.
+int MaxFileErrorUmaValue();
+
+// |error| is a platform-specific error (Windows or Posix).
+// |source| indicates the operation that resulted in the error.
+// |record| is a flag indicating that we are interested in this error.
+void RecordFileError(int error, FileErrorSource source, bool record);
+
+} // namespace net
+
+#endif // NET_BASE_FILE_STREAM_METRICS_H_
« no previous file with comments | « net/base/file_stream.h ('k') | net/base/file_stream_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698