7 Commits

Author SHA1 Message Date
52927bf64d .gitea/workflows/release.yaml aktualisiert
All checks were successful
Release Build and Release / build-and-test (push) Successful in 54s
Release Build and Release / docker-build-and-push (push) Successful in 5m59s
2025-10-01 21:25:27 +02:00
7373ea16e0 .gitea/workflows/release.yaml aktualisiert
All checks were successful
Release Build and Release / build-and-test (push) Successful in 59s
Release Build and Release / docker-build-and-push (push) Successful in 6m22s
2025-10-01 21:16:31 +02:00
9990b35787 Merge pull request 'v0.1.1 Release' (#15) from development into main
Some checks failed
Release Build and Release / build-and-test (push) Successful in 1m14s
Release Build and Release / docker-build-and-push (push) Failing after 11s
Reviewed-on: #15
2025-10-01 21:14:21 +02:00
df7674f063 Merge pull request 'Metrics Fixed' (#14) from bug/sanitize-metrics into development
All checks were successful
Development Build / build-and-test (push) Successful in 1m3s
Development Build / docker-build-and-push (push) Successful in 6m41s
Reviewed-on: #14
2025-10-01 18:20:58 +02:00
9d0a2e40be Metrics Fixed 2025-10-01 18:20:21 +02:00
c8dc8adb0d Merge pull request 'Fixed RAM_LOAD sanitization' (#13) from bug/sanitize-metrics into development
All checks were successful
Development Build / build-and-test (push) Successful in 58s
Development Build / docker-build-and-push (push) Successful in 6m10s
Reviewed-on: #13
2025-10-01 13:17:25 +02:00
0aacf369d7 Fixed RAM_LOAD sanitization 2025-10-01 13:16:43 +02:00
2 changed files with 36 additions and 28 deletions

View File

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

View File

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