Skip to content

Commit ed01ee7

Browse files
committed
update telemetry
1 parent 3291744 commit ed01ee7

File tree

11 files changed

+200
-210
lines changed

11 files changed

+200
-210
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ All notable changes to the **kdb VS Code extension** are documented in this file
1111
- SQL Workbook
1212
- Connect and auto execute query functionality
1313
- Use own grid instead of ag-grid-community for kdb Results View
14+
- Nested objects are better supported in kdb Results View
1415
- Add support for KDB-X modules in language server
1516
- Moved documentation to its own site
1617

@@ -26,7 +27,8 @@ All notable changes to the **kdb VS Code extension** are documented in this file
2627
- Updated telemetry data sent
2728
- Use structured text for datasources
2829
- Integrate KDB-X KX_TTY feature in REPL
29-
- Update query wrappers and added q CI testing
30+
- Added q CI testing
31+
- Updated query wrappers
3032

3133
# v1.16.1
3234

ref_card.md

Lines changed: 115 additions & 116 deletions
Large diffs are not rendered by default.

server/src/qLangServer.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,6 @@ export default class QLangServer {
451451
public async onFoldingRanges({
452452
textDocument: { uri },
453453
}: FoldingRangeParams): Promise<FoldingRange[]> {
454-
this.notify("onFoldingRanges", MessageKind.DEBUG, {
455-
logger,
456-
telemetry: "Language.FoldingRanges",
457-
});
458-
459454
const source = await this.getSource(uri);
460455
const ranges: FoldingRange[] = [];
461456

src/commands/serverCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ export async function executeQuery(
966966
notify("GG Plot displayed", MessageKind.DEBUG, {
967967
logger,
968968
telemetry:
969-
"Graphics.Displayed" +
969+
"Results.Graphics.Displayed" +
970970
(isInsights ? ".ie" : ".kdb") +
971971
(isPython ? ".py" : ".q"),
972972
});

src/commands/workspaceCommand.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import {
4747
Runner,
4848
} from "../utils/notifications";
4949
import {
50-
ExecFlags,
50+
RunFlag,
5151
getPythonWrapper,
5252
getSQLWrapper,
5353
notifyExecution,
@@ -543,11 +543,11 @@ export async function runActiveEditor(type?: ExecutionTypes) {
543543
if (server === undefined) {
544544
await runOnRepl(ext.activeTextEditor, type);
545545
notifyExecution(
546-
ExecFlags.Run |
547-
ExecFlags.Repl |
548-
(isWorkbook(uri) ? ExecFlags.Workbook : 0) |
549-
(isPython(uri) ? ExecFlags.Python : 0) |
550-
(isSql(uri) ? ExecFlags.Sql : 0),
546+
RunFlag.Run |
547+
RunFlag.Repl |
548+
(isWorkbook(uri) ? RunFlag.Workbook : 0) |
549+
(isPython(uri) ? RunFlag.Python : 0) |
550+
(isSql(uri) ? RunFlag.Sql : 0),
551551
);
552552
return;
553553
}
@@ -585,12 +585,12 @@ export async function runActiveEditor(type?: ExecutionTypes) {
585585
isInsights,
586586
);
587587
notifyExecution(
588-
(type === ExecutionTypes.PopulateScratchpad ? 0 : ExecFlags.Run) |
589-
(isInsights ? ExecFlags.Insights : 0) |
590-
(target ? ExecFlags.Dap : 0) |
591-
(isWorkbook(uri) ? ExecFlags.Workbook : 0) |
592-
(isPython(uri) ? ExecFlags.Python : 0) |
593-
(isSql(uri) ? ExecFlags.Sql : 0),
588+
(type === ExecutionTypes.PopulateScratchpad ? 0 : RunFlag.Run) |
589+
(isInsights ? RunFlag.Insights : 0) |
590+
(target ? RunFlag.Dap : 0) |
591+
(isWorkbook(uri) ? RunFlag.Workbook : 0) |
592+
(isPython(uri) ? RunFlag.Python : 0) |
593+
(isSql(uri) ? RunFlag.Sql : 0),
594594
);
595595
} catch (error) {
596596
notify(

src/services/dataSourceEditorProvider.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import { UDA } from "../models/uda";
4646
import { getBasename, offerConnectAction } from "../utils/core";
4747
import { getNonce } from "../utils/getNonce";
4848
import { MessageKind, Runner, notify } from "../utils/notifications";
49-
import { ExecFlags, notifyExecution } from "../utils/queryUtils";
49+
import { RunFlag, notifyExecution } from "../utils/queryUtils";
5050
import { parseUDAList } from "../utils/uda";
5151
import { getUri } from "../utils/uriUtils";
5252

@@ -223,7 +223,7 @@ export class DataSourceEditorProvider implements CustomTextEditorProvider {
223223
else if (await offerConnectAction(selectedServer))
224224
await runner.execute();
225225
notifyExecution(
226-
ExecFlags.Run | ExecFlags.Insights,
226+
RunFlag.Run,
227227
msg.dataSourceFile.dataSource.selectedType,
228228
);
229229
break;
@@ -236,10 +236,7 @@ export class DataSourceEditorProvider implements CustomTextEditorProvider {
236236
if (connected) await runner.execute();
237237
else if (await offerConnectAction(selectedServer))
238238
await runner.execute();
239-
notifyExecution(
240-
ExecFlags.Insights,
241-
msg.dataSourceFile.dataSource.selectedType,
242-
);
239+
notifyExecution(0, msg.dataSourceFile.dataSource.selectedType);
243240
break;
244241
}
245242
}

src/services/notebookController.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {
3838
getPythonWrapper,
3939
getSQLWrapper,
4040
notifyExecution,
41-
ExecFlags,
41+
RunFlag,
4242
} from "../utils/queryUtils";
4343
import { convertToGrid, formatResult } from "../utils/resultsRenderer";
4444

@@ -173,12 +173,12 @@ export class KxNotebookController {
173173
]);
174174

175175
notifyExecution(
176-
ExecFlags.Notebook |
177-
(variable ? 0 : ExecFlags.Run) |
178-
(isInsights ? ExecFlags.Insights : 0) |
179-
(target ? ExecFlags.Dap : 0) |
180-
(kind === CellKind.PYTHON ? ExecFlags.Python : 0) |
181-
(kind === CellKind.SQL ? ExecFlags.Sql : 0),
176+
RunFlag.Notebook |
177+
(variable ? 0 : RunFlag.Run) |
178+
(isInsights ? RunFlag.Insights : 0) |
179+
(target ? RunFlag.Dap : 0) |
180+
(kind === CellKind.PYTHON ? RunFlag.Python : 0) |
181+
(kind === CellKind.SQL ? RunFlag.Sql : 0),
182182
);
183183

184184
if (variable) {

src/services/resultsPanelProvider.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ export class KdbResultsViewProvider implements WebviewViewProvider {
118118
}
119119
const workspaceUri = workspaceFolders[0].uri;
120120
utils.exportToCsv(workspaceUri);
121+
notify("CSV exported.", MessageKind.DEBUG, {
122+
logger,
123+
telemetry: "Results.Export.csv",
124+
});
121125
}
122126

123127
isVisible(): boolean {
@@ -176,6 +180,10 @@ export class KdbResultsViewProvider implements WebviewViewProvider {
176180
theme: "legacy",
177181
themeColor: this.defineAgGridTheme(),
178182
});
183+
notify("Table displayed.", MessageKind.DEBUG, {
184+
logger,
185+
telemetry: "Results.Table.Displayed",
186+
});
179187
} else {
180188
this._view.webview.postMessage({
181189
command: "setResultsContent",

src/utils/connLabel.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,6 @@ export function addConnToLabel(labelName: string, connName: string) {
146146
connections: [connName],
147147
});
148148
}
149-
notify("Connection assigned to label.", MessageKind.DEBUG, {
150-
logger,
151-
telemetry: "Connection.Label.Assign",
152-
measurements: getConnectionLabelStatistics(connName),
153-
});
154149
}
155150
}
156151

@@ -165,12 +160,6 @@ export function removeConnFromLabels(connName: string) {
165160
workspace
166161
.getConfiguration()
167162
.update("kdb.labelsConnectionMap", ext.labelConnMapList, true);
168-
169-
notify("Connection removed from label.", MessageKind.DEBUG, {
170-
logger,
171-
telemetry: "Connection.Label.Unassign",
172-
measurements: getConnectionLabelStatistics(connName),
173-
});
174163
}
175164

176165
export async function handleLabelsConnMap(labels: string[], connName: string) {

src/utils/queryUtils.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ export function resetScratchpadStarted(connLabel: string) {
546546
ext.scratchpadStarted.delete(connLabel);
547547
}
548548

549-
export const enum ExecFlags {
549+
export const enum RunFlag {
550550
Run = 0b000000001,
551551
Workbook = 0b000000010,
552552
Notebook = 0b000000100,
@@ -560,22 +560,22 @@ export const enum ExecFlags {
560560

561561
export function notifyExecution(flags: number, dsType?: string) {
562562
const telemetry =
563-
(flags & ExecFlags.Run ? "Run" : "Populate") +
563+
(flags & RunFlag.Run ? "Run" : "Populate") +
564564
(dsType
565565
? ".Datasource." + dsType.toLowerCase()
566-
: flags & ExecFlags.Workbook
567-
? ".Workbook"
568-
: flags & ExecFlags.Notebook
569-
? ".Cell"
570-
: ".File") +
571-
(flags & ExecFlags.Repl
572-
? ".repl"
573-
: flags & ExecFlags.Insights
574-
? ".ie"
575-
: ".kdb") +
576-
(flags & ExecFlags.Quick ? ".quick" : "") +
577-
(flags & ExecFlags.Dap ? ".dap" : "") +
578-
(flags & ExecFlags.Python ? ".py" : flags & ExecFlags.Sql ? ".sql" : ".q");
566+
: (flags & RunFlag.Workbook
567+
? ".Workbook"
568+
: flags & RunFlag.Notebook
569+
? ".Cell"
570+
: ".File") +
571+
(flags & RunFlag.Repl
572+
? ".repl"
573+
: flags & RunFlag.Insights
574+
? ".ie"
575+
: ".kdb") +
576+
(flags & RunFlag.Quick ? ".quick" : "") +
577+
(flags & RunFlag.Dap ? ".dap" : "") +
578+
(flags & RunFlag.Python ? ".py" : flags & RunFlag.Sql ? ".sql" : ".q"));
579579

580580
notify(`Query ${telemetry} executed.`, MessageKind.DEBUG, {
581581
logger,

0 commit comments

Comments
 (0)