Skip to content

Commit db0db96

Browse files
Track debug server event (#1357)
1 parent c37f3cb commit db0db96

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT license.
33

44
export const JAVA_LANGID: string = "java";
5+
export const TELEMETRY_EVENT = "telemetry";
56
export const HCR_EVENT = "hotcodereplace";
67
export const USER_NOTIFICATION_EVENT = "usernotification";
78

src/extension.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import * as _ from "lodash";
66
import * as path from "path";
77
import * as vscode from "vscode";
88
import { dispose as disposeTelemetryWrapper, initializeFromJsonFile, instrumentOperation,
9-
instrumentOperationAsVsCodeCommand, setUserError } from "vscode-extension-telemetry-wrapper";
9+
instrumentOperationAsVsCodeCommand, sendInfo, setUserError } from "vscode-extension-telemetry-wrapper";
1010
import * as commands from "./commands";
1111
import { JavaDebugConfigurationProvider, lastUsedLaunchConfig } from "./configurationProvider";
12-
import { HCR_EVENT, JAVA_LANGID, USER_NOTIFICATION_EVENT } from "./constants";
12+
import { HCR_EVENT, JAVA_LANGID, TELEMETRY_EVENT, USER_NOTIFICATION_EVENT } from "./constants";
1313
import { NotificationBar } from "./customWidget";
1414
import { initializeCodeLensProvider, startDebugging } from "./debugCodeLensProvider";
1515
import { initExpService } from "./experimentationService";
@@ -120,7 +120,12 @@ function registerDebugEventListener(context: vscode.ExtensionContext) {
120120
if (t !== JAVA_LANGID) {
121121
return;
122122
}
123-
if (customEvent.event === HCR_EVENT) {
123+
if (customEvent.event === TELEMETRY_EVENT) {
124+
sendInfo("", {
125+
operationName: customEvent.body?.name,
126+
...customEvent.body?.properties,
127+
});
128+
} else if (customEvent.event === HCR_EVENT) {
124129
handleHotCodeReplaceCustomEvent(customEvent);
125130
} else if (customEvent.event === USER_NOTIFICATION_EVENT) {
126131
handleUserNotification(customEvent);

0 commit comments

Comments
 (0)