mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui-library.git
synced 2025-11-20 11:54:49 +00:00
hotfix/WIFI-1017: Displayed plotting stats in AP Details OS Stats page
This commit is contained in:
@@ -18,33 +18,29 @@ const processMetrics = data => {
|
|||||||
const cpuUtilCores = {};
|
const cpuUtilCores = {};
|
||||||
const freeMemory = [];
|
const freeMemory = [];
|
||||||
const cpuTemperature = [];
|
const cpuTemperature = [];
|
||||||
const timeStamp = [];
|
|
||||||
|
|
||||||
data.forEach(i => {
|
data.forEach(i => {
|
||||||
if (i?.detailsJSON?.apPerformance) {
|
if (i?.detailsJSON?.apPerformance) {
|
||||||
freeMemory.push(i.detailsJSON.apPerformance.freeMemory);
|
const time = parseInt(i.createdTimestamp, []);
|
||||||
cpuTemperature.push(i.detailsJSON.apPerformance.cpuTemperature);
|
freeMemory.push([time, i.detailsJSON.apPerformance.freeMemory]);
|
||||||
// eslint-disable-next-line radix
|
cpuTemperature.push([time, i.detailsJSON.apPerformance.cpuTemperature]);
|
||||||
timeStamp.push(parseInt(i.createdTimestamp));
|
|
||||||
i.detailsJSON.apPerformance.cpuUtilized.forEach((j, index) => {
|
i.detailsJSON.apPerformance.cpuUtilized.forEach((j, index) => {
|
||||||
if (!(index in cpuUtilCores)) {
|
if (!(index in cpuUtilCores)) {
|
||||||
cpuUtilCores[index] = [];
|
cpuUtilCores[index] = [];
|
||||||
}
|
}
|
||||||
cpuUtilCores[index].push(j);
|
cpuUtilCores[index].push([time, j]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return { cpuUtilCores, freeMemory, cpuTemperature, timeStamp };
|
return { cpuUtilCores, freeMemory, cpuTemperature };
|
||||||
};
|
};
|
||||||
|
|
||||||
const HighChartGraph = ({ osData }) => {
|
const HighChartGraph = ({ osData }) => {
|
||||||
const dateTimeLabelFormats = {
|
const dateTimeLabelFormats = {
|
||||||
millisecond: '%l:%M:%S%P',
|
minute: '%l:%M%P',
|
||||||
second: '%l:%M:%S%P',
|
hour: '%l:%M%P',
|
||||||
minute: '%l:%M:%S%P',
|
day: '%a. %l:%M%P',
|
||||||
hour: '%l:%M:%S%P',
|
|
||||||
day: '%a. %l:%M:%S%P',
|
|
||||||
week: '',
|
week: '',
|
||||||
month: '',
|
month: '',
|
||||||
year: '',
|
year: '',
|
||||||
@@ -61,21 +57,20 @@ const HighChartGraph = ({ osData }) => {
|
|||||||
}, [osData]);
|
}, [osData]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HighchartsStockChart data-testid="highchartsGraph">
|
<HighchartsStockChart
|
||||||
|
data-testid="highchartsGraph"
|
||||||
|
time={{
|
||||||
|
useUTC: false,
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Chart zoomType="x" backgroundColor="#141414" />
|
<Chart zoomType="x" backgroundColor="#141414" />
|
||||||
|
|
||||||
<Tooltip split={false} shared useHTML />
|
<Tooltip split={false} shared useHTML xDateFormat="%b %e %Y %l:%M:%S%P" />
|
||||||
<XAxis
|
<XAxis
|
||||||
tickPixelInterval={90}
|
tickPixelInterval={90}
|
||||||
dateTimeLabelFormats={dateTimeLabelFormats}
|
dateTimeLabelFormats={dateTimeLabelFormats}
|
||||||
offset={20}
|
offset={20}
|
||||||
type="datetime"
|
type="datetime"
|
||||||
categories={metrics.timeStamp}
|
|
||||||
labels={{
|
|
||||||
formatter: i => {
|
|
||||||
return new Date(i.value).toUTCString();
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<XAxis.Title>Time</XAxis.Title>
|
<XAxis.Title>Time</XAxis.Title>
|
||||||
</XAxis>
|
</XAxis>
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ const LineChart = ({ title, data, options }) => {
|
|||||||
split={false}
|
split={false}
|
||||||
shared
|
shared
|
||||||
useHTML
|
useHTML
|
||||||
xDateFormat="%b %e %Y %l:%M%P"
|
xDateFormat="%b %e %Y %l:%M:%S%P"
|
||||||
pointFormatter={options.tooltipFormatter ? options.tooltipFormatter : null}
|
pointFormatter={options.tooltipFormatter ? options.tooltipFormatter : null}
|
||||||
/>
|
/>
|
||||||
<Legend>
|
<Legend>
|
||||||
|
|||||||
Reference in New Issue
Block a user