-
Notifications
You must be signed in to change notification settings - Fork 8
Merge Timeseries schema #418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
barboraplasovska
wants to merge
6
commits into
master
Choose a base branch
from
bplasovska/timeseries
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+206
−0
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
81052ff
add timeseries memory and CPU event schemas
barboraplasovska 018615c
add schema discriminator field to timeseries memory and CPU schemas
barboraplasovska 2d12ee2
constrain timeseries name to cpu/memory const values
barboraplasovska 6b55926
Change memory max to memory footprint
barboraplasovska 041b145
Update timeseries CPU and memory schemas to object-v2 flattened forma…
barboraplasovska 5914e67
add common schema reference to timeseries CPU and memory event schema…
barboraplasovska File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema", | ||
| "$id": "rum/timeseries-cpu-schema.json", | ||
| "title": "RumTimeseriesCpuEvent", | ||
| "type": "object", | ||
| "description": "Schema for a CPU timeseries event.", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "_common-schema.json" | ||
| }, | ||
| { | ||
| "required": ["type", "timeseries"], | ||
| "properties": { | ||
| "type": { | ||
| "type": "string", | ||
| "description": "RUM event type", | ||
| "const": "timeseries", | ||
| "readOnly": true | ||
| }, | ||
| "timeseries": { | ||
| "type": "object", | ||
| "description": "CPU timeseries properties", | ||
| "required": ["id", "name", "schema", "start", "end", "data"], | ||
| "properties": { | ||
| "id": { | ||
| "type": "string", | ||
| "description": "UUID of the timeseries batch", | ||
| "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$", | ||
| "readOnly": true | ||
| }, | ||
| "name": { | ||
| "type": "string", | ||
| "description": "Name identifying the timeseries metric", | ||
| "const": "cpu", | ||
| "readOnly": true | ||
| }, | ||
| "schema": { | ||
| "type": "string", | ||
| "description": "Wire-shape discriminator for the data field", | ||
| "const": "object-v2", | ||
| "readOnly": true | ||
| }, | ||
| "start": { | ||
| "type": "integer", | ||
| "description": "Timestamp of the first sample in nanoseconds from epoch", | ||
| "readOnly": true | ||
| }, | ||
| "end": { | ||
| "type": "integer", | ||
| "description": "Timestamp of the last sample in nanoseconds from epoch", | ||
| "readOnly": true | ||
| }, | ||
| "data": { | ||
| "type": "object", | ||
| "description": "Flattened CPU data points", | ||
| "required": ["timestamps", "values"], | ||
| "properties": { | ||
| "timestamps": { | ||
| "type": "array", | ||
| "description": "Sample timestamps in nanoseconds from epoch", | ||
| "items": { | ||
| "type": "integer", | ||
| "readOnly": true | ||
| }, | ||
| "readOnly": true | ||
| }, | ||
| "values": { | ||
| "type": "object", | ||
| "description": "CPU measurements, aligned index-for-index with timestamps", | ||
| "required": ["cpu_usage"], | ||
| "properties": { | ||
| "cpu_usage": { | ||
| "type": "array", | ||
| "description": "CPU usage as a percentage (0.0 to 100.0)", | ||
| "items": { | ||
| "type": "number", | ||
| "readOnly": true | ||
| }, | ||
| "readOnly": true | ||
| } | ||
| }, | ||
| "readOnly": true | ||
| } | ||
| }, | ||
| "readOnly": true | ||
| } | ||
| }, | ||
| "readOnly": true | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema", | ||
| "$id": "rum/timeseries-memory-schema.json", | ||
| "title": "RumTimeseriesMemoryEvent", | ||
| "type": "object", | ||
| "description": "Schema for a memory timeseries event.", | ||
| "allOf": [ | ||
| { | ||
| "$ref": "_common-schema.json" | ||
| }, | ||
| { | ||
| "required": ["type", "timeseries"], | ||
| "properties": { | ||
| "type": { | ||
| "type": "string", | ||
| "description": "RUM event type", | ||
| "const": "timeseries", | ||
| "readOnly": true | ||
| }, | ||
| "timeseries": { | ||
| "type": "object", | ||
| "description": "Memory timeseries properties", | ||
| "required": ["id", "name", "schema", "start", "end", "data"], | ||
| "properties": { | ||
| "id": { | ||
| "type": "string", | ||
| "description": "UUID of the timeseries batch", | ||
| "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$", | ||
| "readOnly": true | ||
| }, | ||
| "name": { | ||
| "type": "string", | ||
| "description": "Name identifying the timeseries metric", | ||
| "const": "memory", | ||
| "readOnly": true | ||
| }, | ||
| "schema": { | ||
| "type": "string", | ||
| "description": "Wire-shape discriminator for the data field", | ||
| "const": "object-v2", | ||
| "readOnly": true | ||
| }, | ||
| "start": { | ||
| "type": "integer", | ||
| "description": "Timestamp of the first sample in nanoseconds from epoch", | ||
| "readOnly": true | ||
| }, | ||
| "end": { | ||
| "type": "integer", | ||
| "description": "Timestamp of the last sample in nanoseconds from epoch", | ||
| "readOnly": true | ||
| }, | ||
| "data": { | ||
| "type": "object", | ||
| "description": "Flattened memory data points", | ||
| "required": ["timestamps", "values"], | ||
| "properties": { | ||
| "timestamps": { | ||
| "type": "array", | ||
| "description": "Sample timestamps in nanoseconds from epoch", | ||
| "items": { | ||
| "type": "integer", | ||
| "readOnly": true | ||
| }, | ||
| "readOnly": true | ||
| }, | ||
| "values": { | ||
| "type": "object", | ||
| "description": "Memory measurements, aligned index-for-index with timestamps", | ||
| "required": ["memory_footprint", "memory_percent"], | ||
| "properties": { | ||
| "memory_footprint": { | ||
| "type": "array", | ||
| "description": "Physical memory footprint of the process in kilobytes", | ||
| "items": { | ||
| "type": "number", | ||
| "readOnly": true | ||
| }, | ||
| "readOnly": true | ||
| }, | ||
| "memory_percent": { | ||
| "type": "array", | ||
| "description": "Memory footprint as a percentage of total device RAM", | ||
| "items": { | ||
| "type": "number", | ||
| "readOnly": true | ||
| }, | ||
| "readOnly": true | ||
| } | ||
| }, | ||
| "readOnly": true | ||
| } | ||
| }, | ||
| "readOnly": true | ||
| } | ||
| }, | ||
| "readOnly": true | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block only registers the new event in the mobile schema, but
schemas/rum-events-schema.jsonremains unchanged whilescripts/generate.mjs:15uses that aggregate schema to generate the exportedRumEventtypes. When consumers validate or generate from the aggregate schema, these mobile timeseries payloads are still rejected and omitted from the package types even though they are now valid mobile RUM events; add the same timeseries branch there and regenerate the definitions.Useful? React with 👍 / 👎.