Display the representation % of players in metrics
This commit is contained in:
parent
65efdb91b9
commit
299b7ff6de
@ -1,5 +1,5 @@
|
|||||||
import { CheckCircleOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
import { CheckCircleOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
||||||
import { Alert, Button, Col, Row, Statistic } from 'antd';
|
import { Alert, Button, Col, Row, Statistic, Typography } from 'antd';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import React, { useContext } from 'react';
|
import React, { useContext } from 'react';
|
||||||
import { ServerStatusContext } from '../utils/server-status-context';
|
import { ServerStatusContext } from '../utils/server-status-context';
|
||||||
@ -12,7 +12,7 @@ export default function StreamHealthOverview() {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { healthy, healthPercentage, message } = health;
|
const { healthy, healthPercentage, message, representation } = health;
|
||||||
console.log(healthPercentage);
|
console.log(healthPercentage);
|
||||||
let color = '#3f8600';
|
let color = '#3f8600';
|
||||||
let icon: 'success' | 'info' | 'warning' | 'error' = 'info';
|
let icon: 'success' | 'info' | 'warning' | 'error' = 'info';
|
||||||
@ -44,6 +44,15 @@ export default function StreamHealthOverview() {
|
|||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
<Row style={{ display: representation < 100 ? 'grid' : 'none' }}>
|
||||||
|
<Typography.Text
|
||||||
|
type="secondary"
|
||||||
|
style={{ textAlign: 'center', fontSize: '0.7em', opacity: '0.3' }}
|
||||||
|
>
|
||||||
|
Stream health represents {representation}% of all known players. Other player status is
|
||||||
|
unknown.
|
||||||
|
</Typography.Text>
|
||||||
|
</Row>
|
||||||
<Row gutter={16} style={{ display: message ? 'grid' : 'none', marginTop: '10px' }}>
|
<Row gutter={16} style={{ display: message ? 'grid' : 'none', marginTop: '10px' }}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Alert
|
<Alert
|
||||||
|
@ -47,6 +47,7 @@ export default function StreamHealth() {
|
|||||||
const [maximumPlayerBitrate, setMaximumPlayerBitrate] = useState<TimedValue[]>([]);
|
const [maximumPlayerBitrate, setMaximumPlayerBitrate] = useState<TimedValue[]>([]);
|
||||||
const [availableBitrates, setAvailableBitrates] = useState<Number[]>([]);
|
const [availableBitrates, setAvailableBitrates] = useState<Number[]>([]);
|
||||||
const [segmentLength, setSegmentLength] = useState(0);
|
const [segmentLength, setSegmentLength] = useState(0);
|
||||||
|
const [representation, setRepresentation] = useState(0);
|
||||||
|
|
||||||
const getMetrics = async () => {
|
const getMetrics = async () => {
|
||||||
try {
|
try {
|
||||||
@ -68,6 +69,7 @@ export default function StreamHealth() {
|
|||||||
|
|
||||||
setAvailableBitrates(result.availableBitrates);
|
setAvailableBitrates(result.availableBitrates);
|
||||||
setSegmentLength(result.segmentLength - 0.3);
|
setSegmentLength(result.segmentLength - 0.3);
|
||||||
|
setRepresentation(result.representation);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
@ -303,6 +305,13 @@ export default function StreamHealth() {
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
|
<div style={{ textAlign: 'center', display: representation < 100 ? 'grid' : 'none' }}>
|
||||||
|
<Typography.Paragraph style={{ opacity: '0.7', fontSize: '0.7em' }}>
|
||||||
|
Provided playback metrics represent {representation}% of all known players. Specifics
|
||||||
|
around other players consuming this video stream are unknown.
|
||||||
|
</Typography.Paragraph>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Card>
|
<Card>
|
||||||
<DescriptionBox
|
<DescriptionBox
|
||||||
title="Video Segment Download"
|
title="Video Segment Download"
|
||||||
|
@ -129,6 +129,7 @@ export interface Health {
|
|||||||
healthy: boolean;
|
healthy: boolean;
|
||||||
healthyPercentage: number;
|
healthyPercentage: number;
|
||||||
message: string;
|
message: string;
|
||||||
|
representation: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ConfigDetails {
|
export interface ConfigDetails {
|
||||||
|
@ -93,6 +93,7 @@ const initialServerStatusState = {
|
|||||||
healthy: true,
|
healthy: true,
|
||||||
healthPercentage: 100,
|
healthPercentage: 100,
|
||||||
message: '',
|
message: '',
|
||||||
|
representation: 0,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user