OLD | NEW |
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 Loading... |
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 |
OLD | NEW |