Skip to content

Commit

Permalink
bug 1657947 - New Glean metric types labeled_{custom|memory|timing}_d…
Browse files Browse the repository at this point in the history
…istribution
  • Loading branch information
chutten committed Jul 12, 2024
1 parent 17722b2 commit 4793249
Show file tree
Hide file tree
Showing 3 changed files with 335 additions and 0 deletions.
157 changes: 157 additions & 0 deletions schemas/glean/glean/glean-min.1.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,87 @@
},
"type": "object"
},
"labeled_custom_distribution": {
"additionalProperties": {
"additionalProperties": {
"properties": {
"count": {
"description": "This was accidentally sent in the past and is now deprecated. See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5",
"type": "integer"
},
"sum": {
"type": "integer"
},
"values": {
"additionalProperties": {
"type": "integer"
},
"propertyNames": {
"pattern": "^[0-9]+$"
},
"type": "object"
}
},
"required": [
"sum",
"values"
],
"type": "object"
},
"propertyNames": {
"comment": "This must be at least the length of 'category.name' metric names to support error reporting",
"maxLength": 61,
"type": "string"
},
"type": "object"
},
"propertyNames": {
"maxLength": 111,
"pattern": "^[a-z_][a-z0-9_\\.]+$",
"type": "string"
},
"type": "object"
},
"labeled_memory_distribution": {
"additionalProperties": {
"additionalProperties": {
"properties": {
"count": {
"description": "This was accidentally sent in the past and is now deprecated. See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5",
"type": "integer"
},
"sum": {
"type": "integer"
},
"values": {
"additionalProperties": {
"type": "integer"
},
"propertyNames": {
"pattern": "^[0-9]+$"
},
"type": "object"
}
},
"required": [
"values"
],
"type": "object"
},
"propertyNames": {
"comment": "This must be at least the length of 'category.name' metric names to support error reporting",
"maxLength": 61,
"type": "string"
},
"type": "object"
},
"propertyNames": {
"maxLength": 111,
"pattern": "^[a-z_][a-z0-9_\\.]+$",
"type": "string"
},
"type": "object"
},
"labeled_rate": {
"additionalProperties": {
"additionalProperties": {
Expand Down Expand Up @@ -219,6 +300,82 @@
},
"type": "object"
},
"labeled_timing_distribution": {
"additionalProperties": {
"additionalProperties": {
"properties": {
"bucket_count": {
"type": "integer"
},
"count": {
"description": "This was accidentally sent in the past and is now deprecated. See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5",
"type": "integer"
},
"histogram_type": {
"enum": [
"linear",
"exponential"
],
"type": "string"
},
"overflow": {
"type": "integer"
},
"range": {
"items": {
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": "array"
},
"sum": {
"type": "integer"
},
"time_unit": {
"enum": [
"nanosecond",
"microsecond",
"millisecond",
"second",
"minute",
"hour",
"day"
],
"type": "string"
},
"underflow": {
"type": "integer"
},
"values": {
"additionalProperties": {
"type": "integer"
},
"propertyNames": {
"pattern": "^[0-9]+$"
},
"type": "object"
}
},
"required": [
"values"
],
"type": "object"
},
"propertyNames": {
"comment": "This must be at least the length of 'category.name' metric names to support error reporting",
"maxLength": 61,
"type": "string"
},
"type": "object"
},
"propertyNames": {
"maxLength": 111,
"pattern": "^[a-z_][a-z0-9_\\.]+$",
"type": "string"
},
"type": "object"
},
"memory_distribution": {
"additionalProperties": {
"properties": {
Expand Down
157 changes: 157 additions & 0 deletions schemas/glean/glean/glean.1.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,87 @@
},
"type": "object"
},
"labeled_custom_distribution": {
"additionalProperties": {
"additionalProperties": {
"properties": {
"count": {
"description": "This was accidentally sent in the past and is now deprecated. See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5",
"type": "integer"
},
"sum": {
"type": "integer"
},
"values": {
"additionalProperties": {
"type": "integer"
},
"propertyNames": {
"pattern": "^[0-9]+$"
},
"type": "object"
}
},
"required": [
"sum",
"values"
],
"type": "object"
},
"propertyNames": {
"comment": "This must be at least the length of 'category.name' metric names to support error reporting",
"maxLength": 61,
"type": "string"
},
"type": "object"
},
"propertyNames": {
"maxLength": 111,
"pattern": "^[a-z_][a-z0-9_\\.]+$",
"type": "string"
},
"type": "object"
},
"labeled_memory_distribution": {
"additionalProperties": {
"additionalProperties": {
"properties": {
"count": {
"description": "This was accidentally sent in the past and is now deprecated. See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5",
"type": "integer"
},
"sum": {
"type": "integer"
},
"values": {
"additionalProperties": {
"type": "integer"
},
"propertyNames": {
"pattern": "^[0-9]+$"
},
"type": "object"
}
},
"required": [
"values"
],
"type": "object"
},
"propertyNames": {
"comment": "This must be at least the length of 'category.name' metric names to support error reporting",
"maxLength": 61,
"type": "string"
},
"type": "object"
},
"propertyNames": {
"maxLength": 111,
"pattern": "^[a-z_][a-z0-9_\\.]+$",
"type": "string"
},
"type": "object"
},
"labeled_rate": {
"additionalProperties": {
"additionalProperties": {
Expand Down Expand Up @@ -305,6 +386,82 @@
},
"type": "object"
},
"labeled_timing_distribution": {
"additionalProperties": {
"additionalProperties": {
"properties": {
"bucket_count": {
"type": "integer"
},
"count": {
"description": "This was accidentally sent in the past and is now deprecated. See https://bugzilla.mozilla.org/show_bug.cgi?id=1799509#c5",
"type": "integer"
},
"histogram_type": {
"enum": [
"linear",
"exponential"
],
"type": "string"
},
"overflow": {
"type": "integer"
},
"range": {
"items": {
"type": "number"
},
"maxItems": 2,
"minItems": 2,
"type": "array"
},
"sum": {
"type": "integer"
},
"time_unit": {
"enum": [
"nanosecond",
"microsecond",
"millisecond",
"second",
"minute",
"hour",
"day"
],
"type": "string"
},
"underflow": {
"type": "integer"
},
"values": {
"additionalProperties": {
"type": "integer"
},
"propertyNames": {
"pattern": "^[0-9]+$"
},
"type": "object"
}
},
"required": [
"values"
],
"type": "object"
},
"propertyNames": {
"comment": "This must be at least the length of 'category.name' metric names to support error reporting",
"maxLength": 61,
"type": "string"
},
"type": "object"
},
"propertyNames": {
"maxLength": 111,
"pattern": "^[a-z_][a-z0-9_\\.]+$",
"type": "string"
},
"type": "object"
},
"memory_distribution": {
"additionalProperties": {
"properties": {
Expand Down
21 changes: 21 additions & 0 deletions templates/include/glean/metrics.1.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,35 @@
@GLEAN_BASE_OBJECT_1_JSON@,
"additionalProperties": @GLEAN_TIMING_DISTRIBUTION_1_JSON@
},
"labeled_timing_distribution": {
@GLEAN_BASE_OBJECT_1_JSON@,
"additionalProperties": {
@GLEAN_LABELED_GROUP_1_JSON@,
"additionalProperties": @GLEAN_TIMING_DISTRIBUTION_1_JSON@
}
},
"memory_distribution": {
@GLEAN_BASE_OBJECT_1_JSON@,
"additionalProperties": @GLEAN_MEMORY_DISTRIBUTION_1_JSON@
},
"labeled_memory_distribution": {
@GLEAN_BASE_OBJECT_1_JSON@,
"additionalProperties": {
@GLEAN_LABELED_GROUP_1_JSON@,
"additionalProperties": @GLEAN_MEMORY_DISTRIBUTION_1_JSON@
}
},
"custom_distribution": {
@GLEAN_BASE_OBJECT_1_JSON@,
"additionalProperties": @GLEAN_CUSTOM_DISTRIBUTION_1_JSON@
},
"labeled_custom_distribution": {
@GLEAN_BASE_OBJECT_1_JSON@,
"additionalProperties": {
@GLEAN_LABELED_GROUP_1_JSON@,
"additionalProperties": @GLEAN_CUSTOM_DISTRIBUTION_1_JSON@
}
},
"datetime": {
@GLEAN_BASE_OBJECT_1_JSON@,
"additionalProperties": @GLEAN_DATETIME_1_JSON@
Expand Down

0 comments on commit 4793249

Please sign in to comment.