Skip to content

Commit a3de55f

Browse files
committed
Fix #660: Add the rate metric type
1 parent d3af01c commit a3de55f

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

schemas/glean/glean/glean.1.schema.json

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,20 @@
276276
"labeled_rate": {
277277
"additionalProperties": {
278278
"additionalProperties": {
279-
"type": "integer"
279+
"additionalProperties": false,
280+
"properties": {
281+
"denominator": {
282+
"type": "integer"
283+
},
284+
"numerator": {
285+
"type": "integer"
286+
}
287+
},
288+
"required": [
289+
"numerator",
290+
"denominator"
291+
],
292+
"type": "object"
280293
},
281294
"propertyNames": {
282295
"comment": "This must be at least the length of 'category.name' metric names to support error reporting",
@@ -541,7 +554,20 @@
541554
},
542555
"rate": {
543556
"additionalProperties": {
544-
"type": "integer"
557+
"additionalProperties": false,
558+
"properties": {
559+
"denominator": {
560+
"type": "integer"
561+
},
562+
"numerator": {
563+
"type": "integer"
564+
}
565+
},
566+
"required": [
567+
"numerator",
568+
"denominator"
569+
],
570+
"type": "object"
545571
},
546572
"propertyNames": {
547573
"maxLength": 61,

templates/include/glean/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,5 @@
6262
section.
6363

6464
- Added `sum` to histogram and `timing_distribution` as optional parameter.
65+
66+
- The `rate` metric type is an object with a `numerator` and `denominator`.
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
{
2-
"type": "integer"
2+
"type": "object",
3+
"properties": {
4+
"numerator": {
5+
"type": "integer"
6+
},
7+
"denominator": {
8+
"type": "integer"
9+
}
10+
},
11+
"required": [
12+
"numerator",
13+
"denominator"
14+
],
15+
"additionalProperties": false
316
}

0 commit comments

Comments
 (0)