Skip to content

Commit 2fd61bf

Browse files
authored
chore(telemetry): track the view used to run queries (#6839)
* chore(telemetry): track the view used to run queries * fix tests
1 parent 79719d5 commit 2fd61bf

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

packages/compass-crud/src/stores/crud-store.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,6 +1595,7 @@ class CrudStoreImpl
15951595
? 'readonly'
15961596
: 'collection',
15971597
used_regex: objectContainsRegularExpression(query.filter ?? {}),
1598+
mode: this.modeForTelemetry(),
15981599
},
15991600
this.connectionInfoRef.current
16001601
);

packages/compass-e2e-tests/tests/collection-documents-tab.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ describe('Collection documents tab', function () {
179179
has_projection: false,
180180
has_skip: false,
181181
has_sort: false,
182+
mode: 'list',
182183
used_regex: false,
183184
});
184185

@@ -218,6 +219,7 @@ describe('Collection documents tab', function () {
218219
has_projection: true,
219220
has_sort: true,
220221
has_skip: true,
222+
mode: 'list',
221223
used_regex: false,
222224
});
223225

packages/compass-telemetry/src/telemetry-events.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1699,6 +1699,11 @@ type QueryExecutedEvent = ConnectionScopedEvent<{
16991699
* Indicates whether the query used a regular expression.
17001700
*/
17011701
used_regex: boolean;
1702+
1703+
/**
1704+
* The view used to run the query.
1705+
*/
1706+
mode: 'list' | 'json' | 'table';
17021707
};
17031708
}>;
17041709

@@ -2313,7 +2318,7 @@ type AutoupdateDismissedEvent = CommonEvent<{
23132318
}>;
23142319

23152320
/**
2316-
* This event is fired when the user changes the items view type between list and grid.
2321+
* This event is fired when the user changes the items view type in the database and collection list between "list" and "grid".
23172322
*
23182323
* @category Database / Collection List
23192324
*/

0 commit comments

Comments
 (0)