Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 499b4c1

Browse filesBrowse files
author
Kartik Raj
committed
Add first session telemtry
1 parent f7454cf commit 499b4c1
Copy full SHA for 499b4c1

File tree

Expand file treeCollapse file tree

4 files changed

+14
-1
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+14
-1
lines changed

‎src/client/common/persistentState.ts

Copy file name to clipboardExpand all lines: src/client/common/persistentState.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export class PersistentState<T> implements IPersistentState<T> {
108108
export const GLOBAL_PERSISTENT_KEYS_DEPRECATED = 'PYTHON_EXTENSION_GLOBAL_STORAGE_KEYS';
109109
export const WORKSPACE_PERSISTENT_KEYS_DEPRECATED = 'PYTHON_EXTENSION_WORKSPACE_STORAGE_KEYS';
110110

111-
const GLOBAL_PERSISTENT_KEYS = 'PYTHON_GLOBAL_STORAGE_KEYS';
111+
export const GLOBAL_PERSISTENT_KEYS = 'PYTHON_GLOBAL_STORAGE_KEYS';
112112
const WORKSPACE_PERSISTENT_KEYS = 'PYTHON_WORKSPACE_STORAGE_KEYS';
113113
type KeysStorageType = 'global' | 'workspace';
114114
export type KeysStorage = { key: string; defaultValue: unknown };

‎src/client/extension.ts

Copy file name to clipboardExpand all lines: src/client/extension.ts
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import { WorkspaceService } from './common/application/workspace';
4646
import { disposeAll } from './common/utils/resourceLifecycle';
4747
import { ProposedExtensionAPI } from './proposedApiTypes';
4848
import { buildProposedApi } from './proposedApi';
49+
import { GLOBAL_PERSISTENT_KEYS } from './common/persistentState';
4950

5051
durations.codeLoadingTime = stopWatch.elapsedTime;
5152

@@ -116,6 +117,8 @@ async function activateUnsafe(
116117
// activation starts here
117118

118119
// First we initialize.
120+
const isFirstSession = context.globalState.get(GLOBAL_PERSISTENT_KEYS, []).length === 0;
121+
console.log(isFirstSession);
119122
const ext = initializeGlobals(context);
120123
activatedServiceContainer = ext.legacyIOC.serviceContainer;
121124
// Note standard utils especially experiment and platform code are fundamental to the extension

‎src/client/telemetry/constants.ts

Copy file name to clipboardExpand all lines: src/client/telemetry/constants.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export enum EventName {
77
FORMAT_ON_TYPE = 'FORMAT.FORMAT_ON_TYPE',
88
EDITOR_LOAD = 'EDITOR.LOAD',
99
REPL = 'REPL',
10+
FIRST_SESSION = 'FIRST_SESSION',
1011
CREATE_NEW_FILE_COMMAND = 'CREATE_NEW_FILE_COMMAND',
1112
SELECT_INTERPRETER = 'SELECT_INTERPRETER',
1213
SELECT_INTERPRETER_ENTER_BUTTON = 'SELECT_INTERPRETER_ENTER_BUTTON',

‎src/client/telemetry/index.ts

Copy file name to clipboardExpand all lines: src/client/telemetry/index.ts
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,6 +1440,15 @@ export interface IEventNamePropertyMapping {
14401440
*/
14411441
selection: 'Yes' | 'Maybe later' | "Don't show again" | undefined;
14421442
};
1443+
/**
1444+
* Telemetry event sent in the very first session of the user. We check whether persistent cache is empty to figure out if it's the first session.
1445+
*/
1446+
/* __GDPR__
1447+
"first_session" : {
1448+
"duration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "karrtikr" }
1449+
}
1450+
*/
1451+
[EventName.FIRST_SESSION]: never | undefined;
14431452
/**
14441453
* Telemetry event sent when starting REPL
14451454
*/

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.