-
Notifications
You must be signed in to change notification settings - Fork 444
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
Add Stat Chart (#787) #789
Merged
Merged
Conversation
This file contains 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
Screenshots? |
I think I attached those a couple of seconds after you loaded the page |
zasgar
reviewed
Feb 7, 2023
Summary: Fixes pixie-io#787 Test Plan: Signed-off-by: Nick Lanam <nlanam@pixielabs.ai>
aimichelle
reviewed
Feb 9, 2023
aimichelle
requested changes
Feb 9, 2023
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.
Marking as request changes, since I didn't for my previous comments.
Signed-off-by: Nick Lanam <nlanam@pixielabs.ai>
aimichelle
approved these changes
Feb 10, 2023
RagalahariP
pushed a commit
to RagalahariP/pixie
that referenced
this pull request
Feb 15, 2023
Signed-off-by: Nick Lanam <nlanam@pixielabs.ai> <img width="577" alt="image" src="https://user-images.githubusercontent.com/314133/217108680-81070f25-58a0-4a29-ad75-4fbc5699bc89.png"> Summary: Adds a new chart type, 'StatChart', which just displays the latest value of a single metric with units and label. Relevant Issues: Fixes pixie-io#787 Type of change: /kind feature Test Plan: Try this script with this vis spec. ```python import px import pxviews ns_per_ms = 1000 * 1000 ns_per_s = 1000 * ns_per_ms # Window size to use on time_ column for bucketing. window_ns = px.DurationNanos(10 * ns_per_s) def resource_timeseries(start_time: str, node: px.Node): ''' Gets the windowed process stats (CPU, memory, etc) for the input node. Args: @start_time Starting time of the data to examine. @node: The full name of the node to filter on. ''' df = pxviews.container_process_timeseries(start_time, px.now(), window_ns) df = df[df.ctx['node'] == node] df['node'] = df.ctx['node'] df = df.groupby(['time_', 'node']).agg( cpu_usage=('cpu_usage', px.sum), actual_disk_read_throughput=('actual_disk_read_throughput', px.sum), actual_disk_write_throughput=('actual_disk_write_throughput', px.sum), total_disk_read_throughput=('total_disk_read_throughput', px.sum), total_disk_write_throughput=('total_disk_write_throughput', px.sum), rss=('rss', px.sum), vsize=('vsize', px.sum), ) df.groupby_col = df['node'] return df ``` ```json { "variables": [ { "name": "start_time", "type": "PX_STRING", "description": "The relative start time of the window. Current time is assumed to be now", "defaultValue": "-5m" }, { "name": "node", "type": "PX_NODE", "description": "The node name to filter on" } ], "globalFuncs": [ { "outputName": "resource_timeseries", "func": { "name": "resource_timeseries", "args": [ { "name": "start_time", "variable": "start_time" }, { "name": "node", "variable": "node" } ] } } ], "widgets": [ { "name": "CPU Stat", "position": { "x": 0, "y": 0, "w": 1, "h": 1 }, "globalFuncOutputName": "resource_timeseries", "displaySpec": { "@type": "types.px.dev/px.vispb.StatChart", "title": "CPU Usage", "stat": { "value": "cpu_usage" } } }, { "name": "Bytes Read Stat", "position": { "x": 2, "y": 0, "w": 2, "h": 2 }, "globalFuncOutputName": "resource_timeseries", "displaySpec": { "@type": "types.px.dev/px.vispb.StatChart", "title": "Bytes Read", "stat": { "value": "total_disk_read_throughput" } } } ] } ``` Changelog Message: ```release-note New chart type: Stat. Shows a label, metric, and units for that metric. ``` --------- Signed-off-by: Nick Lanam <nlanam@pixielabs.ai>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Signed-off-by: Nick Lanam nlanam@pixielabs.ai
Summary: Adds a new chart type, 'StatChart', which just displays the latest value of a single metric with units and label.
Relevant Issues: Fixes #787
Type of change: /kind feature
Test Plan: Try this script with this vis spec.
Changelog Message: