Skip to content

Commit

Permalink
ui: show replica type on the range report page
Browse files Browse the repository at this point in the history
Release justification: observability improvement

Release note (ui change): the range report page on the admin ui will now
also show each of the replica's types
  • Loading branch information
aayushshah15 committed Feb 25, 2021
1 parent da025e5 commit 2f4572c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/ui/src/views/reports/containers/range/rangeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const rangeTableDisplayList: RangeTableRow[] = [
{ variable: "id", display: "ID", compareToLeader: false },
{ variable: "keyRange", display: "Key Range", compareToLeader: true },
{ variable: "problems", display: "Problems", compareToLeader: true },
{ variable: "replicaType", display: "Replica Type", compareToLeader: true },
{ variable: "raftState", display: "Raft State", compareToLeader: false },
{ variable: "quiescent", display: "Quiescent", compareToLeader: true },
{ variable: "ticking", display: "Ticking", compareToLeader: true },
Expand Down Expand Up @@ -195,6 +196,10 @@ const rangeTableQuiescent: RangeTableCellContent = {
className: ["range-table__cell--quiescent"],
};

function contentReplicaType(replicaType: protos.cockroach.roachpb.ReplicaType) {
return protos.cockroach.roachpb.ReplicaType[replicaType];
}

function convertLeaseState(
leaseState: protos.cockroach.kv.kvserver.storagepb.LeaseState,
) {
Expand Down Expand Up @@ -627,6 +632,7 @@ export default class RangeTable extends React.Component<RangeTableProps, {}> {
`${info.span.start_key} to ${info.span.end_key}`,
),
problems: this.contentProblems(info.problems, awaitingGC),
replicaType: this.createContent(contentReplicaType(localReplica.type)),
raftState: raftState,
quiescent: info.quiescent
? rangeTableQuiescent
Expand Down

0 comments on commit 2f4572c

Please sign in to comment.