Skip to content

Commit

Permalink
build stats - send one object with size and count properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Sep 6, 2018
1 parent 554eb6e commit 9c3d240
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions build/lib/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ function submitAllStats(productJson) {
return Promise.resolve();
}
return new Promise(function (resolve) {
var measurements = Object.create(null);
var properties = { size: {}, count: {} };
for (var _i = 0, sorted_2 = sorted; _i < sorted_2.length; _i++) {
var entry = sorted_2[_i];
measurements["size:" + entry.name] = entry.totalSize;
measurements["count:" + entry.name] = entry.totalCount;
properties.size[entry.name] = entry.totalSize;
properties.count[entry.name] = entry.totalCount;
}
appInsights.setup(productJson.aiConfig.asimovKey)
.setAutoCollectConsole(false)
Expand All @@ -109,11 +109,11 @@ function submitAllStats(productJson) {
client.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1';
/* __GDPR__
"monacoworkbench/packagemetrics" : {
"size:???" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }
"count:???" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }
"size" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }
"count" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }
}
*/
client.trackEvent("monacoworkbench/packagemetrics", undefined, measurements);
client.trackEvent("monacoworkbench/packagemetrics", properties);
client.sendPendingData(function () { return resolve(); });
});
}
Expand Down
12 changes: 6 additions & 6 deletions build/lib/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ export function submitAllStats(productJson: any): Promise<void> {

return new Promise(resolve => {

const measurements = Object.create(null);
const properties = { size: {}, count: {} };
for (const entry of sorted) {
measurements[`size:${entry.name}`] = entry.totalSize;
measurements[`count:${entry.name}`] = entry.totalCount;
properties.size[entry.name] = entry.totalSize;
properties.count[entry.name] = entry.totalCount;
}

appInsights.setup(productJson.aiConfig.asimovKey)
Expand All @@ -116,11 +116,11 @@ export function submitAllStats(productJson: any): Promise<void> {

/* __GDPR__
"monacoworkbench/packagemetrics" : {
"size:???" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }
"count:???" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }
"size" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }
"count" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }
}
*/
client.trackEvent(`monacoworkbench/packagemetrics`, undefined, measurements);
client.trackEvent(`monacoworkbench/packagemetrics`, properties);
client.sendPendingData(() => resolve());
});

Expand Down

0 comments on commit 9c3d240

Please sign in to comment.