Compare commits
7 Commits
2d8bf648d9
...
main
Author | SHA1 | Date | |
---|---|---|---|
52927bf64d | |||
7373ea16e0 | |||
9990b35787 | |||
df7674f063 | |||
9d0a2e40be | |||
c8dc8adb0d | |||
0aacf369d7 |
@@ -50,13 +50,13 @@ jobs:
|
|||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: git.triggermeelmo.com
|
registry: git.triggermeelmo.com
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.AUTOMATION_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.AUTOMATION_PASSWORD }}
|
||||||
|
|
||||||
- name: Build and Push Multi-Arch Docker Image
|
- name: Build and Push Multi-Arch Docker Image
|
||||||
run: |
|
run: |
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform ${{ env.DOCKER_PLATFORMS }} \
|
--platform ${{ env.DOCKER_PLATFORMS }} \
|
||||||
-t ${{ env.REGISTRY_URL }}/${{ env.DOCKER_IMAGE_NAME }}:v0.1.0 \
|
-t ${{ env.REGISTRY_URL }}/${{ env.DOCKER_IMAGE_NAME }}:v0.1.1 \
|
||||||
-t ${{ env.REGISTRY_URL }}/${{ env.DOCKER_IMAGE_NAME }}:${{ github.sha }} \
|
-t ${{ env.REGISTRY_URL }}/${{ env.DOCKER_IMAGE_NAME }}:${{ github.sha }} \
|
||||||
--push .
|
--push .
|
||||||
|
@@ -57,7 +57,7 @@ public class MetricDto
|
|||||||
|
|
||||||
public double GPU_Vram_Size { get; set; } // Bytes
|
public double GPU_Vram_Size { get; set; } // Bytes
|
||||||
|
|
||||||
public double GPU_Vram_Usage { get; set; } // %
|
public double GPU_Vram_Load { get; set; } // %
|
||||||
|
|
||||||
// RAM
|
// RAM
|
||||||
public double RAM_Size { get; set; } // Bytes
|
public double RAM_Size { get; set; } // Bytes
|
||||||
@@ -178,19 +178,19 @@ public class MonitoringController : Controller
|
|||||||
{
|
{
|
||||||
Timestamp = DateTime.UtcNow,
|
Timestamp = DateTime.UtcNow,
|
||||||
ServerId = dto.ServerId,
|
ServerId = dto.ServerId,
|
||||||
CPU_Load = sanitizeLoadInput(dto.CPU_Load),
|
CPU_Load = sanitizeInput(dto.CPU_Load),
|
||||||
CPU_Temp = sanitizeDegreeInput(dto.CPU_Temp),
|
CPU_Temp = sanitizeInput(dto.CPU_Temp),
|
||||||
GPU_Load = sanitizeLoadInput(dto.GPU_Load),
|
GPU_Load = sanitizeInput(dto.GPU_Load),
|
||||||
GPU_Temp = sanitizeDegreeInput(dto.GPU_Temp),
|
GPU_Temp = sanitizeInput(dto.GPU_Temp),
|
||||||
GPU_Vram_Size = sanitizeByteInput(dto.GPU_Vram_Size),
|
GPU_Vram_Size = calculateGigabyte(dto.GPU_Vram_Size),
|
||||||
GPU_Vram_Usage = sanitizeLoadInput(dto.GPU_Vram_Usage),
|
GPU_Vram_Usage = sanitizeInput(dto.GPU_Vram_Load),
|
||||||
RAM_Load = sanitizeByteInput(dto.RAM_Load),
|
RAM_Load = sanitizeInput(dto.RAM_Load),
|
||||||
RAM_Size = sanitizeByteInput(dto.RAM_Size),
|
RAM_Size = calculateGigabyte(dto.RAM_Size),
|
||||||
DISK_Size = sanitizeByteInput(dto.DISK_Size),
|
DISK_Size = calculateGigabyte(dto.DISK_Size),
|
||||||
DISK_Usage = sanitizeByteInput(dto.DISK_Usage),
|
DISK_Usage = calculateGigabyte(dto.DISK_Usage),
|
||||||
DISK_Temp = sanitizeDegreeInput(dto.DISK_Temp),
|
DISK_Temp = sanitizeInput(dto.DISK_Temp),
|
||||||
NET_In = sanitizeByteInput(dto.NET_In),
|
NET_In = calculateMegabit(dto.NET_In),
|
||||||
NET_Out = sanitizeByteInput(dto.NET_Out)
|
NET_Out = calculateMegabit(dto.NET_Out)
|
||||||
};
|
};
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -285,30 +285,38 @@ public class MonitoringController : Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Metric Input Byte zu Gigabyte umwandeln
|
// Metric Input Byte zu Gigabyte umwandeln
|
||||||
public static double sanitizeByteInput(double metric_input)
|
public static double calculateGigabyte(double metric_input)
|
||||||
{
|
{
|
||||||
// *10^-9 um auf Gigabyte zu kommen
|
// *10^-9 um auf Gigabyte zu kommen
|
||||||
double sanitizedMetric = metric_input * Math.Pow(10, -9);
|
double calculatedValue = metric_input * Math.Pow(10, -9);
|
||||||
|
|
||||||
// Auf 2 Nachkommastellen runden
|
// Auf 2 Nachkommastellen runden
|
||||||
Math.Round(sanitizedMetric, 2);
|
double calculatedValue_s = sanitizeInput(calculatedValue);
|
||||||
|
|
||||||
return sanitizedMetric;
|
return calculatedValue_s;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Metric Input Byte/s zu Megabit/s umrechnen
|
||||||
|
//TODO
|
||||||
|
public static double calculateMegabit(double metric_input)
|
||||||
|
{
|
||||||
|
// *10^-9 um auf Gigabyte zu kommen
|
||||||
|
double calculatedValue = metric_input * Math.Pow(10, -9);
|
||||||
|
|
||||||
|
// Auf 2 Nachkommastellen runden
|
||||||
|
double calculatedValue_s = sanitizeInput(calculatedValue);
|
||||||
|
|
||||||
|
return calculatedValue_s;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Degree Input auf zwei Nachkommastellen runden
|
// Degree Input auf zwei Nachkommastellen runden
|
||||||
public static double sanitizeDegreeInput(double metric_input)
|
public static double sanitizeInput(double metric_input)
|
||||||
{
|
{
|
||||||
Math.Round(metric_input, 2);
|
Math.Round(metric_input, 2);
|
||||||
|
|
||||||
return metric_input;
|
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