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

[wip] show number of CPU cores in node list #27662

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/server/status/recorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"io"
"os"
"runtime"
"strconv"
"sync/atomic"
"time"
Expand Down Expand Up @@ -433,6 +434,7 @@ func (mr *MetricsRecorder) GenerateNodeStatus(ctx context.Context) *NodeStatus {
Args: os.Args,
Env: envutil.GetEnvVarsUsed(),
Activity: activity,
NumCpus: int32(runtime.NumCPU()),
}

// If the cluster hasn't yet been definitively moved past the network stats
Expand Down
127 changes: 79 additions & 48 deletions pkg/server/status/status.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/server/status/status.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ message NodeStatus {
(gogoproto.nullable) = false,
(gogoproto.castkey) = "github.com/cockroachdb/cockroach/pkg/roachpb.NodeID"
];
// num_cpus is the number of logical CPUs on this machine.
int32 num_cpus = 11;
}

// A HealthAlert is an undesired condition detected by a server which should be
Expand Down
4 changes: 4 additions & 0 deletions pkg/ui/src/views/cluster/containers/nodesOverview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ class LiveNodeList extends React.Component<NodeCategoryListProps, {}> {
cell: (ns) => `n${ns.desc.node_id}`,
sort: (ns) => ns.desc.node_id,
},
{
title: "CPUs",
cell: (ns) => ns.num_cpus,
},
// Node address column - displays the node address, links to the
// node-specific page for this node.
{
Expand Down