Skip to content

Commit

Permalink
Capture additional telemetry for conda (#23810)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne authored Jul 15, 2024
1 parent e5f8539 commit 2a6608c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export interface NativeEnvManagerInfo {

export type NativeCondaInfo = {
canSpawnConda: boolean;
userProvidedEnvFound?: boolean;
condaRcs: string[];
envDirs: string[];
environmentsTxt?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ export class EnvsCollectionService extends PythonEnvsWatcher<PythonEnvCollection
condaDefaultPrefixInCondaExePath?: boolean;
canSpawnConda?: boolean;
nativeCanSpawnConda?: boolean;
userProvidedEnvFound?: boolean;
userProvidedCondaExe?: boolean;
condaInfoEnvsInvalid: number;
invalidCondaEnvs: number;
Expand Down Expand Up @@ -418,6 +419,7 @@ export class EnvsCollectionService extends PythonEnvsWatcher<PythonEnvCollection
condaTelemetry.nativeCanSpawnConda = nativeCondaInfo.canSpawnConda;
condaTelemetry.nativeCondaInfoEnvsDirs = new Set(nativeCondaInfo.envDirs).size;
condaTelemetry.nativeCondaRcs = new Set(nativeCondaInfo.condaRcs).size;
condaTelemetry.userProvidedEnvFound = nativeCondaInfo.userProvidedEnvFound;

const nativeEnvTxt = fsPath.normalize(nativeCondaInfo.environmentsTxt || '').toLowerCase();
condaTelemetry.nativeCondaEnvTxtExists = nativeCondaInfo.environmentsTxtExists === true;
Expand Down
8 changes: 7 additions & 1 deletion src/client/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,8 @@ export interface IEventNamePropertyMapping {
"environmentsWithoutPython" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "donjayamanne" },
"usingNativeLocator" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
"canSpawnConda" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
"nativeCanSpawnConda" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true , "owner": "donjayamanne"},
"nativeCanSpawnConda" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne"},
"userProvidedEnvFound" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
"condaRootPrefixFoundInInfoNotInNative" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
"condaRootPrefixInCondaExePath" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
"condaDefaultPrefixFoundInInfoNotInNative" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
Expand Down Expand Up @@ -1350,6 +1351,11 @@ export interface IEventNamePropertyMapping {
* Conda exe can be spawned by native locator.
*/
nativeCanSpawnConda?: boolean;
/**
* Conda env belonging to the conda exe provided by the user is found by native locator.
* I.e. even if the user didn't provide the path to the conda exe, the conda env is found by native locator.
*/
userProvidedEnvFound?: boolean;
/**
* The number of the interpreters not found in disc.
*/
Expand Down

0 comments on commit 2a6608c

Please sign in to comment.