Bug 1956726 - Migrate histograms to use Glean APIs in netwerk/protocol/websocket/, r=chutten,necko-reviewers,sunil.

Differential Revision: https://phabricator.services.mozilla.com/D244174
This commit is contained in:
Florian Quèze
2025-04-08 08:42:00 +00:00
parent eb72832510
commit 07fdd93074
3 changed files with 37 additions and 2 deletions

View File

@@ -20,7 +20,7 @@
#include "mozilla/ScopeExit.h"
#include "mozilla/StaticMutex.h"
#include "mozilla/StaticPrefs_privacy.h"
#include "mozilla/Telemetry.h"
#include "mozilla/glean/NetwerkProtocolWebsocketMetrics.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/Utf8.h"
#include "mozilla/net/WebSocketEventService.h"
@@ -3058,7 +3058,7 @@ void WebSocketChannel::ReportConnectionTelemetry(nsresult aStatusCode) {
(didProxy ? (1 << 0) : 0);
LOG(("WebSocketChannel::ReportConnectionTelemetry() %p %d", this, value));
Telemetry::Accumulate(Telemetry::WEBSOCKETS_HANDSHAKE_TYPE, value);
glean::websockets::handshake_type.AccumulateSingleSample(value);
}
// nsIDNSListener

View File

@@ -0,0 +1,34 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Adding a new metric? We have docs for that!
# https://firefox-source-docs.mozilla.org/toolkit/components/glean/user/new_definitions_file.html
---
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
$tags:
- 'Core :: Networking: WebSockets'
websockets:
handshake_type:
type: custom_distribution
description: >
Websockets Handshake Results (ws-ok-plain, ws-ok-proxy, ws-failed-plain,
ws-failed-proxy, wss-ok-plain, wss-ok-proxy, wss-failed-plain,
wss-failed-proxy)
This metric was generated to correspond to the Legacy Telemetry enumerated
histogram WEBSOCKETS_HANDSHAKE_TYPE.
range_min: 0
range_max: 16
bucket_count: 17
histogram_type: linear
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=805457
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=805457
notification_emails:
- necko@mozilla.com
expires: never
telemetry_mirror: WEBSOCKETS_HANDSHAKE_TYPE

View File

@@ -59,6 +59,7 @@ gecko_metrics = [
"netwerk/dns/metrics.yaml",
"netwerk/metrics.yaml",
"netwerk/protocol/http/metrics.yaml",
"netwerk/protocol/websocket/metrics.yaml",
"parser/html/metrics.yaml",
"parser/htmlparser/metrics.yaml",
"security/certverifier/metrics.yaml",