Skip to content

Commit

Permalink
properly detect lowestVariant for system health
Browse files Browse the repository at this point in the history
  • Loading branch information
MFTabriz committed Dec 17, 2022
1 parent 0d1684c commit 55b0240
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/pages/admin/stream-health.tsx
Expand Up @@ -212,7 +212,9 @@ const StreamHealth = () => {
const currentSpeed = bitrateChart[0]?.data[bitrateChart[0].data.length - 1]?.value;
const currentDownloadSeconds =
medianSegmentDownloadDurations[medianSegmentDownloadDurations.length - 1]?.value;
const lowestVariant = availableBitrates[0]; // TODO: get lowest bitrate from available bitrates
const lowestVariant = availableBitrates.reduce((prev, curr) =>
prev.valueOf() < curr.valueOf() ? prev : curr,
);

const latencyMedian = medianLatency[medianLatency.length - 1]?.value || 0;
const latencyMax = highestLatency[highestLatency.length - 1]?.value || 0;
Expand Down

0 comments on commit 55b0240

Please sign in to comment.