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

Unified Diff: net/udp/udp_socket_win.cc

Issue 11833039: [net/udp] Measure the time spent in closesocket on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing header Created 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/udp/udp_socket_win.cc
diff --git a/net/udp/udp_socket_win.cc b/net/udp/udp_socket_win.cc
index 662ca4cd4ee98d738b6aa724fba9a48c7fd55300..71caf174f888e4fda6a4a9bd116b532a4487391f 100644
--- a/net/udp/udp_socket_win.cc
+++ b/net/udp/udp_socket_win.cc
@@ -9,6 +9,7 @@
#include "base/callback.h"
#include "base/logging.h"
#include "base/message_loop.h"
+#include "base/metrics/histogram.h"
#include "base/metrics/stats_counters.h"
#include "base/posix/eintr_wrapper.h"
#include "base/rand_util.h"
@@ -190,7 +191,10 @@ void UDPSocketWin::Close() {
recv_from_address_ = NULL;
write_callback_.Reset();
+ base::TimeTicks start_time = base::TimeTicks::Now();
closesocket(socket_);
+ UMA_HISTOGRAM_TIMES("Net.UDPSocketWinClose",
+ base::TimeTicks::Now() - start_time);
socket_ = INVALID_SOCKET;
core_->Detach();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698