Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit b4cdb7a

Browse files
committed
Updated telemetry
1 parent 036718d commit b4cdb7a

File tree

6 files changed

+23
-16
lines changed

6 files changed

+23
-16
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ dist
66
.DS_Store
77
**/.DS_Store
88
test/assets/extracted/
9+
dist_gh_action/package.json
910

ado-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifestVersion": 1,
33
"id": "android-app-size-diff-utils",
44
"name": "Android app size changes",
5-
"version": "0.0.28",
5+
"version": "0.0.29",
66
"publisher": "PraveenPendyala",
77
"targets": [
88
{

dist_gh_action/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "android-app-size-diff",
3-
"version": "0.0.28",
3+
"version": "0.0.29",
44
"description": "Azure DevOps task to measure the size in Android app size by looking at 2 given APKs and AABs",
55
"main": "index.js",
66
"scripts": {

src/apkAnalyzer/CiRunner.ts

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,34 +63,40 @@ export default class CiRunner {
6363
ciName: this.ciCore.getCiName()
6464
}
6565
this.telemetryClient.trackEvent({
66-
name: 'AppStart',
66+
name: 'RunStarted',
6767
properties: telemetryProperties
6868
});
6969

7070
var result: any;
7171
try {
7272
result = await this.run();
73+
74+
// Send success telemetry
75+
const endTime = new Date().getTime();
76+
const elapsedTime = endTime - startTime;
77+
this.telemetryClient.trackEvent({
78+
name: 'RunSuccess',
79+
measurements: {
80+
duration: elapsedTime
81+
},
82+
properties: telemetryProperties
83+
});
7384
} catch (err) {
7485
// Send error telemetry
86+
this.telemetryClient.trackEvent({
87+
name: 'RunFailed',
88+
properties: telemetryProperties
89+
});
7590
this.telemetryClient.trackException({
7691
exception: err,
7792
properties: telemetryProperties
7893
});
79-
this.telemetryClient.flush()
8094

8195
throw err;
96+
} finally {
97+
this.telemetryClient.flush();
8298
}
8399

84-
// Send performance telemetry
85-
const endTime = new Date().getTime();
86-
const elapsedTime = endTime - startTime;
87-
this.telemetryClient.trackMetric({
88-
name: 'RunPerformance',
89-
value: elapsedTime,
90-
properties: telemetryProperties
91-
});
92-
this.telemetryClient.flush()
93-
94100
return result;
95101
}
96102

src/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"version": {
1111
"Major": 0,
1212
"Minor": 0,
13-
"Patch": 28
13+
"Patch": 29
1414
},
1515
"instanceNameFormat": "Android App size change - $(baseAppPath) vs $(targetAppPath)",
1616
"inputs": [

0 commit comments

Comments
 (0)