Skip to content

Commit 32f9b3f

Browse files
authored
Allows EDIT_TELEMETRY_DETAILS_SETTING_ID to be controlled by an experiment and adds hover telemetry (microsoft#258776)
1 parent 61deced commit 32f9b3f

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/vs/workbench/contrib/editTelemetry/browser/editStats/aiStatsStatusBar.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { autorun, derived } from '../../../../../base/common/observable.js';
1313
import { ThemeIcon } from '../../../../../base/common/themables.js';
1414
import { localize } from '../../../../../nls.js';
1515
import { ICommandService } from '../../../../../platform/commands/common/commands.js';
16+
import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js';
1617
import { IStatusbarService, StatusbarAlignment } from '../../../../services/statusbar/browser/statusbar.js';
1718
import { AI_STATS_SETTING_ID } from '../settingIds.js';
1819
import type { AiStatsFeature } from './aiStatsFeature.js';
@@ -25,6 +26,7 @@ export class AiStatsStatusBar extends Disposable {
2526
private readonly _aiStatsFeature: AiStatsFeature,
2627
@IStatusbarService private readonly _statusbarService: IStatusbarService,
2728
@ICommandService private readonly _commandService: ICommandService,
29+
@ITelemetryService private readonly _telemetryService: ITelemetryService,
2830
) {
2931
super();
3032

@@ -39,6 +41,7 @@ export class AiStatsStatusBar extends Disposable {
3941
text: '',
4042
tooltip: {
4143
element: async (_token) => {
44+
this._sendHoverTelemetry();
4245
store.clear();
4346
const elem = this._createStatusBarHover();
4447
return elem.keepUpdated(store).element;
@@ -50,6 +53,21 @@ export class AiStatsStatusBar extends Disposable {
5053
}));
5154
}
5255

56+
private _sendHoverTelemetry(): void {
57+
this._telemetryService.publicLog2<{
58+
aiRate: number;
59+
}, {
60+
owner: 'hediet';
61+
comment: 'Fired when the AI stats status bar hover tooltip is shown';
62+
aiRate: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The current AI rate percentage' };
63+
}>(
64+
'aiStatsStatusBar.hover',
65+
{
66+
aiRate: this._aiStatsFeature.aiRate.get(),
67+
}
68+
);
69+
}
70+
5371

5472
private _createStatusBar() {
5573
return n.div({

src/vs/workbench/contrib/editTelemetry/browser/editTelemetry.contribution.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@ configurationRegistry.registerConfiguration({
3131
type: 'boolean',
3232
default: false,
3333
tags: ['experimental'],
34+
experiment: {
35+
mode: 'auto'
36+
}
3437
},
3538
[EDIT_TELEMETRY_DETAILS_SETTING_ID]: {
3639
markdownDescription: localize('telemetry.editStats.detailed.enabled', "Controls whether to enable telemetry for detailed edit statistics (only sends statistics if general telemetry is enabled)."),
3740
type: 'boolean',
3841
default: false,
3942
tags: ['experimental'],
4043
experiment: {
41-
mode: 'startup'
44+
mode: 'auto'
4245
}
4346
},
4447
[EDIT_TELEMETRY_SHOW_STATUS_BAR]: {

0 commit comments

Comments
 (0)