Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public List<SelenideElement> getAllVisibleElements() {
}

private List<SelenideElement> getEnabledColumnHeaders() {
return Stream.of("Broker ID", "Disk usage", "Partitions skew",
"Leaders", "Leader skew", "Online partitions", "Port", "Host")
return Stream.of("Broker ID", "Disk usage", "In Sync Replicas", "Replicas", "Replicas skew",
"Leaders", "Leaders skew", "Port", "Host")
.map(name -> $x(String.format(columnHeaderLocator, name)))
.collect(Collectors.toList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as S from './SkewHeader.styled';

const SkewHeader: React.FC = () => (
<S.CellWrapper>
Partitions skew
Replicas skew
<Tooltip
value={<InfoIcon />}
content="The divergence from the average brokers' value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const DiscUsage = ({

type ScewProps = CellContext<
BrokersTableRow,
BrokersTableRow['partitionsSkew'] | BrokersTableRow['leadersSkew']
BrokersTableRow['replicasSkew'] | BrokersTableRow['leadersSkew']
>;

export const Skew = ({ getValue }: ScewProps) => {
Expand All @@ -73,25 +73,24 @@ export const Skew = ({ getValue }: ScewProps) => {
);
};

type OnlinePartitionsProps = CellContext<
type InSyncReplicasProps = CellContext<
BrokersTableRow,
BrokersTableRow['onlinePartitionCount']
BrokersTableRow['inSyncReplicas']
>;

export const OnlinePartitions = ({ row }: OnlinePartitionsProps) => {
const { onlinePartitionCount, offlinePartitionCount } = row.original;

if (
onlinePartitionCount === undefined ||
offlinePartitionCount === undefined
) {
export const InSyncReplicas = ({ getValue, row }: InSyncReplicasProps) => {
const inSyncReplicas = getValue();
const { replicas } = row.original;
if (inSyncReplicas === undefined || replicas === undefined) {
return null;
}

return (
<ColoredCell
value={onlinePartitionCount}
attention={offlinePartitionCount > 0}
/>
<ColoredCell value={inSyncReplicas} attention={inSyncReplicas < replicas} />
);
};

type ReplicasProps = CellContext<BrokersTableRow, BrokersTableRow['replicas']>;

export const Replicas = ({ getValue }: ReplicasProps) => {
return <ColoredCell value={getValue() || ''} />;
};
6 changes: 3 additions & 3 deletions frontend/src/components/Brokers/BrokersList/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ export type BrokersTableRow = {
port: number | undefined;
host: string | undefined;
partitionsLeader: number | undefined;
partitionsSkew: number | undefined;
leadersSkew: number | undefined;
onlinePartitionCount: number | undefined;
offlinePartitionCount: number | undefined;
replicas: number | undefined;
inSyncReplicas: number | undefined;
replicasSkew: number | undefined;
activeControllers: number | undefined;
};
24 changes: 13 additions & 11 deletions frontend/src/components/Brokers/BrokersList/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export const getBrokersTableRows = ({
brokers = [],
diskUsage = [],
activeControllers,
onlinePartitionCount,
offlinePartitionCount,
}: GetBrokersTableRowsParams): BrokersTableRow[] => {
if (!brokers || brokers.length === 0) {
return [];
Expand All @@ -38,10 +36,10 @@ export const getBrokersTableRows = ({
port: broker.port,
host: broker.host,
partitionsLeader: broker.partitionsLeader,
partitionsSkew: broker.partitionsSkew,
leadersSkew: broker.leadersSkew,
onlinePartitionCount,
offlinePartitionCount,
replicas: broker.partitions,
inSyncReplicas: broker.inSyncPartitions,
replicasSkew: broker.partitionsSkew,
activeControllers,
};
});
Expand All @@ -59,19 +57,23 @@ export const getBrokersTableColumns = () => {
header: 'Disk usage',
cell: Cell.DiscUsage,
}),
columnHelper.accessor('partitionsSkew', {
columnHelper.accessor('inSyncReplicas', {
header: 'In Sync Replicas',
cell: Cell.InSyncReplicas,
}),
columnHelper.accessor('replicas', {
header: 'Replicas',
cell: Cell.Replicas,
}),
columnHelper.accessor('replicasSkew', {
header: SkewHeader,
cell: Cell.Skew,
}),
columnHelper.accessor('partitionsLeader', { header: 'Leaders' }),
columnHelper.accessor('leadersSkew', {
header: 'Leader skew',
header: 'Leaders skew',
cell: Cell.Skew,
}),
columnHelper.accessor('onlinePartitionCount', {
header: 'Online partitions',
cell: Cell.OnlinePartitions,
}),
columnHelper.accessor('port', { header: 'Port' }),
columnHelper.accessor('host', { header: 'Host' }),
];
Expand Down
Loading