diff --git a/netwerk/metrics.yaml b/netwerk/metrics.yaml index 89327f6ca8202..fc6ae9e95ced2 100644 --- a/netwerk/metrics.yaml +++ b/netwerk/metrics.yaml @@ -1097,6 +1097,431 @@ com expires : 130 +http_content_ondatafinished_delay +: +type +: +timing_distribution +time_unit +: +millisecond +description +: +> +The +time +between +dispatching +OnDataFinished +from +the +socket +thread +and +processing +it +. +bugs +: +- +https +: +/ +/ +bugzilla +. +mozilla +. +org +/ +show_bug +. +cgi +? +id += +1857615 +data_reviews +: +- +https +: +/ +/ +bugzilla +. +mozilla +. +org +/ +show_bug +. +cgi +? +id += +1857615 +# +c +data_sensitivity +: +- +technical +notification_emails +: +- +necko +mozilla +. +com +- +rjesup +mozilla +. +com +expires +: +130 +http_content_ondatafinished_to_onstop_delay +: +type +: +timing_distribution +time_unit +: +millisecond +description +: +> +The +time +between +processing +OnDataFinished +and +processing +OnStopRequest +( +if +OnDataFinished +comes +first +) +bugs +: +- +https +: +/ +/ +bugzilla +. +mozilla +. +org +/ +show_bug +. +cgi +? +id += +1857615 +data_reviews +: +- +https +: +/ +/ +bugzilla +. +mozilla +. +org +/ +show_bug +. +cgi +? +id += +1857615 +# +c +data_sensitivity +: +- +technical +notification_emails +: +- +necko +mozilla +. +com +- +rjesup +mozilla +. +com +expires +: +130 +http_content_ondatafinished_to_onstop_delay_negative +: +type +: +timing_distribution +time_unit +: +millisecond +description +: +> +The +time +between +processing +OnStopRequest +and +processing +OnDataFinished +( +if +OnStopRequest +comes +first +) +bugs +: +- +https +: +/ +/ +bugzilla +. +mozilla +. +org +/ +show_bug +. +cgi +? +id += +1857615 +data_reviews +: +- +https +: +/ +/ +bugzilla +. +mozilla +. +org +/ +show_bug +. +cgi +? +id += +1857615 +# +c +data_sensitivity +: +- +technical +notification_emails +: +- +necko +mozilla +. +com +- +rjesup +mozilla +. +com +expires +: +130 +http_content_html5parser_ondatafinished_to_onstop_delay +: +type +: +timing_distribution +time_unit +: +millisecond +description +: +> +The +time +between +processing +OnDataFinished +and +processing +OnStopRequest +( +if +OnDataFinished +comes +first +) +bugs +: +- +https +: +/ +/ +bugzilla +. +mozilla +. +org +/ +show_bug +. +cgi +? +id += +1857926 +data_reviews +: +- +https +: +/ +/ +bugzilla +. +mozilla +. +org +/ +show_bug +. +cgi +? +id += +1857926 +data_sensitivity +: +- +technical +notification_emails +: +- +necko +mozilla +. +com +- +rjesup +mozilla +. +com +expires +: +130 +http_content_html5parser_ondatafinished_to_onstop_delay_negative +: +type +: +timing_distribution +time_unit +: +millisecond +description +: +> +The +time +between +processing +OnStopRequest +and +processing +OnDataFinished +( +if +OnStopRequest +comes +first +) +bugs +: +- +https +: +/ +/ +bugzilla +. +mozilla +. +org +/ +show_bug +. +cgi +? +id += +1857926 +data_reviews +: +- +https +: +/ +/ +bugzilla +. +mozilla +. +org +/ +show_bug +. +cgi +? +id += +1857926 +data_sensitivity +: +- +technical +notification_emails +: +- +necko +mozilla +. +com +- +rjesup +mozilla +. +com +expires +: +130 http_1_download_throughput : type diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index a61d567d9aa75..24779ab738ade 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -4154,6 +4154,88 @@ this } } } +class +RecordStopRequestDelta +final +{ +public +: +NS_INLINE_DECL_THREADSAFE_REFCOUNTING +( +RecordStopRequestDelta +) +; +TimeStamp +mOnStopRequestTime +; +TimeStamp +mOnDataFinishedTime +; +private +: +~ +RecordStopRequestDelta +( +) +{ +TimeDuration +delta += +( +mOnStopRequestTime +- +mOnDataFinishedTime +) +; +if +( +delta +. +ToMilliseconds +( +) +< +0 +) +{ +delta += +- +delta +; +glean +: +: +networking +: +: +http_content_ondatafinished_to_onstop_delay_negative +. +AccumulateRawDuration +( +delta +) +; +} +else +{ +glean +: +: +networking +: +: +http_content_ondatafinished_to_onstop_delay +. +AccumulateRawDuration +( +delta +) +; +} +} +} +; void HttpChannelChild : @@ -4246,6 +4328,16 @@ encodedBodySize ) ; } +RefPtr +< +RecordStopRequestDelta +> +timing +( +new +RecordStopRequestDelta +) +; TimeStamp start = @@ -4310,10 +4402,49 @@ this status = aChannelStatus +start +timing ] ( ) { +TimeStamp +now += +TimeStamp +: +: +Now +( +) +; +TimeDuration +delay += +now +- +start +; +glean +: +: +networking +: +: +http_content_ondatafinished_delay +. +AccumulateRawDuration +( +delay +) +; +timing +- +> +mOnDataFinishedTime += +now +; self - > @@ -4361,13 +4492,14 @@ Clone } aFromSocketProcess start +timing ] ( ) mutable { -TimeDuration -delay +TimeStamp +now = TimeStamp : @@ -4375,6 +4507,11 @@ TimeStamp Now ( ) +; +TimeDuration +delay += +now - start ; @@ -4391,6 +4528,13 @@ AccumulateRawDuration delay ) ; +timing +- +> +mOnStopRequestTime += +now +; self - > diff --git a/parser/html/nsHtml5StreamParser.cpp b/parser/html/nsHtml5StreamParser.cpp index a2e0f870a6758..1a4ba18c6a1df 100644 --- a/parser/html/nsHtml5StreamParser.cpp +++ b/parser/html/nsHtml5StreamParser.cpp @@ -7133,10 +7133,36 @@ if mOnStopCalled ) { -return -NS_OK +if +( +mOnDataFinishedTime +) +{ +mOnStopRequestTime += +TimeStamp +: +: +Now +( +) ; } +else +{ +mOnDataFinishedTime += +TimeStamp +: +: +Now +( +) +; +} +} +else +{ mOnStopCalled = true @@ -7151,6 +7177,15 @@ NS_IsMainThread ) ) { +mOnStopRequestTime += +TimeStamp +: +: +Now +( +) +; nsCOMPtr < nsIRunnable @@ -7193,13 +7228,20 @@ failed ) ; } -return -NS_OK -; } +else +{ +mOnDataFinishedTime += +TimeStamp +: +: +Now +( +) +; if ( -! StaticPrefs : : @@ -7208,14 +7250,6 @@ network_send_OnDataFinished_html5parser ) ) { -mOnStopCalled -= -false -; -return -NS_OK -; -} MOZ_ASSERT ( IsParserThread @@ -7245,6 +7279,86 @@ PostLoadFlusher ( ) ; +} +else +{ +} +} +} +if +( +! +mOnStopRequestTime +. +IsNull +( +) +& +& +! +mOnDataFinishedTime +. +IsNull +( +) +) +{ +TimeDuration +delta += +( +mOnStopRequestTime +- +mOnDataFinishedTime +) +; +if +( +delta +. +ToMilliseconds +( +) +< +0 +) +{ +delta += +- +delta +; +glean +: +: +networking +: +: +http_content_html5parser_ondatafinished_to_onstop_delay_negative +. +AccumulateRawDuration +( +delta +) +; +} +else +{ +glean +: +: +networking +: +: +http_content_html5parser_ondatafinished_to_onstop_delay +. +AccumulateRawDuration +( +delta +) +; +} +} return NS_OK ; diff --git a/parser/html/nsHtml5StreamParser.h b/parser/html/nsHtml5StreamParser.h index a5f7ac77cbb6d..f4b6b9a61cf64 100644 --- a/parser/html/nsHtml5StreamParser.h +++ b/parser/html/nsHtml5StreamParser.h @@ -102,6 +102,15 @@ include " mozilla / +TimeStamp +. +h +" +# +include +" +mozilla +/ UniquePtr . h @@ -1371,6 +1380,18 @@ mOnStopCalled false } ; +mozilla +: +: +TimeStamp +mOnStopRequestTime +; +mozilla +: +: +TimeStamp +mOnDataFinishedTime +; } ; #