Skip to content

Commit cdc8a9d

Browse files
authored
Telemetry events naming convention (#88)
* Renamed events and properties There is a convention for events (Title Case) and properties (snake_case). * Fixed some typos
1 parent 3b740fe commit cdc8a9d

File tree

4 files changed

+46
-46
lines changed

4 files changed

+46
-46
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://dev.azure.com/team-compass/vscode/_apis/build/status/mongodb-js.vscode?branchName=master)](https://dev.azure.com/team-compass/vscode/_build/latest?definitionId=6&branchName=master)
44

5-
MongoDB for VS Code makes it easy to work with MongoDB, whether your own instance or in [MongoDB Atlas](https://www.mongodb.com/cloud/atlas/register)
5+
MongoDB for VS Code makes it easy to work with MongoDB, whether your own instance or in [MongoDB Atlas](https://www.mongodb.com/cloud/atlas/register).
66

77
## Features
88

@@ -18,10 +18,10 @@ MongoDB for VS Code makes it easy to work with MongoDB, whether your own instanc
1818

1919
MongoDB Playgrounds are the most convenient way to prototype and execute CRUD operations and other MongoDB commands directly inside VS Code.
2020

21-
- Prototype your queries, aggregations and MongoDB commands with MongoDB syntax highlighting and intelligent autcomplete for MongoDB shell API, MongoDB operators, and for database, collection, and field names.
21+
- Prototype your queries, aggregations, and MongoDB commands with MongoDB syntax highlighting and intelligent autocomplete for MongoDB shell API, MongoDB operators, and for database, collection, and field names.
2222
- Run your playgrounds and see the results instantly
2323
- Save your playgrounds in your workspace and use them to document how your application interacts with MongoDB
24-
- Build aggregations quickly with helpful and well commented stage snippets
24+
- Build aggregations quickly with helpful and well-commented stage snippets
2525

2626
![Playgrounds](resources/screenshots/playground.png)
2727

@@ -47,14 +47,14 @@ If you use Terraform to manage your infrastructure, MongoDB for VS Code helps yo
4747
- `mdb.confirmRunAll`: Show a confirmation message before running commands in a playground.
4848
- `mdb.connectionSaving.hideOptionToChooseWhereToSaveNewConnections`: When a connection is added, a prompt is shown that let's the user decide where the new connection should be saved. When this setting is checked, the prompt is not shown and the default connection saving location setting is used.
4949
- `mdb.connectionSaving.defaultConnectionSavingLocation`: When the setting that hides the option to choose where to save new connections is checked, this setting sets if and where new connections are saved.
50-
- `mdb.useDefaultTemplateForPlayground`: Choose wether to use default template for playground files or to start with an empty playground editor.
50+
- `mdb.useDefaultTemplateForPlayground`: Choose whether to use the default template for playground files or to start with an empty playground editor.
5151
- `mdb.sendTelemetry`: Opt-in and opt-out for diagnostic and telemetry collection.
5252

5353
![Settings](resources/screenshots/settings.png)
5454

5555
## Additional Settings
5656

57-
*These global settings affect how MongoDB for VS Code provide intelligent autocomplete inside snippets and string literals (off by default). Changing the default configuration may affect the behavior and performance of other extensions and of VS Code itself. If you do not change the default settings, you can still trigger intelligent autcomplete inside a snippet or string literal with `Ctrl+Space`.*
57+
*These global settings affect how MongoDB for VS Code provides intelligent autocomplete inside snippets and string literals (off by default). Changing the default configuration may affect the behavior and performance of other extensions and of VS Code itself. If you do not change the default settings, you can still trigger intelligent autocomplete inside a snippet or string literal with `Ctrl+Space`.*
5858

5959
- `editor.suggest.snippetsPreventQuickSuggestions`: By default, VS Code prevents code completion in snippet mode (editing placeholders in inserted code). Setting this to `false` allows snippet (eg. `$match`, `$addFields`) and field completion based on the document schema for the `db.collection.aggregate()` expressions.
6060
- `editor.quickSuggestions`: By default, VS Code prevents code completion inside string literals. To enable database names completions for `use('dbName')` expression use this configuration:

src/connectionController.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -354,22 +354,22 @@ export default class ConnectionController {
354354
? null
355355
: data.genuineMongoDB.dbType;
356356
const telemetryData = {
357-
isAtlas: !!data.client.s.url.match(ATLAS_REGEX),
358-
isLocalhost: !!data.client.s.url.match(LOCALHOST_REGEX),
359-
isDataLake: data.dataLake.isDataLake,
360-
isEnterprise: data.build.enterprise_module,
361-
isPublicCloud: cloudInfo.isPublicCloud,
362-
publicCloudName: cloudInfo.publicCloudName,
363-
isGenuine: data.genuineMongoDB.isGenuine,
364-
nonGenuineServerName,
365-
serverVersion: data.build.version,
366-
serverArch: data.build.raw.buildEnvironment.target_arch,
367-
serverOS: data.build.raw.buildEnvironment.target_os,
368-
isUsedConnectScreen:
357+
is_atlas: !!data.client.s.url.match(ATLAS_REGEX),
358+
is_localhost: !!data.client.s.url.match(LOCALHOST_REGEX),
359+
is_data_lake: data.dataLake.isDataLake,
360+
is_enterprise: data.build.enterprise_module,
361+
is_public_cloud: cloudInfo.isPublicCloud,
362+
public_cloud_name: cloudInfo.publicCloudName,
363+
is_genuine: data.genuineMongoDB.isGenuine,
364+
non_genuine_server_name: nonGenuineServerName,
365+
server_version: data.build.version,
366+
server_arch: data.build.raw.buildEnvironment.target_arch,
367+
server_os: data.build.raw.buildEnvironment.target_os,
368+
is_used_connect_screen:
369369
connectionType === ConnectionTypes.CONNECTION_FORM,
370-
isUsedCommandPalette:
370+
is_used_command_palette:
371371
connectionType === ConnectionTypes.CONNECTION_STRING,
372-
isUsedSavedConnection:
372+
is_used_saved_connection:
373373
connectionType === ConnectionTypes.CONNECTION_ID
374374
};
375375

@@ -659,13 +659,13 @@ export default class ConnectionController {
659659
const connectionNameToRemove:
660660
| string
661661
| undefined = await vscode.window.showQuickPick(
662-
connectionIds.map(
663-
(id, index) => `${index + 1}: ${this._connections[id].name}`
664-
),
665-
{
666-
placeHolder: 'Choose a connection to remove...'
667-
}
668-
);
662+
connectionIds.map(
663+
(id, index) => `${index + 1}: ${this._connections[id].name}`
664+
),
665+
{
666+
placeHolder: 'Choose a connection to remove...'
667+
}
668+
);
669669

670670
if (!connectionNameToRemove) {
671671
return Promise.resolve(false);

src/telemetry/telemetryController.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,28 @@ type PlaygroundTelemetryEventProperties = {
1414

1515
type LinkClickedTelemetryEventProperties = {
1616
screen: string;
17-
linkId: string;
17+
link_id: string;
1818
};
1919

2020
type ExtensionCommandRunTelemetryEventProperties = {
2121
command: string;
2222
};
2323

2424
type NewConnectionTelemetryEventProperties = {
25-
isAtlas: boolean;
26-
isLocalhost: boolean;
27-
isDataLake: boolean;
28-
isEnterprise: boolean;
29-
isPublicCloud: boolean;
30-
publicCloudName: string | null;
31-
isGenuine: boolean;
32-
nonGenuineServerName: string | null;
33-
serverVersion: string;
34-
serverArch: string;
35-
serverOS: string;
36-
isUsedConnectScreen: boolean;
37-
isUsedCommandPalette: boolean;
38-
isUsedSavedConnection: boolean;
25+
is_atlas: boolean;
26+
is_localhost: boolean;
27+
is_data_lake: boolean;
28+
is_enterprise: boolean;
29+
is_public_cloud: boolean;
30+
public_cloud_name: string | null;
31+
is_genuine: boolean;
32+
non_genuine_server_name: string | null;
33+
server_version: string;
34+
server_arch: string;
35+
server_os: string;
36+
is_used_connect_screen: boolean;
37+
is_used_command_palette: boolean;
38+
is_used_saved_connection: boolean;
3939
};
4040

4141
export type TelemetryEventProperties =
@@ -45,10 +45,10 @@ export type TelemetryEventProperties =
4545
| NewConnectionTelemetryEventProperties;
4646

4747
export enum TelemetryEventTypes {
48-
PLAYGROUND_CODE_EXECUTED = 'playground code executed',
49-
EXTENSION_LINK_CLICKED = 'link clicked',
50-
EXTENSION_COMMAND_RUN = 'command run',
51-
NEW_CONNECTION = 'new connection'
48+
PLAYGROUND_CODE_EXECUTED = 'Playground Code Executed',
49+
EXTENSION_LINK_CLICKED = 'Link Clicked',
50+
EXTENSION_COMMAND_RUN = 'Command Run',
51+
NEW_CONNECTION = 'New Connection'
5252
}
5353

5454
/**

src/views/webviewController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export default class WebviewController {
128128
TelemetryEventTypes.EXTENSION_LINK_CLICKED,
129129
{
130130
screen: message.screen,
131-
linkId: message.linkId
131+
link_id: message.linkId
132132
}
133133
);
134134

0 commit comments

Comments
 (0)