Skip to content

Commit 3291744

Browse files
authored
Merge pull request #716 from KxSystems/ee-telemetry
Update Telemetry
2 parents ee2f14a + f87c9d4 commit 3291744

23 files changed

+454
-203
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22

33
All notable changes to the **kdb VS Code extension** are documented in this file.
44

5+
# v1.17.0
6+
7+
### Enhancements
8+
9+
- Added quick connections
10+
- Run on REPL by default
11+
- SQL Workbook
12+
- Connect and auto execute query functionality
13+
- Use own grid instead of ag-grid-community for kdb Results View
14+
- Add support for KDB-X modules in language server
15+
- Moved documentation to its own site
16+
17+
### Fixes
18+
19+
- kdb output channel should support log levels
20+
- CSV export does not work properly for cells that contain lists or strings
21+
- Auto resizing of grid columns
22+
- Specific python query executions not working
23+
24+
### Internal Improvements
25+
26+
- Updated telemetry data sent
27+
- Use structured text for datasources
28+
- Integrate KDB-X KX_TTY feature in REPL
29+
- Update query wrappers and added q CI testing
30+
531
# v1.16.1
632

733
### Fixes

ref_card.md

Lines changed: 131 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,136 @@
5757

5858
## Execution
5959

60-
| Type | REPL | My q | IE SP | IE q/SQL | IE API | IE UDA | IE Populate SP |
61-
| :--------- | :--: | :--: | :---: | :------: | :----: | :----: | :------------: |
62-
| File `q` ||||| | ||
63-
| File `py` ||||| | ||
64-
| File `sql` ||| || | ||
65-
| Cell `q` ||||| | ||
66-
| Cell `py` ||||| | ||
67-
| Cell `sql` ||| || | ||
68-
| Datasource | | | |||||
60+
| Type | REPL | My q | IE SP | IE q/SQL | IE API | IE UDA | IE Populate SP |
61+
| :------------------ | :--: | :--: | :---: | :------: | :----: | :----: | :------------: |
62+
| File `q` ||||| | ||
63+
| File `py` ||||| | ||
64+
| File `sql` ||| || | ||
65+
| Workbook `q` ||||| | ||
66+
| Workbook `py` ||||| | ||
67+
| Workbook `sql` ||| || | ||
68+
| Notebook Cell `q` ||||| | ||
69+
| Notebook Cell `py` ||||| | ||
70+
| Notebook Cell `sql` ||| || | ||
71+
| Datasource | | | |||||
6972

7073
`REPL` and `My q` requires [PyKX](https://github.com/KxSystems/kx-vscode/wiki/Use-PyKX-Within-REPL) for Python support.
74+
75+
## Telemetry
76+
77+
| Telemetry | Measurements | Source |
78+
| :----------------------------- | :----------: | :--------------------------------------- |
79+
| Extension.Activated | | src/extension.ts |
80+
| Extension.CustomAuth.Activated | | src/extension.ts |
81+
| ¦ | | |
82+
| Welcome.Displayed | | src/commands/setupCommand.ts |
83+
| Install.kdbx | | src/commands/setupCommand.ts |
84+
| Install.kdbx.workspace | | src/commands/setupCommand.ts |
85+
| Install.kdbx.win32.fail | | src/commands/setupCommand.ts |
86+
| Repl.Start | | src/commands/workspaceCommand.ts |
87+
| ¦ | | |
88+
| Connection.Create.kdb | | src/commands/serverCommand.ts |
89+
| Connection.Edit.kdb | | src/commands/serverCommand.ts |
90+
| Connection.Delete.kdb | | src/services/connectionManagerService.ts |
91+
| Connection.Create.ie | | src/commands/serverCommand.ts |
92+
| Connection.Edit.ie | | src/commands/serverCommand.ts |
93+
| Connection.Delete.ie | | src/services/connectionManagerService.ts |
94+
| Connection.Export.All | | src/extension.ts |
95+
| Connection.Export.Single | | src/extension.ts |
96+
| Connection.Import | | src/extension.ts |
97+
| Connection.Reset.ie.sp | | src/classes/insightsConnection.ts |
98+
| Connection.Label.Create || src/utils/connLabel.ts |
99+
| Connection.Label.Assign || src/utils/connLabel.ts |
100+
| Connection.Label.Unassign || src/utils/connLabel.ts |
101+
| Connection.Label.Delete || src/utils/connLabel.ts |
102+
| ¦ | | |
103+
| Run.Workbook.repl.q | | src/utils/queryUtils.ts |
104+
| Run.Workbook.repl.py | | src/utils/queryUtils.ts |
105+
| Run.Workbook.repl.sql | | src/utils/queryUtils.ts |
106+
| Run.File.repl.q | | src/utils/queryUtils.ts |
107+
| Run.File.repl.py | | src/utils/queryUtils.ts |
108+
| Run.File.repl.sql | | src/utils/queryUtils.ts |
109+
| Run.Cell.repl.q | | src/utils/queryUtils.ts |
110+
| Run.Cell.repl.py | | src/utils/queryUtils.ts |
111+
| Run.Cell.repl.sql | | src/utils/queryUtils.ts |
112+
| ¦ | | |
113+
| Run.Workbook.kdb.q | | src/utils/queryUtils.ts |
114+
| Run.Workbook.kdb.py | | src/utils/queryUtils.ts |
115+
| Run.Workbook.kdb.sql | | src/utils/queryUtils.ts |
116+
| Run.File.kdb.q | | src/utils/queryUtils.ts |
117+
| Run.File.kdb.py | | src/utils/queryUtils.ts |
118+
| Run.File.kdb.sql | | src/utils/queryUtils.ts |
119+
| Run.Cell.kdb.q | | src/utils/queryUtils.ts |
120+
| Run.Cell.kdb.py | | src/utils/queryUtils.ts |
121+
| Run.Cell.kdb.sql | | src/utils/queryUtils.ts |
122+
| ¦ | | |
123+
| Run.Workbook.ie.q | | src/utils/queryUtils.ts |
124+
| Run.Workbook.ie.py | | src/utils/queryUtils.ts |
125+
| Run.Workbook.ie.sql | | src/utils/queryUtils.ts |
126+
| Run.File.ie.q | | src/utils/queryUtils.ts |
127+
| Run.File.ie.py | | src/utils/queryUtils.ts |
128+
| Run.File.ie.sql | | src/utils/queryUtils.ts |
129+
| Run.Cell.ie.q | | src/utils/queryUtils.ts |
130+
| Run.Cell.ie.py | | src/utils/queryUtils.ts |
131+
| Run.Cell.ie.sql | | src/utils/queryUtils.ts |
132+
| ¦ | | |
133+
| Run.Workbook.ie.dap.q | | src/utils/queryUtils.ts |
134+
| Run.Workbook.ie.dap.py | | src/utils/queryUtils.ts |
135+
| Run.File.ie.dap.q | | src/utils/queryUtils.ts |
136+
| Run.File.ie.dap.py | | src/utils/queryUtils.ts |
137+
| Run.Cell.ie.dap.q | | src/utils/queryUtils.ts |
138+
| Run.Cell.ie.dap.py | | src/utils/queryUtils.ts |
139+
| ¦ | | |
140+
| Run.Workbook.kdb.quick.q | | |
141+
| Run.Workbook.kdb.quick.py | | |
142+
| Run.Workbook.kdb.quick.sql | | |
143+
| Run.File.kdb.quick.q | | |
144+
| Run.File.kdb.quick.py | | |
145+
| Run.File.kdb.quick.sql | | |
146+
| Run.Cell.kdb.quick.q | | |
147+
| Run.Cell.kdb.quick.py | | |
148+
| Run.Cell.kdb.quick.sql | | |
149+
| ¦ | | |
150+
| Run.Datasource.api | | src/utils/queryUtils.ts |
151+
| Run.Datasource.qsql | | src/utils/queryUtils.ts |
152+
| Run.Datasource.sql | | src/utils/queryUtils.ts |
153+
| Run.Datasource.uda | | src/utils/queryUtils.ts |
154+
| ¦ | | |
155+
| Populate.Datasource.api | | src/utils/queryUtils.ts |
156+
| Populate.Datasource.qsql | | src/utils/queryUtils.ts |
157+
| Populate.Datasource.sql | | src/utils/queryUtils.ts |
158+
| Populate.Datasource.uda | | src/utils/queryUtils.ts |
159+
| ¦ | | |
160+
| Populate.Workbook.q | | src/utils/queryUtils.ts |
161+
| Populate.Workbook.py | | src/utils/queryUtils.ts |
162+
| Populate.Workbook.sql | | src/utils/queryUtils.ts |
163+
| Populate.File.q | | src/utils/queryUtils.ts |
164+
| Populate.File.py | | src/utils/queryUtils.ts |
165+
| Populate.File.sql | | src/utils/queryUtils.ts |
166+
| Populate.Cell.q | | src/utils/queryUtils.ts |
167+
| Populate.Cell.py | | src/utils/queryUtils.ts |
168+
| Populate.Cell.sql | | src/utils/queryUtils.ts |
169+
| ¦ | | |
170+
| Graphics.Displayed.kdb.q | | src/commands/serverCommand.ts |
171+
| Graphics.Displayed.kdb.py | | src/commands/serverCommand.ts |
172+
| Graphics.Displayed.ie.q | | src/commands/serverCommand.ts |
173+
| Graphics.Displayed.ie.py | | src/commands/serverCommand.ts |
174+
| ¦ | | |
175+
| Language.References | | server/src/qLangServer.ts |
176+
| Language.Definition | | server/src/qLangServer.ts |
177+
| Language.Completion | | server/src/qLangServer.ts |
178+
| Language.RenameRequest | | server/src/qLangServer.ts |
179+
| Language.ParameterCache | | server/src/qLangServer.ts |
180+
| Language.FoldingRanges | | server/src/qLangServer.ts |
181+
| Language.CallHierarchy | | server/src/qLangServer.ts |
182+
| ¦ | | |
183+
| Debugger.Run | | |
184+
| Debugger.Resume | | |
185+
| Debugger.StepOver | | |
186+
| Debugger.SetBreakPoint | | |
187+
| ¦ | | |
188+
| Help.Open.Documentation | | src/extension.ts |
189+
| Help.Open.ReportBug | | src/extension.ts |
190+
| Help.Open.SuggestFeature | | src/extension.ts |
191+
| Help.Open.Survey | | src/extension.ts |
192+
| Help.Hide.Survey | | src/utils/feedbackSurveyUtils.ts |

server/src/qLangServer.ts

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,13 @@ export default class QLangServer {
199199
options: {
200200
logger?: string;
201201
params?: any;
202+
telemetry?: string | boolean;
202203
} = {},
203-
telemetry?: string | boolean,
204204
) {
205205
this.connection.sendNotification("notify", {
206206
message,
207207
kind,
208208
options,
209-
telemetry,
210209
});
211210
}
212211

@@ -252,6 +251,11 @@ export default class QLangServer {
252251
textDocument: { uri },
253252
position,
254253
}: ReferenceParams): Promise<Location[]> {
254+
this.notify("onReferences", MessageKind.DEBUG, {
255+
logger,
256+
telemetry: "Language.References",
257+
});
258+
255259
const source = await this.getSource(uri);
256260
const target = source.tokenAt(position);
257261

@@ -271,6 +275,11 @@ export default class QLangServer {
271275
textDocument: { uri },
272276
position,
273277
}: DefinitionParams): Promise<Location[]> {
278+
this.notify("onDefinition", MessageKind.DEBUG, {
279+
logger,
280+
telemetry: "Language.Definition",
281+
});
282+
274283
const source = await this.getSource(uri);
275284
const target = source.tokenAt(position);
276285

@@ -291,6 +300,11 @@ export default class QLangServer {
291300
position,
292301
newName,
293302
}: RenameParams): Promise<WorkspaceEdit | null> {
303+
this.notify("onRenameRequest", MessageKind.DEBUG, {
304+
logger,
305+
telemetry: "Language.RenameRequest",
306+
});
307+
294308
const source = await this.getSource(uri);
295309
const target = source.tokenAt(position);
296310

@@ -325,6 +339,11 @@ export default class QLangServer {
325339
textDocument: { uri },
326340
position,
327341
}: CompletionParams): Promise<CompletionItem[]> {
342+
this.notify("onCompletion", MessageKind.DEBUG, {
343+
logger,
344+
telemetry: "Language.Completion",
345+
});
346+
328347
const source = await this.getSource(uri);
329348
const target = source.tokenAt(position);
330349

@@ -373,6 +392,11 @@ export default class QLangServer {
373392
textDocument: { uri },
374393
position,
375394
}: TextDocumentPositionParams) {
395+
this.notify("onParameterCache", MessageKind.DEBUG, {
396+
logger,
397+
telemetry: "Language.ParameterCache",
398+
});
399+
376400
const source = await this.getSource(uri);
377401
const target = source.tokenAt(position);
378402
if (!target) {
@@ -427,6 +451,11 @@ export default class QLangServer {
427451
public async onFoldingRanges({
428452
textDocument: { uri },
429453
}: FoldingRangeParams): Promise<FoldingRange[]> {
454+
this.notify("onFoldingRanges", MessageKind.DEBUG, {
455+
logger,
456+
telemetry: "Language.FoldingRanges",
457+
});
458+
430459
const source = await this.getSource(uri);
431460
const ranges: FoldingRange[] = [];
432461

@@ -486,6 +515,11 @@ export default class QLangServer {
486515
textDocument: { uri },
487516
position,
488517
}: CallHierarchyPrepareParams): Promise<CallHierarchyItem[]> {
518+
this.notify("onCallHierarchy", MessageKind.DEBUG, {
519+
logger,
520+
telemetry: "Language.CallHierarchy",
521+
});
522+
489523
const source = await this.getSource(uri);
490524
const target = source.tokenAt(position);
491525

src/classes/insightsConnection.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,6 @@ export class InsightsConnection {
519519
params: DataSourceFiles,
520520
silent?: boolean,
521521
): Promise<void> {
522-
let dsTypeString = "";
523522
if (this.connected && this.connEndpoints) {
524523
let coreUrl: string;
525524
const body: any = {
@@ -534,13 +533,11 @@ export class InsightsConnection {
534533
endTS: convertTimeToTimestamp(params.dataSource.api.endTS),
535534
};
536535
coreUrl = this.connEndpoints.scratchpad.import;
537-
dsTypeString = "API";
538536
break;
539537
}
540538
case DataSourceTypes.SQL: {
541539
body.params = { query: params.dataSource.sql.query };
542540
coreUrl = this.connEndpoints.scratchpad.importSql;
543-
dsTypeString = "SQL";
544541
break;
545542
}
546543
case DataSourceTypes.QSQL: {
@@ -551,7 +548,6 @@ export class InsightsConnection {
551548
);
552549

553550
coreUrl = this.connEndpoints.scratchpad.importQsql;
554-
dsTypeString = "QSQL";
555551
break;
556552
}
557553
case DataSourceTypes.UDA: {
@@ -606,8 +602,6 @@ export class InsightsConnection {
606602
{
607603
logger,
608604
params: { status: response.status },
609-
telemetry:
610-
"Datasource." + dsTypeString + ".Scratchpad.Populated.Errored",
611605
},
612606
);
613607
} else {
@@ -617,7 +611,6 @@ export class InsightsConnection {
617611
{
618612
logger,
619613
params: { status: response.status },
620-
telemetry: "Datasource." + dsTypeString + ".Scratchpad.Populated",
621614
},
622615
);
623616
}
@@ -833,7 +826,7 @@ export class InsightsConnection {
833826
notify(
834827
`Scratchpad reset for ${this.connLabel} executed successfully.`,
835828
MessageKind.INFO,
836-
{ logger, telemetry: "Scratchpad.Reseted" },
829+
{ logger, telemetry: "Connection.Reset.ie.sp" },
837830
);
838831
return true;
839832
})

src/commands/dataSourceCommand.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export async function addDataSource(): Promise<void> {
7777
notify(
7878
`Created ${fileName} in ${kdbDataSourcesFolderPath}.`,
7979
MessageKind.INFO,
80-
{ logger, telemetry: "Datasource.Created" },
80+
{ logger },
8181
);
8282
}
8383

@@ -159,7 +159,6 @@ export async function runDataSource(
159159

160160
notify(`Running ${fileContent.name} datasource...`, MessageKind.DEBUG, {
161161
logger,
162-
telemetry: "Datasource." + selectedType + ".Run",
163162
});
164163

165164
const isNotebook = executorName.endsWith(".kxnb");
@@ -197,7 +196,6 @@ export async function runDataSource(
197196
notify("Query execution failed.", MessageKind.DEBUG, {
198197
logger,
199198
params: res.error,
200-
telemetry: "Datasource." + selectedType + ".Run.Error",
201199
});
202200
}
203201
if (isNotebook || ext.isResultsTabVisible) {

0 commit comments

Comments
 (0)