in src/components/graphs/MemorySpecs/memoryMetricsGrid.tsx [246:277]
value: parseFloat(value).toFixed(2), // Limit to 2 decimal places
}));
const formattedData = processMetricData(response?.data?.data || []);
console.log("Formatted Disk IOPS Data:", formattedData);
setDiskIOPSData(formattedData); // Update state with formatted data
setLoadingDiskIOPS(false); // Reset loading state
} catch (error) {
console.error("Error fetching Disk IOPS data:", error);
setErrorDiskIOPS(error?.message || "Failed to fetch Disk IOPS data.");
setLoadingDiskIOPS(false); // Reset loading state on error
}
};
const fetchDiskWaitTimeData = async () => {
if (mode === "offline") {
setDiskWaitTimeData(DiskWaitTimeData?.data?.writeWaitTime);
return;
}
try {
setLoadingDiskIOPS(true); // Indicate loading state
setErrorDiskIOPS(null); // Clear previous errors
const until = new Date().getTime(); // Current time
const from = new Date(until - 1 * 60 * 60 * 1000).getTime(); // Last 1 hour
const step = 14; // Step size in seconds
// Call the backend API
const response = await middlewareApi.post(
"/nodeExporter/getDiskWaitTime",
{