Skip to content

Commit

Permalink
Add more data for conda envs not found (#23770)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne authored Jul 8, 2024
1 parent 5470d60 commit d8ae575
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,34 @@ export type NativePythonTelemetry = MissingCondaEnvironments;
export type MissingCondaEnvironments = {
event: 'MissingCondaEnvironments';
data: {
missing: number;
userProvidedCondaExe?: boolean;
rootPrefixNotFound?: boolean;
condaPrefixNotFound?: boolean;
condaManagerNotFound?: boolean;
sysRcNotFound?: boolean;
userRcNotFound?: boolean;
otherRcNotFound?: boolean;
missingEnvDirsFromSysRc?: number;
missingEnvDirsFromUserRc?: number;
missingEnvDirsFromOtherRc?: number;
missingFromSysRcEnvDirs?: number;
missingFromUserRcEnvDirs?: number;
missingFromOtherRcEnvDirs?: number;
missingCondaEnvironments: {
missing: number;
envDirsNotFound?: number;
userProvidedCondaExe?: boolean;
rootPrefixNotFound?: boolean;
condaPrefixNotFound?: boolean;
condaManagerNotFound?: boolean;
sysRcNotFound?: boolean;
userRcNotFound?: boolean;
otherRcNotFound?: boolean;
missingEnvDirsFromSysRc?: number;
missingEnvDirsFromUserRc?: number;
missingEnvDirsFromOtherRc?: number;
missingFromSysRcEnvDirs?: number;
missingFromUserRcEnvDirs?: number;
missingFromOtherRcEnvDirs?: number;
};
};
};

export function sendNativeTelemetry(data: NativePythonTelemetry): void {
switch (data.event) {
case 'MissingCondaEnvironments': {
sendTelemetryEvent(EventName.NATIVE_FINDER_MISSING_CONDA_ENVS, undefined, data.data);
sendTelemetryEvent(
EventName.NATIVE_FINDER_MISSING_CONDA_ENVS,
undefined,
data.data.missingCondaEnvironments,
);
break;
}
default: {
Expand Down
43 changes: 43 additions & 0 deletions src/client/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,7 @@ export interface IEventNamePropertyMapping {
/* __GDPR__
"native_finder_missing_conda_envs" : {
"missing" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "donjayamanne" },
"envDirsNotFound" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true, "owner": "donjayamanne" },
"userProvidedCondaExe" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
"rootPrefixNotFound" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
"condaPrefixNotFound" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "owner": "donjayamanne" },
Expand All @@ -1419,21 +1420,63 @@ export interface IEventNamePropertyMapping {
* Number of missing conda environments.
*/
missing: number;
/**
* Total number of env_dirs not found even after parsing the conda_rc files.
* This will tell us that we are either unable to parse some of the conda_rc files or there are other
* env_dirs that we are not able to find.
*/
envDirsNotFound?: number;
/**
* Whether a conda exe was provided by the user.
*/
userProvidedCondaExe?: boolean;
/**
* Whether the user provided a conda executable.
*/
rootPrefixNotFound?: boolean;
/**
* Whether the conda prefix returned by conda was not found by us.
*/
condaPrefixNotFound?: boolean;
/**
* Whether we found a conda manager or not.
*/
condaManagerNotFound?: boolean;
/**
* Whether we failed to find the system rc path.
*/
sysRcNotFound?: boolean;
/**
* Whether we failed to find the user rc path.
*/
userRcNotFound?: boolean;
/**
* Number of config files (excluding sys and user rc) that were not found.
*/
otherRcNotFound?: boolean;
/**
* Number of conda envs that were not found by us, and the envs belong to env_dirs in the sys config rc.
*/
missingEnvDirsFromSysRc?: number;
/**
* Number of conda envs that were not found by us, and the envs belong to env_dirs in the user config rc.
*/
missingEnvDirsFromUserRc?: number;
/**
* Number of conda envs that were not found by us, and the envs belong to env_dirs in the other config rc.
*/
missingEnvDirsFromOtherRc?: number;
/**
* Number of conda envs that were not found by us, and the envs belong to env_dirs in the sys config rc.
*/
missingFromSysRcEnvDirs?: number;
/**
* Number of conda envs that were not found by us, and the envs belong to env_dirs in the user config rc.
*/
missingFromUserRcEnvDirs?: number;
/**
* Number of conda envs that were not found by us, and the envs belong to env_dirs in the other config rc.
*/
missingFromOtherRcEnvDirs?: number;
};
/**
Expand Down

0 comments on commit d8ae575

Please sign in to comment.