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

Side by Side Diff: net/http/bidirectional_stream.cc

Issue 2311433002: Fix UMA logging for net::BidirectionalStream (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/bidirectional_stream.h" 5 #include "net/http/bidirectional_stream.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 384
385 void BidirectionalStream::UpdateHistograms() { 385 void BidirectionalStream::UpdateHistograms() {
386 // If the request failed before response is started, treat the metrics as 386 // If the request failed before response is started, treat the metrics as
387 // bogus and skip logging. 387 // bogus and skip logging.
388 if (start_time_.is_null() || read_start_time_.is_null() || 388 if (start_time_.is_null() || read_start_time_.is_null() ||
389 read_end_time_.is_null() || send_start_time_.is_null() || 389 read_end_time_.is_null() || send_start_time_.is_null() ||
390 send_end_time_.is_null()) { 390 send_end_time_.is_null()) {
391 return; 391 return;
392 } 392 }
393 if (GetProtocol() == kProtoHTTP2) { 393 if (GetProtocol() == kProtoHTTP2) {
394 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.HTTP2.TimeToReadStart", 394 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.TimeToReadStart.HTTP2",
395 read_start_time_ - start_time_); 395 read_start_time_ - start_time_);
396 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.HTTP2.TimeToReadEnd", 396 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.TimeToReadEnd.HTTP2",
397 read_end_time_ - start_time_); 397 read_end_time_ - start_time_);
398 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.HTTP2.TimeToSendStart", 398 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.TimeToSendStart.HTTP2",
399 send_start_time_ - start_time_); 399 send_start_time_ - start_time_);
400 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.HTTP2.TimeToSendEnd", 400 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.TimeToSendEnd.HTTP2",
401 send_end_time_ - start_time_); 401 send_end_time_ - start_time_);
402 UMA_HISTOGRAM_COUNTS("Net.BidirectionalStream.HTTP2.ReceivedBytes", 402 UMA_HISTOGRAM_COUNTS("Net.BidirectionalStream.ReceivedBytes.HTTP2",
403 stream_impl_->GetTotalReceivedBytes()); 403 stream_impl_->GetTotalReceivedBytes());
404 UMA_HISTOGRAM_COUNTS("Net.BidirectionalStream.HTTP2.SentBytes", 404 UMA_HISTOGRAM_COUNTS("Net.BidirectionalStream.SentBytes.HTTP2",
405 stream_impl_->GetTotalSentBytes()); 405 stream_impl_->GetTotalSentBytes());
406 } else if (GetProtocol() == kProtoQUIC1SPDY3) { 406 } else if (GetProtocol() == kProtoQUIC1SPDY3) {
407 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.QUIC.TimeToReadStart", 407 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.TimeToReadStart.QUIC",
408 read_start_time_ - start_time_); 408 read_start_time_ - start_time_);
409 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.QUIC.TimeToReadEnd", 409 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.TimeToReadEnd.QUIC",
410 read_end_time_ - start_time_); 410 read_end_time_ - start_time_);
411 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.QUIC.TimeToSendStart", 411 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.TimeToSendStart.QUIC",
412 send_start_time_ - start_time_); 412 send_start_time_ - start_time_);
413 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.QUIC.TimeToSendEnd", 413 UMA_HISTOGRAM_TIMES("Net.BidirectionalStream.TimeToSendEnd.QUIC",
414 send_end_time_ - start_time_); 414 send_end_time_ - start_time_);
415 UMA_HISTOGRAM_COUNTS("Net.BidirectionalStream.QUIC.ReceivedBytes", 415 UMA_HISTOGRAM_COUNTS("Net.BidirectionalStream.ReceivedBytes.QUIC",
416 stream_impl_->GetTotalReceivedBytes()); 416 stream_impl_->GetTotalReceivedBytes());
417 UMA_HISTOGRAM_COUNTS("Net.BidirectionalStream.QUIC.SentBytes", 417 UMA_HISTOGRAM_COUNTS("Net.BidirectionalStream.SentBytes.QUIC",
418 stream_impl_->GetTotalSentBytes()); 418 stream_impl_->GetTotalSentBytes());
419 } 419 }
420 } 420 }
421 421
422 } // namespace net 422 } // namespace net
OLDNEW
« 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