Skip to content

Commit

Permalink
telemetry for cound of open IWs (#13282)
Browse files Browse the repository at this point in the history
* telemetry for cound of open IWs

* generate telemetry
  • Loading branch information
amunger authored Apr 5, 2023
1 parent 680b2e0 commit 7e214aa
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/gdpr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,7 @@
"hasOwner": {"classification":"SystemMetaData","purpose":"FeatureInsight","comment":"If the window was created for a text file","owner":"amunger"},
"mode": {"classification":"SystemMetaData","purpose":"FeatureInsight","comment":"Creation mode: multiple, perfile or single","owner":"amunger"},
"restored": {"classification":"SystemMetaData","purpose":"FeatureInsight","comment":"Was the window restored from a previous session","owner":"amunger"},
"windowCount": {"classification":"SystemMetaData","purpose":"FeatureInsight","comment":"Number of active interactive windows the user has open","owner":"amunger","isMeasurement":true},
"${include}": [
"${F1}"
Expand Down
33 changes: 21 additions & 12 deletions src/interactive-window/interactiveWindowProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,18 @@ export class InteractiveWindowProvider
tab,
Uri.parse(iw.inputBoxUriString)
);
sendTelemetryEvent(Telemetry.CreateInteractiveWindow, undefined, {
hasKernel: false,
hasOwner: !!iw.owner,
mode: mode,
restored: true
});

this._windows.push(result);
sendTelemetryEvent(
Telemetry.CreateInteractiveWindow,
{ windowCount: this._windows.length },
{
hasKernel: false,
hasOwner: !!iw.owner,
mode: mode,
restored: true
}
);

const handler = result.closed(this.onInteractiveWindowClosed.bind(this, result));
this.disposables.push(result);
Expand Down Expand Up @@ -219,13 +224,17 @@ export class InteractiveWindowProvider
editor,
inputUri
);
sendTelemetryEvent(Telemetry.CreateInteractiveWindow, undefined, {
hasKernel: !!initialController,
hasOwner: !!resource,
mode: mode,
restored: false
});
this._windows.push(result);
sendTelemetryEvent(
Telemetry.CreateInteractiveWindow,
{ windowCount: this._windows.length },
{
hasKernel: !!initialController,
hasOwner: !!resource,
mode: mode,
restored: false
}
);
this._updateWindowCache();

// This is the last interactive window at the moment (as we're about to create it)
Expand Down
9 changes: 9 additions & 0 deletions src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2301,6 +2301,7 @@ export class IEventNamePropertyMapping {
hasOwner: boolean;
mode: string;
restored: boolean;
windowCount: number;
}> = {
owner: 'amunger',
feature: ['InteractiveWindow'],
Expand All @@ -2326,6 +2327,14 @@ export class IEventNamePropertyMapping {
purpose: 'FeatureInsight',
comment: 'Was the window restored from a previous session'
}
},
measures: {
windowCount: {
classification: 'SystemMetaData',
purpose: 'FeatureInsight',
comment: 'Number of active interactive windows the user has open',
isMeasurement: true
}
}
};
/**
Expand Down

0 comments on commit 7e214aa

Please sign in to comment.