-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Cpu and memory sparklines #387
Conversation
There are a few product questions associated with this feature, in addition to issues with the implementation -
|
I'll investigate this tomorrow. |
I see those shapes for very young processes - it looks like your CPU only has two data points, and your memory history only has three. I'd love to see what you're getting back from the API. It's possible that our Heapsters are configured differently (and if so, I should probably account for that before showing the charts) |
@floreks Can you help with review? |
@@ -0,0 +1,8 @@ | |||
<svg viewBox="0,0 1,1" |
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.
Nit: please add the Copyright ...
boilerplate to html files. See how it is done in others.
No worries, it is stripped and minified during build process.
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.
Fixed in 3062264
This is awesome @joeatwork :) I'm really happy with the shape of this PR. A few comments, PTAL |
585c090
to
d94f58c
Compare
Thanks for all of your help! I believe I've addressed your comments - please take another look when you get the time. |
I wanted to this today morning but I see you've done it all :) I'll take a look anyway. |
<span ng-if="::ctrl.hasCpuUsage(pod)"> | ||
{{::(pod.metrics.cpuUsage | kdCores)}} | ||
</span> | ||
<span ng-if="::!ctrl.hasCpuUsage(pod)"> | ||
- | ||
</span> |
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.
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.
Reviewed 7 of 12 files at r1, 5 of 5 files at r2. src/app/frontend/common/components/sparkline/sparkline_directive.js, line 29 [r2] (raw file): src/app/frontend/common/components/sparkline/sparkline_directive.js, line 30 [r2] (raw file): src/app/frontend/replicationcontrollerdetail/replicationcontrollerdetail.html, line 158 [r2] (raw file): @floreks ? Comments from the review on Reviewable.io |
(bear in mind that I'm testing reviewable.io, so might miss something) |
Review status: all files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. src/app/frontend/common/components/sparkline/sparkline_directive.js, line 30 [r2] (raw file): src/app/frontend/replicationcontrollerdetail/replicationcontrollerdetail.html, line 158 [r2] (raw file): Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. src/app/frontend/common/components/sparkline/sparkline_directive.js, line 30 [r2] (raw file): Comments from the review on Reviewable.io |
Btw, there's also a |
0ae5a0a
to
205a215
Compare
Review status: 4 of 9 files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. src/app/frontend/common/components/sparkline/sparkline_directive.js, line 29 [r2] (raw file): src/app/frontend/common/components/sparkline/sparkline_directive.js, line 30 [r2] (raw file): src/app/frontend/replicationcontrollerdetail/replicationcontrollerdetail.html, line 158 [r2] (raw file): Getting this effect requires that the cells be as narrow as they can be, or the left edge of the longest content will wander off and leave the header looking strange. A fix (and the only one I can think of) is to make the sparkline cells as narrow as possible. Unfortunately, this means they'll always wrap, since a wrapped cell is narrower than an unwrapped cell. We could change this to prevent the wrap, but this will (in the absence of media queries) prevent wrapping in all cases, which doesn't get us anywhere. Is there an example of media-querying, or responding in layout to size, elsewhere in the code? It seems like the natural thing to do might be to explicitly hide or wrap the charts when the viewport is narrower than some threshold, rather than trying to get the natural text wrapping to work. Alternately, we could just left-justify the content, or compromise on the mock, if that seems appropriate. Do you guys have any thoughts about this? Comments from the review on Reviewable.io |
Review status: 4 of 9 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. src/app/frontend/replicationcontrollerdetail/replicationcontrollerdetail.html, line 158 [r2] (raw file): Still for display we can use 1 table column but wrap it in 2 divs or something and align text to the left. I'd love to help with styling that but for now I've problem with heapster on my local cluster and can't make him produce any metrics. Comments from the review on Reviewable.io |
Reviewed 4 of 5 files at r3, 1 of 1 files at r4. src/app/frontend/common/components/sparkline/sparkline_directive.js, line 30 [r2] (raw file): src/app/frontend/replicationcontrollerdetail/replicationcontrollerdetail.html, line 158 [r2] (raw file): I say: go for media queries. Display underneath and next to depending on the size. Please verify that this works from 1920px width to phone size :) Comments from the review on Reviewable.io |
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. a discussion (no related file): Comments from the review on Reviewable.io |
205a215
to
4844eca
Compare
.kd-sparkline { | ||
background-color: $body; | ||
height: 2.5 * $baseline-grid; | ||
vertical-align: -$baseline-grid / 2; // 20% below baseline, to flow with text |
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.
@bryk - I've added the vertical-align back in. Without it, the graph visually looks too high, like it's a step up from the label text. If I change the enclosing line-height to zero, it moves the graph but also the label text, so the graph still looks higher than the mock. (I might not understand your line-height suggestion) - please let me know if this is ok.
I've changed the look of empty fields (That is, when you are expecting metrics from the server but get an empty list of metrics) to match the other fields, displaying a left-aligned dash in that case: Review status: 5 of 9 files reviewed at latest revision, 7 unresolved discussions. src/app/frontend/common/components/sparkline/sparkline_controller.js, line 23 [r2] (raw file): src/app/frontend/common/components/sparkline/sparkline_directive.js, line 29 [r2] (raw file): src/app/frontend/common/components/sparkline/sparkline_directive.js, line 30 [r2] (raw file): src/app/frontend/common/components/sparkline/sparkline_directive.js, line 30 [r2] (raw file): src/app/frontend/replicationcontrollerdetail/replicationcontrollerdetail.html, line 158 [r2] (raw file): "Natural" XL width: Middle width - no sidebar, wrapping sparkline. I've padded the top and bottom of the cell in this case by $baseline-grid Standard "phone" width - there is enough room for the sparkline to display next to the label for the most part Most narrow - the sparkline wraps naturally (the sparkline will also wrap if the label is very long, which seems reasonable) Comments from the review on Reviewable.io |
@floreks, @bryk I think I've addressed your concerns with wrapping and single-table-cell layouts in the recent commits - I haven't changed the formats or metrics for the CPU or Memory, but those can be changed globally whenever you'd like since I'm using the same filters to format the values that are used elsewhere. Please take another look and let me know if these changes work for you! The biggest things to consider (and maybe ask me to change) are
Thanks again for all of your help with this! |
Current coverage is
|
Nice! My last comments about style and some tests and let's merge. I cant wait to have this on HEAD Reviewed 2 of 4 files at r5. src/app/frontend/common/components/sparkline/sparkline_controller.js, line 18 [r5] (raw file): src/app/frontend/common/components/sparkline/sparkline_controller.js, line 23 [r5] (raw file): src/app/frontend/replicationcontrollerdetail/replicationcontrollerdetail.html, line 156 [r5] (raw file): src/app/frontend/replicationcontrollerdetail/replicationcontrollerdetail.scss, line 129 [r5] (raw file): Comments from the review on Reviewable.io |
Review status: 5 of 10 files reviewed at latest revision, 6 unresolved discussions. a discussion (no related file): src/app/frontend/common/components/sparkline/sparkline_controller.js, line 18 [r5] (raw file): src/app/frontend/common/components/sparkline/sparkline_controller.js, line 23 [r5] (raw file): src/app/frontend/replicationcontrollerdetail/replicationcontrollerdetail.html, line 156 [r5] (raw file): Comments from the review on Reviewable.io |
Thanks for your continuing help with this! I think your last comments have been addressed. |
@bryk I also see only three data points when using local cluster |
@cheld Update your heapster. @joeatwork squash and Reviewed 1 of 4 files at r5, 4 of 4 files at r6. Comments from the review on Reviewable.io |
9d99690
to
7ef80f3
Compare
Linted and squashed! |
Awesome! Merging. If you need any help from us, just ping. Reviewed 2 of 2 files at r7. Comments from the review on Reviewable.io |
Thanks, folks! |
I played around with heapster 0.19.0 and the parameters -stats_resolution -model_resolution -model_frequency. I experimented a lot, but I was not able to create pretty charts. Can you suggest proper settings? |
@joeatwork What is your heapster setup? |
ok, I tried 2.0-alpha. This seems to work much better. Unfortunately, it crashes if one changes the default flags. However, even with the default values, this version produce something that is acceptable. |
CC @mwielgus |
Unfortunately, the crashes are not only related to flags. The version also crashes randomly. I created an issue. |
I've been running with gcr.io/google_containers/heapster:v0.20.0-alpha5 - here's my heapster replication controller in detail: apiVersion: v1
kind: ReplicationController
metadata:
labels:
k8s-app: heapster
kubernetes.io/cluster-service: "true"
version: v10
name: heapster-v10
namespace: kube-system
spec:
replicas: 1
selector:
k8s-app: heapster
version: v10
template:
metadata:
creationTimestamp: null
labels:
k8s-app: heapster
kubernetes.io/cluster-service: "true"
version: v10
spec:
containers:
- command:
- /heapster
- "--source=kubernetes:https://kubernetes.default"
- "--sink=influxdb:http://monitoring-influxdb:8086"
image: gcr.io/google_containers/heapster:v0.20.0-alpha5
imagePullPolicy: IfNotPresent
name: heapster
resources:
limits:
cpu: 100m
memory: 224Mi
requests:
cpu: 100m
memory: 224Mi
terminationMessagePath: /dev/termination-log
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 30 |
Bumps [tree-kill](https://github.com/pkrumins/node-tree-kill) from 1.2.0 to 1.2.2. - [Release notes](https://github.com/pkrumins/node-tree-kill/releases) - [Commits](pkrumins/node-tree-kill@v1.2.0...v1.2.2) Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Anvith KS <[email protected]>
The changes proposed here depend on the new API information in #386 - comment on this pull request can probably wait until those changes are revised and accepted or declined.
This pull request proposes adding a sparkline-like visualization of the resource usage history for individual pods in a replication controller detail screen, fixing #366