Skip to content
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

ui: add "total" values for disk and memory to node list; add num CPUs #28189

Merged
merged 2 commits into from
Aug 7, 2018

Conversation

vilterp
Copy link
Contributor

@vilterp vilterp commented Aug 2, 2018

image

There may be a more visually concise way of showing this.

@vilterp vilterp requested a review from a team August 2, 2018 01:04
@vilterp vilterp requested a review from a team as a code owner August 2, 2018 01:04
@vilterp vilterp requested a review from a team August 2, 2018 01:04
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@vilterp vilterp removed request for a team August 2, 2018 01:04
@bdarnell
Copy link
Contributor

bdarnell commented Aug 2, 2018

Showing both the total capacity and the percentage is kind of redundant. I'd just show one or the other (probably the percentage) and leave the other for a mouseover to save a bit of horizontal space.

@vilterp
Copy link
Contributor Author

vilterp commented Aug 2, 2018

Updated. It doesn't save a whole lot of horiz space because of the column headers, but it is less cluttered. TODO: use a real tooltip, not html title.

image

@robert-s-lee
Copy link
Contributor

Could the same be done to CPU. In the example, 4 cores (25%)

@vilterp
Copy link
Contributor Author

vilterp commented Aug 2, 2018

@robert-s-lee yes, although we should sort out #28154 first to avoid inconsistency with the hardware dashboard.

Copy link
Member

@BramGruneir BramGruneir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1f64cec really needs more in the description. There's a lot of code changes here and the summary in the commit message doesn't capture that.

What was the rationale behind the reordering in cfb2ab3. Please add that to the commit message.

The final commit isn't needed. It should be fixed back in the original commits for the changes.

Overall, the changes LGTM, but please go back and fixup the prior commits instead of issuing new ones.

Reviewed 1 of 1 files at r1, 1 of 1 files at r2, 10 of 10 files at r3, 1 of 1 files at r4, 4 of 4 files at r5, 1 of 1 files at r6, 1 of 1 files at r7, 1 of 1 files at r8.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained


pkg/server/status/recorder.go, line 604 at r3 (raw file):

// GetTotalMemory returns either the total system memory or if possible the
// cgroups available memory.
func GetTotalMemory(ctx context.Context) (int64, error) {

Why did you move this? There's no mention the commit message.


pkg/server/status/status.proto, line 61 at r5 (raw file):

  ];
  // total_system_memory is the total RAM available to the system
  // (or, if possible, the memory available to the cgroup this process is in)

This comment update should be on the commit where total_system_memory was added.

@vilterp
Copy link
Contributor Author

vilterp commented Aug 7, 2018

TFTR — squashed down to a backend and a frontend commit, and added to the commit descriptions. PTAL.

Pete Vilter added 2 commits August 7, 2018 10:17
Includes moving the GetTotalMemory function from the server package to
the server/status package, so it can be used by the stats recorder and
also the base Server where it was originally used.

Release note: None
Also, reorder the columns of the table to keep hardware stats together:
CPUs, memory, and disk usage.

Release note (admin ui change): add number of CPUs and percentages of
memory and disk usage to the node list on the overview page.
Copy link
Member

@BramGruneir BramGruneir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 5 of 5 files at r9, 2 of 2 files at r10.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

@vilterp
Copy link
Contributor Author

vilterp commented Aug 7, 2018

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 7, 2018

Build failed

@vilterp
Copy link
Contributor Author

vilterp commented Aug 7, 2018

bors r+

craig bot pushed a commit that referenced this pull request Aug 7, 2018
28189: ui: add "total" values for disk and memory to node list; add num CPUs r=vilterp a=vilterp

![image](https://user-images.githubusercontent.com/7341/43556563-5eeaf5a4-95ce-11e8-8206-4c565e3acf8e.png)

There may be a more visually concise way of showing this.

Co-authored-by: Pete Vilter <vilterp@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Aug 7, 2018

Build succeeded

@craig craig bot merged commit e7592e1 into cockroachdb:master Aug 7, 2018
import { INodeStatus, MetricConstants, BytesUsed } from "src/util/proto";
import {FixLong} from "oss/src/util/fixLong";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plz cleanup this line

// CPUs - the number of CPUs on this node
{
title: "CPUs",
cell: (ns) => ns.num_cpus,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems weird to sort on num CPUs, but it's also a little weird that this column wouldn't be sortable...

title: "Capacity Usage",
cell: (ns) => {
const { usable } = nodeCapacityStats(ns);
const used = BytesUsed(ns);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit uncomfortable that we're discarding used from nodeCapacityStats here in favor of calling BytesUsed, but elsewhere we just use that. let's make these consistent, please

const used = BytesUsed(ns);
return (
<span title={`Total: ${BytesWithPrecision(usable, 0)}`}>
{BytesWithPrecision(used, 0)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we throwing away the tenths place? the whole point of using Bytes everywhere is that we're consistent in our reporting across the whole project.

<span title={`Total: ${BytesWithPrecision(usable, 0)}`}>
{BytesWithPrecision(used, 0)}
{" "}
({Math.round(used / usable * 100)}%)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about Percentage from util/format instead?

cell: (ns) => Bytes(ns.metrics[MetricConstants.rss]),
cell: (ns) => {
const used = ns.metrics[MetricConstants.rss];
const available = FixLong(ns.total_system_memory).toNumber();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd prefer if we did similar treatment in nodeSumStats for memory as we do for capacity, to keep things consistent

@vilterp vilterp deleted the node-list-denominators branch August 30, 2018 19:47
vilterp pushed a commit to vilterp/cockroach that referenced this pull request Aug 30, 2018
Until cockroachdb#28189, GetTotalMemory was only called at startup; that PR caused
it to be called every 10s, filling the logs with spam on some platforms.
This changes it to only log warnings on startup.

The value could be cached so it only has to be called on startup, but it
seems possible that the amount of RAM on the machine could change at
runtime, and we'd want to reflect that in the Admin UI, which is where
the results of the every-10s calls end up.

Release note: None
vilterp pushed a commit to vilterp/cockroach that referenced this pull request Aug 30, 2018
Until cockroachdb#28189, GetTotalMemory was only called at startup; that PR caused
it to be called every 10s, filling the logs with spam on some platforms.
This changes it to only log warnings on startup.

The value could be cached so it only has to be called on startup, but it
seems possible that the amount of RAM on the machine could change at
runtime, and we'd want to reflect that in the Admin UI, which is where
the results of the every-10s calls end up.

Release note: None
craig bot pushed a commit that referenced this pull request Aug 30, 2018
29405: server/status: de-spam system memory log r=vilterp a=vilterp

Until #28189, `GetTotalMemory` was only called at startup; that PR caused
it to be called every 10s, filling the logs with spam on some platforms.
This changes it to only log warnings on startup.

The value could be cached so it only has to be called on startup, but it
seems possible that the amount of RAM on the machine could change at
runtime, and we'd want to reflect that in the Admin UI, which is where
the results of these every-10s calls end up.

Fixes #28891

Release note: None

Co-authored-by: Pete Vilter <vilterp@cockroachlabs.com>
vilterp pushed a commit to vilterp/cockroach that referenced this pull request Sep 13, 2018
Until cockroachdb#28189, GetTotalMemory was only called at startup; that PR caused
it to be called every 10s, filling the logs with spam on some platforms.
This changes it to only log warnings on startup.

The value could be cached so it only has to be called on startup, but it
seems possible that the amount of RAM on the machine could change at
runtime, and we'd want to reflect that in the Admin UI, which is where
the results of the every-10s calls end up.

Release note: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants