Skip to content

Commit

Permalink
[skip ci] Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
badboy committed Aug 8, 2024
1 parent fc32a38 commit ab8755b
Show file tree
Hide file tree
Showing 337 changed files with 664 additions and 360 deletions.
182 changes: 167 additions & 15 deletions book/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -7970,7 +7970,13 @@ <h3 id="accumulatesinglesample"><a class="header" href="#accumulatesinglesample"
</code></pre>
</div>
<div data-lang="Firefox Desktop" class="tab">
<p>This API is not currently exposed in Firefox Desktop, see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1884183">Bug 1884183</a>.</p>
<p><strong>C++</strong></p>
<pre><code class="language-c++">#include &quot;mozilla/glean/GleanMetrics.h&quot;

mozilla::glean::pages::page_load.AccumulateRawDuration(aDuration);
</code></pre>
<p><strong>JavaScript</strong></p>
<p>This operation is not currently supported in JavaScript.</p>
</div>
</div>
</div>
Expand Down Expand Up @@ -8415,7 +8421,18 @@ <h3 id="start-2"><a class="header" href="#start-2"><code>start</code></a></h3>
</code></pre>
</div>
<div data-lang="JavaScript" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab">
<p><strong>C++</strong></p>
<pre><code class="language-c++">#include &quot;mozilla/glean/GleanMetrics.h&quot;

auto timerId = mozilla::glean::devtools::cold_toolbox_open_delay
.Get(toolbox_id)
.Start();
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">const timerId = Glean.devtools.coldToolboxOpenDelay[toolbox_id].start();
</code></pre>
</div>
</div>
</div>
<h4 id="recorded-errors-14"><a class="header" href="#recorded-errors-14">Recorded Errors</a></h4>
Expand Down Expand Up @@ -8447,7 +8464,18 @@ <h3 id="stopandaccumulate-1"><a class="header" href="#stopandaccumulate-1"><code
</code></pre>
</div>
<div data-lang="JavaScript" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab">
<p><strong>C++</strong></p>
<pre><code class="language-c++">#include &quot;mozilla/glean/GleanMetrics.h&quot;

mozilla::glean::devtools::cold_toolbox_open_delay
.Get(toolbox_id)
.StopAndAccumulate(std::move(timerId));
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">Glean.devtools.coldToolboxOpenDelay[toolbox_id].stopAndAccumulate(timerId);
</code></pre>
</div>
</div>
</div>
<h4 id="recorded-errors-15"><a class="header" href="#recorded-errors-15">Recorded errors</a></h4>
Expand Down Expand Up @@ -8478,7 +8506,18 @@ <h3 id="cancel-2"><a class="header" href="#cancel-2"><code>cancel</code></a></h3
</code></pre>
</div>
<div data-lang="JavaScript" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab">
<p><strong>C++</strong></p>
<pre><code class="language-c++">#include &quot;mozilla/glean/GleanMetrics.h&quot;

mozilla::glean::devtools::cold_toolbox_open_delay
.Get(toolbox_id)
.Cancel(std::move(timerId));
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">Glean.devtools.coldToolboxOpenDelay[toolbox_id].cancel(timerId);
</code></pre>
</div>
</div>
</div>
<h4 id="recorded-errors-16"><a class="header" href="#recorded-errors-16">Recorded errors</a></h4>
Expand Down Expand Up @@ -8519,7 +8558,17 @@ <h3 id="accumulatesamples-1"><a class="header" href="#accumulatesamples-1"><code
</code></pre>
</div>
<div data-lang="JavaScript" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab">
<p><strong>C++</strong></p>
<pre><code class="language-c++">#include &quot;mozilla/glean/GleanMetrics.h&quot;

mozilla::glean::devtools::cold_toolbox_open_delay
.Get(toolbox_id)
.AccumulateRawSamples(samples);
</code></pre>
<p><strong>JavaScript</strong></p>
<p>This operation is not currently supported in JavaScript.</p>
</div>
</div>
</div>
<h4 id="recorded-errors-17"><a class="header" href="#recorded-errors-17">Recorded errors</a></h4>
Expand Down Expand Up @@ -8562,7 +8611,17 @@ <h3 id="accumulatesinglesample-1"><a class="header" href="#accumulatesinglesampl
</code></pre>
</div>
<div data-lang="JavaScript" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab">
<p><strong>C++</strong></p>
<pre><code class="language-c++">#include &quot;mozilla/glean/GleanMetrics.h&quot;

mozilla::glean::devtools::cold_toolbox_open_delay
.Get(toolboxId)
.AccumulateRawDuration(aDuration);
</code></pre>
<p><strong>JavaScript</strong></p>
<p>This operation is not currently supported in JavaScript.</p>
</div>
</div>
</div>
<h4 id="recorded-errors-18"><a class="header" href="#recorded-errors-18">Recorded errors</a></h4>
Expand Down Expand Up @@ -8604,7 +8663,19 @@ <h3 id="testgetvalue-9"><a class="header" href="#testgetvalue-9"><code>testGetVa
</code></pre>
</div>
<div data-lang="JavaScript" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab">
<p><strong>C++</strong></p>
<pre><code class="language-c++">#include &quot;mozilla/glean/GleanMetrics.h&quot;

const data = mozilla::glean::devtools::cold_toolbox_open_delay
.Get(&quot;webconsole&quot;_ns)
.TestGetValue().value().unwrap();
ASSERT_TRUE(data.sum &gt; 0);
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">Assert.ok(Glean.devtools.coldToolboxOpenDelay[&quot;webconsole&quot;].testGetValue().sum &gt; 0);
</code></pre>
</div>
</div>
</div>
<h3 id="testgetnumrecordederrors-9"><a class="header" href="#testgetnumrecordederrors-9"><code>testGetNumRecordedErrors</code></a></h3>
Expand Down Expand Up @@ -9125,7 +9196,19 @@ <h3 id="accumulate-1"><a class="header" href="#accumulate-1"><code>accumulate</c
</code></pre>
</div>
<div data-lang="JavaScript" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab">
<p><strong>C++</strong></p>
<pre><code class="language-c++">#include &quot;mozilla/glean/GleanMetrics.h&quot;

mozilla::network::http_upload_bandwidth
.Get(httpVersion)
.Accumulate(this.mRequestSize * 8.0 / 1048576.0 / sendTime.AsSeconds());
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">Glean.network.httpUploadBandwidth[httpVersion]
.accumulate(requestSize * 8.0 / 1048576.0 / sendTime.asSeconds())
</code></pre>
</div>
</div>
</div>
<h4 id="recorded-errors-20"><a class="header" href="#recorded-errors-20">Recorded Errors</a></h4>
Expand Down Expand Up @@ -9166,7 +9249,20 @@ <h3 id="testgetvalue-11"><a class="header" href="#testgetvalue-11"><code>testGet
</code></pre>
</div>
<div data-lang="JavaScript" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab">
<p><strong>C++</strong></p>
<pre><code class="language-c++">#include &quot;mozilla/glean/GleanMetrics.h&quot;

const data = mozilla::glean::network::http_upload_bandwidth
.Get(&quot;h2&quot;)
.TestGetValue().value().unwrap()
ASSERT_EQ(42UL, data.sum);
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">const data = Glean.network.httpUploadBandwidth[&quot;h2&quot;].testGetValue();
Assert.equal(42, data.sum);
</code></pre>
</div>
</div>
</div>
<h3 id="testgetnumrecordederrors-11"><a class="header" href="#testgetnumrecordederrors-11"><code>testGetNumRecordedErrors</code></a></h3>
Expand Down Expand Up @@ -10497,7 +10593,7 @@ <h3 id="accumulatesamples-2"><a class="header" href="#accumulatesamples-2"><code
mozilla::glean::graphics::checkerboard_peak.AccumulateSamples({ 23 });
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">Glean.graphics.checkerboardPeak.accumulateSamples([23])
<pre><code class="language-js">Glean.graphics.checkerboardPeak.accumulateSamples([23]);
</code></pre>
</div>
</div>
Expand Down Expand Up @@ -10534,7 +10630,14 @@ <h3 id="accumulatesinglesample-2"><a class="header" href="#accumulatesinglesampl
</code></pre>
</div>
<div data-lang="Firefox Desktop" class="tab">
<p>This API is not currently exposed in Firefox Desktop, see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1884183">Bug 1884183</a>.</p>
<p><strong>C++</strong></p>
<pre><code class="language-cpp">#include &quot;mozilla/glean/GleanMetrics.h&quot;

mozilla::glean::graphics::checkerboard_peak.AccumulateSingleSample(23);
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">Glean.graphics.checkerboardPeak.accumulateSingleSample(23);
</code></pre>
</div>
</div>
</div>
Expand Down Expand Up @@ -10817,7 +10920,24 @@ <h3 id="accumulatesamples-3"><a class="header" href="#accumulatesamples-3"><code
</code></pre>
</div>
<div data-lang="JavaScript" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab">
<p><strong>C++</strong></p>
<pre><code class="language-cpp">#include &quot;mozilla/glean/GleanMetrics.h&quot;

mozilla::glean::network::http3_late_ack_ratio
.Get(&quot;ack&quot;)
.AccumulateSamples({(stats.late_ack * 10000) / stats.packets_tx});
mozilla::glean::network::http3_late_ack_ratio
.Get(&quot;pto&quot;)
.AccumulateSamples({(stats.pto_ack * 10000) / stats.packets_tx});
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">Glean.network.http3LateAckRatio[&quot;ack&quot;]
.accumulateSamples([(stats.late_ack * 10000) / stats.packets_tx]);
Glean.network.http3LateAckRatio[&quot;pto&quot;]
.accumulateSamples([(stats.pto_ack * 10000) / stats.packets_tx]);
</code></pre>
</div>
</div>
</div>
<h4 id="recorded-errors-26"><a class="header" href="#recorded-errors-26">Recorded Errors</a></h4>
Expand Down Expand Up @@ -10851,7 +10971,24 @@ <h3 id="accumulatesinglesample-3"><a class="header" href="#accumulatesinglesampl
</code></pre>
</div>
<div data-lang="JavaScript" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab">
<p><strong>C++</strong></p>
<pre><code class="language-cpp">#include &quot;mozilla/glean/GleanMetrics.h&quot;

mozilla::glean::network::http3_late_ack_ratio
.Get(&quot;ack&quot;)
.AccumulateSingleSample((stats.late_ack * 10000) / stats.packets_tx);
mozilla::glean::network::http3_late_ack_ratio
.Get(&quot;pto&quot;)
.AccumulateSingleSample((stats.pto_ack * 10000) / stats.packets_tx);
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">Glean.network.http3LateAckRatio[&quot;ack&quot;]
.accumulateSingleSample((stats.late_ack * 10000) / stats.packets_tx);
Glean.network.http3LateAckRatio[&quot;pto&quot;]
.accumulateSingleSample((stats.pto_ack * 10000) / stats.packets_tx);
</code></pre>
</div>
</div>
</div>
<h4 id="recorded-errors-27"><a class="header" href="#recorded-errors-27">Recorded Errors</a></h4>
Expand Down Expand Up @@ -10888,11 +11025,26 @@ <h3 id="testgetvalue-17"><a class="header" href="#testgetvalue-17"><code>testGet
assert_eq!(1, network::http3_late_ack_ratio.get(&quot;ack&quot;).test_get_value(None).unwrap().count);

// Buckets are indexed by their lower bound.
assert_eq!(1, etwork::http3_late_ack_ratio.get(&quot;ack&quot;).test_get_value(None).unwrap().values[41]);
assert_eq!(1, network::http3_late_ack_ratio.get(&quot;ack&quot;).test_get_value(None).unwrap().values[41]);
</code></pre>
</div>
<div data-lang="JavaScript" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab">
<p><strong>C++</strong></p>
<pre><code class="language-cpp">#include &quot;mozilla/glean/GleanMetrics.h&quot;

auto data = mozilla::glean::network::http3_late_ack_ratio.Get(&quot;ack&quot;).TestGetValue().value();
ASSERT_EQ(42UL, data.sum);
ASSERT_EQ(1, data.count);
ASSERT_EQ(1, data.values[41]);
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">let data = Glean.network.http3LateAckRatio[&quot;ack&quot;].testGetValue();
Assert.equal(42, data.sum);
Assert.equal(1, data.count);
Assert.equal(1, data.values[41]);
</code></pre>
</div>
</div>
</div>
<h3 id="testgetnumrecordederrors-17"><a class="header" href="#testgetnumrecordederrors-17"><code>testGetNumRecordedErrors</code></a></h3>
Expand Down
11 changes: 9 additions & 2 deletions book/reference/metrics/custom_distribution.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ <h3 id="accumulatesamples"><a class="header" href="#accumulatesamples"><code>acc
mozilla::glean::graphics::checkerboard_peak.AccumulateSamples({ 23 });
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">Glean.graphics.checkerboardPeak.accumulateSamples([23])
<pre><code class="language-js">Glean.graphics.checkerboardPeak.accumulateSamples([23]);
</code></pre>
</div>
</div>
Expand Down Expand Up @@ -270,7 +270,14 @@ <h3 id="accumulatesinglesample"><a class="header" href="#accumulatesinglesample"
</code></pre>
</div>
<div data-lang="Firefox Desktop" class="tab">
<p>This API is not currently exposed in Firefox Desktop, see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1884183">Bug 1884183</a>.</p>
<p><strong>C++</strong></p>
<pre><code class="language-cpp">#include &quot;mozilla/glean/GleanMetrics.h&quot;

mozilla::glean::graphics::checkerboard_peak.AccumulateSingleSample(23);
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">Glean.graphics.checkerboardPeak.accumulateSingleSample(23);
</code></pre>
</div>
</div>
</div>
Expand Down
57 changes: 53 additions & 4 deletions book/reference/metrics/labeled_custom_distributions.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,24 @@ <h3 id="accumulatesamples"><a class="header" href="#accumulatesamples"><code>acc
</code></pre>
</div>
<div data-lang="JavaScript" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab">
<p><strong>C++</strong></p>
<pre><code class="language-cpp">#include &quot;mozilla/glean/GleanMetrics.h&quot;

mozilla::glean::network::http3_late_ack_ratio
.Get(&quot;ack&quot;)
.AccumulateSamples({(stats.late_ack * 10000) / stats.packets_tx});
mozilla::glean::network::http3_late_ack_ratio
.Get(&quot;pto&quot;)
.AccumulateSamples({(stats.pto_ack * 10000) / stats.packets_tx});
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">Glean.network.http3LateAckRatio[&quot;ack&quot;]
.accumulateSamples([(stats.late_ack * 10000) / stats.packets_tx]);
Glean.network.http3LateAckRatio[&quot;pto&quot;]
.accumulateSamples([(stats.pto_ack * 10000) / stats.packets_tx]);
</code></pre>
</div>
</div>
</div>
<h4 id="recorded-errors"><a class="header" href="#recorded-errors">Recorded Errors</a></h4>
Expand Down Expand Up @@ -247,7 +264,24 @@ <h3 id="accumulatesinglesample"><a class="header" href="#accumulatesinglesample"
</code></pre>
</div>
<div data-lang="JavaScript" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab">
<p><strong>C++</strong></p>
<pre><code class="language-cpp">#include &quot;mozilla/glean/GleanMetrics.h&quot;

mozilla::glean::network::http3_late_ack_ratio
.Get(&quot;ack&quot;)
.AccumulateSingleSample((stats.late_ack * 10000) / stats.packets_tx);
mozilla::glean::network::http3_late_ack_ratio
.Get(&quot;pto&quot;)
.AccumulateSingleSample((stats.pto_ack * 10000) / stats.packets_tx);
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">Glean.network.http3LateAckRatio[&quot;ack&quot;]
.accumulateSingleSample((stats.late_ack * 10000) / stats.packets_tx);
Glean.network.http3LateAckRatio[&quot;pto&quot;]
.accumulateSingleSample((stats.pto_ack * 10000) / stats.packets_tx);
</code></pre>
</div>
</div>
</div>
<h4 id="recorded-errors-1"><a class="header" href="#recorded-errors-1">Recorded Errors</a></h4>
Expand Down Expand Up @@ -284,11 +318,26 @@ <h3 id="testgetvalue"><a class="header" href="#testgetvalue"><code>testGetValue<
assert_eq!(1, network::http3_late_ack_ratio.get(&quot;ack&quot;).test_get_value(None).unwrap().count);

// Buckets are indexed by their lower bound.
assert_eq!(1, etwork::http3_late_ack_ratio.get(&quot;ack&quot;).test_get_value(None).unwrap().values[41]);
assert_eq!(1, network::http3_late_ack_ratio.get(&quot;ack&quot;).test_get_value(None).unwrap().values[41]);
</code></pre>
</div>
<div data-lang="JavaScript" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab"></div>
<div data-lang="Firefox Desktop" class="tab">
<p><strong>C++</strong></p>
<pre><code class="language-cpp">#include &quot;mozilla/glean/GleanMetrics.h&quot;

auto data = mozilla::glean::network::http3_late_ack_ratio.Get(&quot;ack&quot;).TestGetValue().value();
ASSERT_EQ(42UL, data.sum);
ASSERT_EQ(1, data.count);
ASSERT_EQ(1, data.values[41]);
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code class="language-js">let data = Glean.network.http3LateAckRatio[&quot;ack&quot;].testGetValue();
Assert.equal(42, data.sum);
Assert.equal(1, data.count);
Assert.equal(1, data.values[41]);
</code></pre>
</div>
</div>
</div>
<h3 id="testgetnumrecordederrors"><a class="header" href="#testgetnumrecordederrors"><code>testGetNumRecordedErrors</code></a></h3>
Expand Down
Loading

0 comments on commit ab8755b

Please sign in to comment.