Skip to content

Commit

Permalink
Fix usage stats fields
Browse files Browse the repository at this point in the history
The way these were declared in Typescript caused the generated
telemetry schema JSON to be malformed.
  • Loading branch information
jportner committed Dec 2, 2020
1 parent 07cb882 commit 787ee5e
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 99 deletions.
34 changes: 17 additions & 17 deletions src/core/server/core_usage_data/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ import { ISavedObjectTypeRegistry, SavedObjectTypeRegistry } from '..';
* includes point-in-time configuration information.
* */
export interface CoreUsageStats {
['apiCalls.savedObjectsImport.total']?: number;
['apiCalls.savedObjectsImport.kibanaRequest.yes']?: number;
['apiCalls.savedObjectsImport.kibanaRequest.no']?: number;
['apiCalls.savedObjectsImport.createNewCopiesEnabled.yes']?: number;
['apiCalls.savedObjectsImport.createNewCopiesEnabled.no']?: number;
['apiCalls.savedObjectsImport.overwriteEnabled.yes']?: number;
['apiCalls.savedObjectsImport.overwriteEnabled.no']?: number;
['apiCalls.savedObjectsResolveImportErrors.total']?: number;
['apiCalls.savedObjectsResolveImportErrors.kibanaRequest.yes']?: number;
['apiCalls.savedObjectsResolveImportErrors.kibanaRequest.no']?: number;
['apiCalls.savedObjectsResolveImportErrors.createNewCopiesEnabled.yes']?: number;
['apiCalls.savedObjectsResolveImportErrors.createNewCopiesEnabled.no']?: number;
['apiCalls.savedObjectsExport.total']?: number;
['apiCalls.savedObjectsExport.kibanaRequest.yes']?: number;
['apiCalls.savedObjectsExport.kibanaRequest.no']?: number;
['apiCalls.savedObjectsExport.allTypesSelected.yes']?: number;
['apiCalls.savedObjectsExport.allTypesSelected.no']?: number;
'apiCalls.savedObjectsImport.total'?: number;
'apiCalls.savedObjectsImport.kibanaRequest.yes'?: number;
'apiCalls.savedObjectsImport.kibanaRequest.no'?: number;
'apiCalls.savedObjectsImport.createNewCopiesEnabled.yes'?: number;
'apiCalls.savedObjectsImport.createNewCopiesEnabled.no'?: number;
'apiCalls.savedObjectsImport.overwriteEnabled.yes'?: number;
'apiCalls.savedObjectsImport.overwriteEnabled.no'?: number;
'apiCalls.savedObjectsResolveImportErrors.total'?: number;
'apiCalls.savedObjectsResolveImportErrors.kibanaRequest.yes'?: number;
'apiCalls.savedObjectsResolveImportErrors.kibanaRequest.no'?: number;
'apiCalls.savedObjectsResolveImportErrors.createNewCopiesEnabled.yes'?: number;
'apiCalls.savedObjectsResolveImportErrors.createNewCopiesEnabled.no'?: number;
'apiCalls.savedObjectsExport.total'?: number;
'apiCalls.savedObjectsExport.kibanaRequest.yes'?: number;
'apiCalls.savedObjectsExport.kibanaRequest.no'?: number;
'apiCalls.savedObjectsExport.allTypesSelected.yes'?: number;
'apiCalls.savedObjectsExport.allTypesSelected.no'?: number;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,23 @@ export function getCoreUsageCollector(
},
},
},
['apiCalls.savedObjectsImport.total']: { type: 'long' },
['apiCalls.savedObjectsImport.kibanaRequest.yes']: { type: 'long' },
['apiCalls.savedObjectsImport.kibanaRequest.no']: { type: 'long' },
['apiCalls.savedObjectsImport.createNewCopiesEnabled.yes']: { type: 'long' },
['apiCalls.savedObjectsImport.createNewCopiesEnabled.no']: { type: 'long' },
['apiCalls.savedObjectsImport.overwriteEnabled.yes']: { type: 'long' },
['apiCalls.savedObjectsImport.overwriteEnabled.no']: { type: 'long' },
['apiCalls.savedObjectsResolveImportErrors.total']: { type: 'long' },
['apiCalls.savedObjectsResolveImportErrors.kibanaRequest.yes']: { type: 'long' },
['apiCalls.savedObjectsResolveImportErrors.kibanaRequest.no']: { type: 'long' },
['apiCalls.savedObjectsResolveImportErrors.createNewCopiesEnabled.yes']: { type: 'long' },
['apiCalls.savedObjectsResolveImportErrors.createNewCopiesEnabled.no']: { type: 'long' },
['apiCalls.savedObjectsExport.total']: { type: 'long' },
['apiCalls.savedObjectsExport.kibanaRequest.yes']: { type: 'long' },
['apiCalls.savedObjectsExport.kibanaRequest.no']: { type: 'long' },
['apiCalls.savedObjectsExport.allTypesSelected.yes']: { type: 'long' },
['apiCalls.savedObjectsExport.allTypesSelected.no']: { type: 'long' },
'apiCalls.savedObjectsImport.total': { type: 'long' },
'apiCalls.savedObjectsImport.kibanaRequest.yes': { type: 'long' },
'apiCalls.savedObjectsImport.kibanaRequest.no': { type: 'long' },
'apiCalls.savedObjectsImport.createNewCopiesEnabled.yes': { type: 'long' },
'apiCalls.savedObjectsImport.createNewCopiesEnabled.no': { type: 'long' },
'apiCalls.savedObjectsImport.overwriteEnabled.yes': { type: 'long' },
'apiCalls.savedObjectsImport.overwriteEnabled.no': { type: 'long' },
'apiCalls.savedObjectsResolveImportErrors.total': { type: 'long' },
'apiCalls.savedObjectsResolveImportErrors.kibanaRequest.yes': { type: 'long' },
'apiCalls.savedObjectsResolveImportErrors.kibanaRequest.no': { type: 'long' },
'apiCalls.savedObjectsResolveImportErrors.createNewCopiesEnabled.yes': { type: 'long' },
'apiCalls.savedObjectsResolveImportErrors.createNewCopiesEnabled.no': { type: 'long' },
'apiCalls.savedObjectsExport.total': { type: 'long' },
'apiCalls.savedObjectsExport.kibanaRequest.yes': { type: 'long' },
'apiCalls.savedObjectsExport.kibanaRequest.no': { type: 'long' },
'apiCalls.savedObjectsExport.allTypesSelected.yes': { type: 'long' },
'apiCalls.savedObjectsExport.allTypesSelected.no': { type: 'long' },
},
fetch() {
return getCoreUsageDataService().getCoreUsageData();
Expand Down
34 changes: 17 additions & 17 deletions src/plugins/telemetry/schema/oss_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -1517,55 +1517,55 @@
}
}
},
"[apiCalls.savedObjectsImport.total]": {
"apiCalls.savedObjectsImport.total": {
"type": "long"
},
"[apiCalls.savedObjectsImport.kibanaRequest.yes]": {
"apiCalls.savedObjectsImport.kibanaRequest.yes": {
"type": "long"
},
"[apiCalls.savedObjectsImport.kibanaRequest.no]": {
"apiCalls.savedObjectsImport.kibanaRequest.no": {
"type": "long"
},
"[apiCalls.savedObjectsImport.createNewCopiesEnabled.yes]": {
"apiCalls.savedObjectsImport.createNewCopiesEnabled.yes": {
"type": "long"
},
"[apiCalls.savedObjectsImport.createNewCopiesEnabled.no]": {
"apiCalls.savedObjectsImport.createNewCopiesEnabled.no": {
"type": "long"
},
"[apiCalls.savedObjectsImport.overwriteEnabled.yes]": {
"apiCalls.savedObjectsImport.overwriteEnabled.yes": {
"type": "long"
},
"[apiCalls.savedObjectsImport.overwriteEnabled.no]": {
"apiCalls.savedObjectsImport.overwriteEnabled.no": {
"type": "long"
},
"[apiCalls.savedObjectsResolveImportErrors.total]": {
"apiCalls.savedObjectsResolveImportErrors.total": {
"type": "long"
},
"[apiCalls.savedObjectsResolveImportErrors.kibanaRequest.yes]": {
"apiCalls.savedObjectsResolveImportErrors.kibanaRequest.yes": {
"type": "long"
},
"[apiCalls.savedObjectsResolveImportErrors.kibanaRequest.no]": {
"apiCalls.savedObjectsResolveImportErrors.kibanaRequest.no": {
"type": "long"
},
"[apiCalls.savedObjectsResolveImportErrors.createNewCopiesEnabled.yes]": {
"apiCalls.savedObjectsResolveImportErrors.createNewCopiesEnabled.yes": {
"type": "long"
},
"[apiCalls.savedObjectsResolveImportErrors.createNewCopiesEnabled.no]": {
"apiCalls.savedObjectsResolveImportErrors.createNewCopiesEnabled.no": {
"type": "long"
},
"[apiCalls.savedObjectsExport.total]": {
"apiCalls.savedObjectsExport.total": {
"type": "long"
},
"[apiCalls.savedObjectsExport.kibanaRequest.yes]": {
"apiCalls.savedObjectsExport.kibanaRequest.yes": {
"type": "long"
},
"[apiCalls.savedObjectsExport.kibanaRequest.no]": {
"apiCalls.savedObjectsExport.kibanaRequest.no": {
"type": "long"
},
"[apiCalls.savedObjectsExport.allTypesSelected.yes]": {
"apiCalls.savedObjectsExport.allTypesSelected.yes": {
"type": "long"
},
"[apiCalls.savedObjectsExport.allTypesSelected.no]": {
"apiCalls.savedObjectsExport.allTypesSelected.no": {
"type": "long"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ interface SetupOpts {
}

const MOCK_USAGE_STATS: UsageStats = {
['apiCalls.copySavedObjects.total']: 5,
['apiCalls.copySavedObjects.kibanaRequest.yes']: 5,
['apiCalls.copySavedObjects.kibanaRequest.no']: 0,
['apiCalls.copySavedObjects.createNewCopiesEnabled.yes']: 2,
['apiCalls.copySavedObjects.createNewCopiesEnabled.no']: 3,
['apiCalls.copySavedObjects.overwriteEnabled.yes']: 1,
['apiCalls.copySavedObjects.overwriteEnabled.no']: 4,
['apiCalls.resolveCopySavedObjectsErrors.total']: 13,
['apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.yes']: 13,
['apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.no']: 0,
['apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.yes']: 6,
['apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.no']: 7,
'apiCalls.copySavedObjects.total': 5,
'apiCalls.copySavedObjects.kibanaRequest.yes': 5,
'apiCalls.copySavedObjects.kibanaRequest.no': 0,
'apiCalls.copySavedObjects.createNewCopiesEnabled.yes': 2,
'apiCalls.copySavedObjects.createNewCopiesEnabled.no': 3,
'apiCalls.copySavedObjects.overwriteEnabled.yes': 1,
'apiCalls.copySavedObjects.overwriteEnabled.no': 4,
'apiCalls.resolveCopySavedObjectsErrors.total': 13,
'apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.yes': 13,
'apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.no': 0,
'apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.yes': 6,
'apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.no': 7,
};

function setup({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,18 @@ export function getSpacesUsageCollector(
available: { type: 'boolean' },
enabled: { type: 'boolean' },
count: { type: 'long' },
['apiCalls.copySavedObjects.total']: { type: 'long' },
['apiCalls.copySavedObjects.kibanaRequest.yes']: { type: 'long' },
['apiCalls.copySavedObjects.kibanaRequest.no']: { type: 'long' },
['apiCalls.copySavedObjects.createNewCopiesEnabled.yes']: { type: 'long' },
['apiCalls.copySavedObjects.createNewCopiesEnabled.no']: { type: 'long' },
['apiCalls.copySavedObjects.overwriteEnabled.yes']: { type: 'long' },
['apiCalls.copySavedObjects.overwriteEnabled.no']: { type: 'long' },
['apiCalls.resolveCopySavedObjectsErrors.total']: { type: 'long' },
['apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.yes']: { type: 'long' },
['apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.no']: { type: 'long' },
['apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.yes']: { type: 'long' },
['apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.no']: { type: 'long' },
'apiCalls.copySavedObjects.total': { type: 'long' },
'apiCalls.copySavedObjects.kibanaRequest.yes': { type: 'long' },
'apiCalls.copySavedObjects.kibanaRequest.no': { type: 'long' },
'apiCalls.copySavedObjects.createNewCopiesEnabled.yes': { type: 'long' },
'apiCalls.copySavedObjects.createNewCopiesEnabled.no': { type: 'long' },
'apiCalls.copySavedObjects.overwriteEnabled.yes': { type: 'long' },
'apiCalls.copySavedObjects.overwriteEnabled.no': { type: 'long' },
'apiCalls.resolveCopySavedObjectsErrors.total': { type: 'long' },
'apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.yes': { type: 'long' },
'apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.no': { type: 'long' },
'apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.yes': { type: 'long' },
'apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.no': { type: 'long' },
},
fetch: async ({ callCluster }: CollectorFetchContext) => {
const { licensing, kibanaIndexConfig$, features, usageStatsServicePromise } = deps;
Expand Down
24 changes: 12 additions & 12 deletions x-pack/plugins/spaces/server/usage_stats/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
*/

export interface UsageStats {
['apiCalls.copySavedObjects.total']?: number;
['apiCalls.copySavedObjects.kibanaRequest.yes']?: number;
['apiCalls.copySavedObjects.kibanaRequest.no']?: number;
['apiCalls.copySavedObjects.createNewCopiesEnabled.yes']?: number;
['apiCalls.copySavedObjects.createNewCopiesEnabled.no']?: number;
['apiCalls.copySavedObjects.overwriteEnabled.yes']?: number;
['apiCalls.copySavedObjects.overwriteEnabled.no']?: number;
['apiCalls.resolveCopySavedObjectsErrors.total']?: number;
['apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.yes']?: number;
['apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.no']?: number;
['apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.yes']?: number;
['apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.no']?: number;
'apiCalls.copySavedObjects.total'?: number;
'apiCalls.copySavedObjects.kibanaRequest.yes'?: number;
'apiCalls.copySavedObjects.kibanaRequest.no'?: number;
'apiCalls.copySavedObjects.createNewCopiesEnabled.yes'?: number;
'apiCalls.copySavedObjects.createNewCopiesEnabled.no'?: number;
'apiCalls.copySavedObjects.overwriteEnabled.yes'?: number;
'apiCalls.copySavedObjects.overwriteEnabled.no'?: number;
'apiCalls.resolveCopySavedObjectsErrors.total'?: number;
'apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.yes'?: number;
'apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.no'?: number;
'apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.yes'?: number;
'apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.no'?: number;
}
24 changes: 12 additions & 12 deletions x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -3382,40 +3382,40 @@
"count": {
"type": "long"
},
"[apiCalls.copySavedObjects.total]": {
"apiCalls.copySavedObjects.total": {
"type": "long"
},
"[apiCalls.copySavedObjects.kibanaRequest.yes]": {
"apiCalls.copySavedObjects.kibanaRequest.yes": {
"type": "long"
},
"[apiCalls.copySavedObjects.kibanaRequest.no]": {
"apiCalls.copySavedObjects.kibanaRequest.no": {
"type": "long"
},
"[apiCalls.copySavedObjects.createNewCopiesEnabled.yes]": {
"apiCalls.copySavedObjects.createNewCopiesEnabled.yes": {
"type": "long"
},
"[apiCalls.copySavedObjects.createNewCopiesEnabled.no]": {
"apiCalls.copySavedObjects.createNewCopiesEnabled.no": {
"type": "long"
},
"[apiCalls.copySavedObjects.overwriteEnabled.yes]": {
"apiCalls.copySavedObjects.overwriteEnabled.yes": {
"type": "long"
},
"[apiCalls.copySavedObjects.overwriteEnabled.no]": {
"apiCalls.copySavedObjects.overwriteEnabled.no": {
"type": "long"
},
"[apiCalls.resolveCopySavedObjectsErrors.total]": {
"apiCalls.resolveCopySavedObjectsErrors.total": {
"type": "long"
},
"[apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.yes]": {
"apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.yes": {
"type": "long"
},
"[apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.no]": {
"apiCalls.resolveCopySavedObjectsErrors.kibanaRequest.no": {
"type": "long"
},
"[apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.yes]": {
"apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.yes": {
"type": "long"
},
"[apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.no]": {
"apiCalls.resolveCopySavedObjectsErrors.createNewCopiesEnabled.no": {
"type": "long"
}
}
Expand Down

0 comments on commit 787ee5e

Please sign in to comment.