Skip to content

Commit 2a6608c

Browse files
authored
Capture additional telemetry for conda (microsoft#23810)
1 parent e5f8539 commit 2a6608c

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/client/pythonEnvironments/base/locators/common/nativePythonFinder.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export interface NativeEnvManagerInfo {
4949

5050
export type NativeCondaInfo = {
5151
canSpawnConda: boolean;
52+
userProvidedEnvFound?: boolean;
5253
condaRcs: string[];
5354
envDirs: string[];
5455
environmentsTxt?: string;

src/client/pythonEnvironments/base/locators/composite/envsCollectionService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ export class EnvsCollectionService extends PythonEnvsWatcher<PythonEnvCollection
344344
condaDefaultPrefixInCondaExePath?: boolean;
345345
canSpawnConda?: boolean;
346346
nativeCanSpawnConda?: boolean;
347+
userProvidedEnvFound?: boolean;
347348
userProvidedCondaExe?: boolean;
348349
condaInfoEnvsInvalid: number;
349350
invalidCondaEnvs: number;
@@ -418,6 +419,7 @@ export class EnvsCollectionService extends PythonEnvsWatcher<PythonEnvCollection
418419
condaTelemetry.nativeCanSpawnConda = nativeCondaInfo.canSpawnConda;
419420
condaTelemetry.nativeCondaInfoEnvsDirs = new Set(nativeCondaInfo.envDirs).size;
420421
condaTelemetry.nativeCondaRcs = new Set(nativeCondaInfo.condaRcs).size;
422+
condaTelemetry.userProvidedEnvFound = nativeCondaInfo.userProvidedEnvFound;
421423

422424
const nativeEnvTxt = fsPath.normalize(nativeCondaInfo.environmentsTxt || '').toLowerCase();
423425
condaTelemetry.nativeCondaEnvTxtExists = nativeCondaInfo.environmentsTxtExists === true;

src/client/telemetry/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,8 @@ export interface IEventNamePropertyMapping {
11651165
"environmentsWithoutPython" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "donjayamanne" },
11661166
"usingNativeLocator" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
11671167
"canSpawnConda" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
1168-
"nativeCanSpawnConda" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true , "owner": "donjayamanne"},
1168+
"nativeCanSpawnConda" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne"},
1169+
"userProvidedEnvFound" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
11691170
"condaRootPrefixFoundInInfoNotInNative" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
11701171
"condaRootPrefixInCondaExePath" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
11711172
"condaDefaultPrefixFoundInInfoNotInNative" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
@@ -1350,6 +1351,11 @@ export interface IEventNamePropertyMapping {
13501351
* Conda exe can be spawned by native locator.
13511352
*/
13521353
nativeCanSpawnConda?: boolean;
1354+
/**
1355+
* Conda env belonging to the conda exe provided by the user is found by native locator.
1356+
* I.e. even if the user didn't provide the path to the conda exe, the conda env is found by native locator.
1357+
*/
1358+
userProvidedEnvFound?: boolean;
13531359
/**
13541360
* The number of the interpreters not found in disc.
13551361
*/

0 commit comments

Comments
 (0)