sanitizeDegreeInputs
This commit is contained in:
@@ -178,17 +178,17 @@ public class MonitoringController : Controller
|
||||
{
|
||||
Timestamp = DateTime.UtcNow,
|
||||
ServerId = dto.ServerId,
|
||||
CPU_Load = dto.CPU_Load,
|
||||
CPU_Temp = dto.CPU_Temp,
|
||||
GPU_Load = dto.GPU_Load,
|
||||
GPU_Temp = dto.GPU_Temp,
|
||||
CPU_Load = sanitizeLoadInput(dto.CPU_Load),
|
||||
CPU_Temp = sanitizeDegreeInput(dto.CPU_Temp),
|
||||
GPU_Load = sanitizeLoadInput(dto.GPU_Load),
|
||||
GPU_Temp = sanitizeDegreeInput(dto.GPU_Temp),
|
||||
GPU_Vram_Size = sanitizeByteInput(dto.GPU_Vram_Size),
|
||||
GPU_Vram_Usage = dto.GPU_Vram_Usage,
|
||||
GPU_Vram_Usage = sanitizeLoadInput(dto.GPU_Vram_Usage),
|
||||
RAM_Load = sanitizeByteInput(dto.RAM_Load),
|
||||
RAM_Size = sanitizeByteInput(dto.RAM_Size),
|
||||
DISK_Size = sanitizeByteInput(dto.DISK_Size),
|
||||
DISK_Usage = sanitizeByteInput(dto.DISK_Usage),
|
||||
DISK_Temp = dto.DISK_Temp,
|
||||
DISK_Temp = sanitizeDegreeInput(dto.DISK_Temp),
|
||||
NET_In = sanitizeByteInput(dto.NET_In),
|
||||
NET_Out = sanitizeByteInput(dto.NET_Out)
|
||||
};
|
||||
@@ -292,9 +292,23 @@ public class MonitoringController : Controller
|
||||
|
||||
// Auf 2 Nachkommastellen runden
|
||||
Math.Round(sanitizedMetric, 2);
|
||||
|
||||
|
||||
return sanitizedMetric;
|
||||
}
|
||||
|
||||
// Metric Input Bit zu Gigabit umwandeln
|
||||
// Degree Input auf zwei Nachkommastellen runden
|
||||
public static double sanitizeDegreeInput(double metric_input)
|
||||
{
|
||||
Math.Round(metric_input, 2);
|
||||
|
||||
return metric_input;
|
||||
}
|
||||
|
||||
// Load Input auf zwei Nachkommastellen runden
|
||||
public static double sanitizeLoadInput(double metric_input)
|
||||
{
|
||||
Math.Round(metric_input, 2);
|
||||
|
||||
return metric_input;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user