Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions schemas/glean/glean/glean.1.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,22 @@
"labeled_rate": {
"additionalProperties": {
"additionalProperties": {
"type": "integer"
"additionalProperties": false,
"properties": {
"denominator": {
"minimum": 0,
"type": "integer"
},
"numerator": {
"minimum": 0,
"type": "integer"
}
},
"required": [
"numerator",
"denominator"
],
"type": "object"
},
"propertyNames": {
"comment": "This must be at least the length of 'category.name' metric names to support error reporting",
Expand Down Expand Up @@ -565,7 +580,22 @@
},
"rate": {
"additionalProperties": {
"type": "integer"
"additionalProperties": false,
"properties": {
"denominator": {
"minimum": 0,
"type": "integer"
},
"numerator": {
"minimum": 0,
"type": "integer"
}
},
"required": [
"numerator",
"denominator"
],
"type": "object"
},
"propertyNames": {
"maxLength": 61,
Expand Down
2 changes: 2 additions & 0 deletions templates/include/glean/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@

- Pull client_info definitions from the glean source code (see:
`scripts/extract_glean_client_info_descriptions`)

- The `rate` metric type is an object with a `numerator` and `denominator`.
17 changes: 16 additions & 1 deletion templates/include/glean/rate.1.schema.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
{
"type": "integer"
"type": "object",
"properties": {
"numerator": {
"type": "integer",
"minimum": 0
},
"denominator": {
"type": "integer",
"minimum": 0
}
},
"required": [
"numerator",
"denominator"
],
"additionalProperties": false
}
15 changes: 12 additions & 3 deletions validation/glean/glean.1.baseline.pass.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,21 @@
}
},
"rate": {
"examples.rate_example": 23
"examples.rate_example": {
"numerator": 2,
"denominator": 3
}
},
"labeled_rate": {
"examples.labeled_rate_example": {
"a": 12,
"b": 8
"a": {
"numerator": 1,
"denominator": 2
},
"b": {
"numerator": 1,
"denominator": 2
}
}
},
"uuid": {
Expand Down
5 changes: 4 additions & 1 deletion validation/glean/glean.1.invalid_use_counter.fail.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@
"examples.usage_example": true
},
"rate": {
"examples.rate_example": 23
"examples.rate_example": {
"numerator": 2,
"denominator": 3
}
}
},
"events": [
Expand Down
5 changes: 4 additions & 1 deletion validation/glean/glean.1.metrics.pass.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@
"examples.usage_example": true
},
"rate": {
"examples.rate_example": 23
"examples.rate_example": {
"numerator": 2,
"denominator": 3
}
}
},
"events": [
Expand Down