You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
In the generated `telemetry.gen.ts` for vscode toolkit, `MetricBase`
does not have various common fields. This adds friction when setting
these fields.
Solution:
- Update the generator to define `MetricBase.awsRegion`.
- Change the 'with normal input' test so that it uses the "types"
defined in `commonDefinitions.json`. This increases test coverage
while also reducing the boilerplate needed when adding a new field to
`MetricBase`.
Copy file name to clipboardExpand all lines: telemetry/definitions/commonDefinitions.json
+16-1Lines changed: 16 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -127,6 +127,11 @@
127
127
],
128
128
"description": "Status of the an auth connection."
129
129
},
130
+
{
131
+
"name": "awsAccount",
132
+
"type": "string",
133
+
"description": "AWS account ID associated with a metric. \"n/a\" if credentials are not available. \"not-set\" if credentials are not selected. \"invalid\" if account ID cannot be obtained."
134
+
},
130
135
{
131
136
"name": "awsFiletype",
132
137
"type": "string",
@@ -147,6 +152,11 @@
147
152
],
148
153
"description": "AWS filetype kind"
149
154
},
155
+
{
156
+
"name": "awsRegion",
157
+
"type": "string",
158
+
"description": "AWS Region associated with a metric"
Copy file name to clipboardExpand all lines: telemetry/vscode/test/resources/generatorInput.json
+26-45Lines changed: 26 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -1,64 +1,45 @@
1
1
{
2
-
"types": [
3
-
{
4
-
"name": "lambdaRuntime",
5
-
"type": "string",
6
-
"allowedValues": ["dotnetcore2.1", "nodejs12.x"],
7
-
"description": "The lambda runtime"
8
-
},
9
-
{
10
-
"name": "result",
11
-
"allowedValues": ["Succeeded"],
12
-
"description": "The result of the operation"
13
-
},
14
-
{
15
-
"name": "reason",
16
-
"type": "string",
17
-
"description": "Reason code or name for an event (when result=Succeeded) or error (when result=Failed). Unlike the `reasonDesc` field, this should be a stable/predictable name for a class of events or errors (typically the exception name, e.g. FileIOException)."
18
-
},
19
-
{
20
-
"name": "reasonDesc",
21
-
"type": "string",
22
-
"description": "Error message detail. May contain arbitrary message details (unlike the `reason` field), but should be truncated (recommendation: 200 chars)."
23
-
},
24
-
{
25
-
"name": "duration",
26
-
"type": "double",
27
-
"description": "The duration of the operation in miliseconds"
28
-
},
29
-
{
30
-
"name": "inttype",
31
-
"description": "a test int type",
32
-
"type": "int"
33
-
},
34
-
{
35
-
"name": "booltype",
36
-
"description": "a test boolean type",
37
-
"type": "boolean"
38
-
},
39
-
{
40
-
"name": "arbitraryString",
41
-
"description": "untyped string type"
42
-
}
43
-
],
2
+
"types": "will be replaced with `types` from commonDefinitions.json",
44
3
"metrics": [
45
4
{
46
5
"name": "lambda_delete",
47
6
"description": "called when deleting lambdas remotely",
Copy file name to clipboardExpand all lines: telemetry/vscode/test/resources/testOverrideInput.json
+1-22Lines changed: 1 addition & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,5 @@
1
1
{
2
-
"types": [
3
-
{
4
-
"name": "result",
5
-
"allowedValues": ["Succeeded"],
6
-
"description": "The result of the operation"
7
-
},
8
-
{
9
-
"name": "reason",
10
-
"type": "string",
11
-
"description": "Reason code or name for an event (when result=Succeeded) or error (when result=Failed). Unlike the `reasonDesc` field, this should be a stable/predictable name for a class of events or errors (typically the exception name, e.g. FileIOException)."
12
-
},
13
-
{
14
-
"name": "reasonDesc",
15
-
"type": "string",
16
-
"description": "Error message detail. May contain arbitrary message details (unlike the `reason` field), but should be truncated (recommendation: 200 chars)."
17
-
},
18
-
{
19
-
"name": "duration",
20
-
"type": "double",
21
-
"description": "The duration of the operation in miliseconds"
22
-
}
23
-
],
2
+
"types": "will be replaced with `types` from commonDefinitions.json",
0 commit comments