hotfix/WIFI-1017: Displayed plotting stats in AP Details OS Stats page

This commit is contained in:
chris-cosentino
2020-11-04 11:39:43 -05:00
parent 57e3c770dd
commit bd5152bcf8

View File

@@ -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>