Skip to content

Commit

Permalink
[Media Router] Remove obsolete and expired histograms.
Browse files Browse the repository at this point in the history
Remove obsolete/expired histograms for Cast.

Bug: 1413815
Change-Id: I389bd855a03d75166bc9b83673104c02a2789260
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4248076
Reviewed-by: Johannes Kron <kron@chromium.org>
Reviewed-by: Takumi Fujimoto <takumif@chromium.org>
Reviewed-by: Fabian Sommer <fabiansommer@chromium.org>
Commit-Queue: Mark Foltz <mfoltz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1108082}
  • Loading branch information
mfoltzgoogle authored and Chromium LUCI CQ committed Feb 22, 2023
1 parent fca3dac commit 95844a4
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 341 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,6 @@ void CastMediaSinkServiceImpl::OnChannelOpenSucceeded(
DCHECK(socket);
CastAnalytics::RecordCastChannelConnectResult(
MediaRouterChannelConnectResults::SUCCESS);
CastAnalytics::RecordDeviceNameLength(cast_sink.sink().name().size());
CastSinkExtraData& extra_data = cast_sink.cast_data();
// Manually set device capabilities for sinks discovered via DIAL as DIAL
// discovery does not provide capability info.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ const char CastAnalytics::kHistogramCastChannelConnectResult[] =
"MediaRouter.Cast.Channel.ConnectResult";
const char CastAnalytics::kHistogramCastChannelError[] =
"MediaRouter.Cast.Channel.Error";
const char CastAnalytics::kHistogramCastDeviceNameLength[] =
"MediaRouter.Cast.DeviceNameLength";
const char CastAnalytics::kHistogramCastMdnsChannelOpenSuccess[] =
"MediaRouter.Cast.Mdns.Channel.Open_Success";
const char CastAnalytics::kHistogramCastMdnsChannelOpenFailure[] =
Expand Down Expand Up @@ -109,11 +107,6 @@ void CastAnalytics::RecordDeviceChannelOpenDuration(
}
}

// static
void CastAnalytics::RecordDeviceNameLength(size_t length) {
base::UmaHistogramCounts100(kHistogramCastDeviceNameLength, length);
}

void WiredDisplayDeviceCountMetrics::RecordDeviceCounts(
size_t available_device_count,
size_t known_device_count) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ class CastAnalytics {
public:
static const char kHistogramCastChannelConnectResult[];
static const char kHistogramCastChannelError[];
static const char kHistogramCastDeviceNameLength[];
static const char kHistogramCastMdnsChannelOpenSuccess[];
static const char kHistogramCastMdnsChannelOpenFailure[];

Expand All @@ -111,7 +110,6 @@ class CastAnalytics {
static void RecordDeviceChannelError(MediaRouterChannelError channel_error);
static void RecordDeviceChannelOpenDuration(bool success,
const base::TimeDelta& duration);
static void RecordDeviceNameLength(size_t length);
};

// Metrics for wired display (local screen) sink counts.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,11 @@ enum FeedbackType {
OTHER = 'Other',
}

/**
* Keep in sync with MediaRouterCastFeedbackEvent in enums.xml.
*/
export enum FeedbackEvent {
OPENED = 0,
SENDING = 1,
RESENDING = 2,
SUCCEEDED = 3,
FAILED = 4,
MAX_VALUE = 4,
}

/**
* See
* https://docs.google.com/document/d/1c20VYdwpUPyBRQeAS0CMr6ahwWnb0s26gByomOwqDjk
*/
export interface FeedbackUiBrowserProxy {
/**
* Records an event using Chrome Metrics.
*/
recordEvent(event: FeedbackEvent): void;

/**
* Proxy for chrome.feedbackPrivate.sendFeedback().
*/
Expand All @@ -56,12 +39,6 @@ export interface FeedbackUiBrowserProxy {
}

export class FeedbackUiBrowserProxyImpl implements FeedbackUiBrowserProxy {
recordEvent(event: FeedbackEvent) {
chrome.send(
'metricsHandler:recordInHistogram',
['MediaRouter.Cast.Feedback.Event', event, FeedbackEvent.MAX_VALUE]);
}

sendFeedback(info: chrome.feedbackPrivate.FeedbackInfo) {
return chrome.feedbackPrivate.sendFeedback(
info, /*loadSystemInfo=*/ undefined, /*formOpenTime=*/ undefined);
Expand Down Expand Up @@ -198,8 +175,6 @@ export class FeedbackUiElement extends PolymerElement {
chrome.feedbackPrivate.getUserEmail(email => {
this.userEmail_ = email;
});

this.browserProxy_.recordEvent(FeedbackEvent.OPENED);
}


Expand Down Expand Up @@ -287,7 +262,7 @@ export class FeedbackUiElement extends PolymerElement {
};
}

this.updateSendDialog_(FeedbackEvent.SENDING, 'sending', false);
this.updateSendDialog_('sending', false);
this.$.sendDialog.showModal();
this.trySendFeedback_(feedback, 0, 0);
}
Expand All @@ -303,15 +278,15 @@ export class FeedbackUiElement extends PolymerElement {
this.browserProxy_.sendFeedback(feedback).then(result => {
if (result.status === chrome.feedbackPrivate.Status.SUCCESS) {
this.feedbackSent = true;
this.updateSendDialog_(FeedbackEvent.SUCCEEDED, 'sendSuccess', true);
this.updateSendDialog_('sendSuccess', true);
} else if (failureCount < this.maxResendAttempts) {
this.updateSendDialog_(FeedbackEvent.RESENDING, 'resending', false);
this.updateSendDialog_('resending', false);
const sendDuration = Date.now() - sendStartTime;
this.trySendFeedback_(
feedback, failureCount + 1,
Math.max(0, this.resendDelayMs - sendDuration));
} else {
this.updateSendDialog_(FeedbackEvent.FAILED, 'sendFail', true);
this.updateSendDialog_('sendFail', true);
}
});
}, delayMs);
Expand All @@ -320,9 +295,7 @@ export class FeedbackUiElement extends PolymerElement {
/**
* Updates the status of the "send" dialog and records the event.
*/
private updateSendDialog_(
event: FeedbackEvent, stringKey: string, isInteractive: boolean) {
this.browserProxy_.recordEvent(event);
private updateSendDialog_(stringKey: string, isInteractive: boolean) {
this.sendDialogText_ = loadTimeData.getString(stringKey);
this.sendDialogIsInteractive_ = isInteractive;
}
Expand Down
30 changes: 3 additions & 27 deletions chrome/test/data/webui/media_router/cast_feedback_ui_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import {FeedbackEvent, FeedbackUiBrowserProxy, FeedbackUiBrowserProxyImpl, FeedbackUiElement} from 'chrome://cast-feedback/cast_feedback_ui.js';
import {FeedbackUiBrowserProxy, FeedbackUiBrowserProxyImpl, FeedbackUiElement} from 'chrome://cast-feedback/cast_feedback_ui.js';
import {PromiseResolver} from 'chrome://resources/js/promise_resolver.js';
import {assertDeepEquals, assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js';
import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js';
import {TestBrowserProxy} from 'chrome://webui-test/test_browser_proxy.js';

class TestFeedbackUiBrowserProxy extends TestBrowserProxy implements
Expand All @@ -13,14 +13,7 @@ class TestFeedbackUiBrowserProxy extends TestBrowserProxy implements
resolver: PromiseResolver<void> = new PromiseResolver();

constructor() {
super(['recordEvent', 'sendFeedback']);
}

recordEvent(event: FeedbackEvent) {
this.methodCalled('recordEvent', event);
if (event === FeedbackEvent.SUCCEEDED || event === FeedbackEvent.FAILED) {
this.resolver.resolve();
}
super(['sendFeedback']);
}

sendFeedback(info: chrome.feedbackPrivate.FeedbackInfo) {
Expand Down Expand Up @@ -66,14 +59,6 @@ suite('Suite', function() {
submit();
await browserProxy.resolver.promise;
assertEquals(2, browserProxy.getCallCount('sendFeedback'));
assertDeepEquals(
[
FeedbackEvent.OPENED,
FeedbackEvent.SENDING,
FeedbackEvent.RESENDING,
FeedbackEvent.SUCCEEDED,
],
browserProxy.getArgs('recordEvent'));
assertTrue(ui.feedbackSent);
assertTrue(
browserProxy.getArgs('sendFeedback')[0].description.indexOf(
Expand All @@ -88,15 +73,6 @@ suite('Suite', function() {
submit();
await browserProxy.resolver.promise;
assertEquals(3, browserProxy.getCallCount('sendFeedback'));
assertDeepEquals(
[
FeedbackEvent.OPENED,
FeedbackEvent.SENDING,
FeedbackEvent.RESENDING,
FeedbackEvent.RESENDING,
FeedbackEvent.FAILED,
],
browserProxy.getArgs('recordEvent'));
assertFalse(ui.feedbackSent);
});
});
57 changes: 0 additions & 57 deletions tools/metrics/histograms/enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14481,16 +14481,6 @@ Called by update_bad_message_reasons.py.-->
<int value="2" label="Clicked"/>
</enum>

<enum name="CastPlayBackState">
<obsolete>
Obsoleted on September 2020 as it's no longer being collected.
</obsolete>
<int value="0" label="YT_PLAYER_SUCCESS"/>
<int value="1" label="YT_PLAYER_FAILURE"/>
<int value="2" label="DEFAULT_PLAYER_SUCCESS"/>
<int value="3" label="DEFAULT_PLAYER_FAILURE"/>
</enum>

<enum name="CastSignatureStatus">
<int value="0" label="OK"/>
<int value="1" label="SignatureEmpty"/>
Expand Down Expand Up @@ -67402,12 +67392,6 @@ Called by update_use_counter_css.py.-->
<int value="4" label="Conflicting name resolution"/>
</enum>

<enum name="MediaCommand">
<int value="0" label="Resume"/>
<int value="1" label="Pause"/>
<int value="2" label="Seek"/>
</enum>

<enum name="MediaContainers">
<int value="0" label="Unknown"/>
<int value="1" label="AAC (Advanced Audio Coding)"/>
Expand Down Expand Up @@ -67919,14 +67903,6 @@ Called by update_use_counter_css.py.-->
<int value="7" label="Ping Timeout"/>
</enum>

<enum name="MediaRouterCastFeedbackEvent">
<int value="0" label="Dialog opened"/>
<int value="1" label="Sending"/>
<int value="2" label="Resending"/>
<int value="3" label="Feedback sent"/>
<int value="4" label="Too many retries"/>
</enum>

<enum name="MediaRouterCastSinkSource">
<int value="0" label="NetworkCache"/>
<int value="1" label="mDNS"/>
Expand Down Expand Up @@ -88710,31 +88686,11 @@ https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_2.7.1.pdf
<int value="5" label="Failed to read ACK message from socket"/>
</enum>

<enum name="RemotePlaybackDeviceType">
<obsolete>
Dprecated as of 2021/01.
</obsolete>
<int value="0" label="Cast Generic Media Player"/>
<int value="1" label="Cast YouTube Player"/>
<int value="2" label="Non-Cast YouTube Player"/>
</enum>

<enum name="RemotePlaybackInitiationLocation">
<int value="0" label="RemotePlayback API implemented by the sites"/>
<int value="1" label="Cast button in the HTML media element"/>
</enum>

<enum name="RemotePlaybackUrlResolveResult">
<int value="0" label="Successfully Resolved"/>
<int value="1" label="Malformed or empty Url"/>
<int value="2" label="No CORS header when required"/>
<int value="3" label="CORS header incompatible with Chromecast"/>
<int value="4" label="The response code indicated failure"/>
<int value="5" label="IO exception while fetching the url"/>
<int value="6" label="Unknown media type"/>
<int value="7" label="HttpUrlConnection crash"/>
</enum>

<enum name="RemoteProcessInteractionResult">
<int value="0" label="Terminate succeeded"/>
<int value="1" label="Terminate failed"/>
Expand Down Expand Up @@ -105795,19 +105751,6 @@ Full version information for the fingerprint enum values:
<int value="39" label="NV12A"/>
</enum>

<enum name="VideoPlayerCastAPIExtensionStatus">
<int value="0" label="Skipped (Cast extension is unavailable)"/>
<int value="1" label="Installation failed"/>
<int value="2" label="Load failed"/>
<int value="3" label="Loaded successfully (newly installed)"/>
<int value="4" label="Loaded successfully (already installed)"/>
</enum>

<enum name="VideoPlayerPlayType">
<int value="0" label="Local playback"/>
<int value="1" label="Play on cast device"/>
</enum>

<enum name="VideoResolutionDesignation">
<int value="0" label="Unknown"/>
<int value="1" label="QQVGA (160x120)"/>
Expand Down
27 changes: 0 additions & 27 deletions tools/metrics/histograms/metadata/media/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6018,16 +6018,6 @@ chromium-metrics-reviews@google.com.
</summary>
</histogram>

<histogram name="MediaRouter.Cast.DeviceNameLength" units="characters"
expires_after="2022-05-01">
<owner>takumif@chromium.org</owner>
<owner>openscreen-eng@google.com</owner>
<summary>
Records the length of the friendly name of a Cast device when we succeed to
open a Cast channel to it.
</summary>
</histogram>

<histogram name="MediaRouter.Cast.Discovery.ConnectedDevicesCount"
units="devices" expires_after="2023-06-25">
<owner>mfoltz@chromium.org</owner>
Expand Down Expand Up @@ -6055,13 +6045,6 @@ chromium-metrics-reviews@google.com.
<summary>The source of discovery for a newly-created Cast sink.</summary>
</histogram>

<histogram name="MediaRouter.Cast.Feedback.Event"
enum="MediaRouterCastFeedbackEvent" expires_after="2022-05-01">
<owner>jrw@google.com</owner>
<owner>openscreen-eng@google.com</owner>
<summary>Events related to the WebUI Cast feedback dialog.</summary>
</histogram>

<histogram name="MediaRouter.Cast.LaunchSessionRequest.SupportedAppTypes"
enum="ReceiverAppTypeSet" expires_after="2023-07-02">
<owner>muyaoxu@google.com</owner>
Expand Down Expand Up @@ -6168,16 +6151,6 @@ chromium-metrics-reviews@google.com.
</summary>
</histogram>

<histogram name="MediaRouter.CastStreaming.Session.Length.File" units="ms"
expires_after="2022-07-01">
<obsolete>
Removed 04/2022 as local file casting is no longer done via the Cast UI.
</obsolete>
<owner>takumif@chromium.org</owner>
<owner>openscreen-eng@google.com</owner>
<summary>Total length of a Cast Streaming File mirror session.</summary>
</histogram>

<histogram name="MediaRouter.CastStreaming.Session.Length.OffscreenTab"
units="ms" expires_after="2023-05-01">
<owner>takumif@chromium.org</owner>
Expand Down

0 comments on commit 95844a4

Please sign in to comment.