mirror of
https://github.com/Telecominfraproject/wlan-cloud-ui-library.git
synced 2025-11-07 14:17:51 +00:00
hotfix/WIFI-1017: Displayed plotting stats in AP Details OS Stats page
This commit is contained in:
@@ -18,11 +18,14 @@ 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);
|
freeMemory.push(i.detailsJSON.apPerformance.freeMemory);
|
||||||
cpuTemperature.push(i.detailsJSON.apPerformance.cpuTemperature);
|
cpuTemperature.push(i.detailsJSON.apPerformance.cpuTemperature);
|
||||||
|
// eslint-disable-next-line radix
|
||||||
|
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] = [];
|
||||||
@@ -32,7 +35,7 @@ const processMetrics = data => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return { cpuUtilCores, freeMemory, cpuTemperature };
|
return { cpuUtilCores, freeMemory, cpuTemperature, timeStamp };
|
||||||
};
|
};
|
||||||
|
|
||||||
const HighChartGraph = ({ osData }) => {
|
const HighChartGraph = ({ osData }) => {
|
||||||
@@ -67,7 +70,12 @@ const HighChartGraph = ({ osData }) => {
|
|||||||
dateTimeLabelFormats={dateTimeLabelFormats}
|
dateTimeLabelFormats={dateTimeLabelFormats}
|
||||||
offset={20}
|
offset={20}
|
||||||
type="datetime"
|
type="datetime"
|
||||||
showEmpty
|
categories={metrics.timeStamp}
|
||||||
|
labels={{
|
||||||
|
formatter: i => {
|
||||||
|
return new Date(i.value).toUTCString();
|
||||||
|
},
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<XAxis.Title>Time</XAxis.Title>
|
<XAxis.Title>Time</XAxis.Title>
|
||||||
</XAxis>
|
</XAxis>
|
||||||
|
|||||||
Reference in New Issue
Block a user