11 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
2d8bf648d9 Merge pull request 'bug/sanitize-metrics' (#12) from bug/sanitize-metrics into development
All checks were successful
Development Build / build-and-test (push) Successful in 1m4s
Development Build / docker-build-and-push (push) Successful in 6m29s
Reviewed-on: #12
2025-10-01 12:58:15 +02:00
85c5a80360 sanitizeDegreeInputs 2025-10-01 12:57:27 +02:00
36e16fbcf9 sanitizemetrics eingeführt 2025-10-01 12:52:45 +02:00
5e2f9e4c3c sanitizeMetrics Funktion erstellt 2025-09-30 12:21:25 +02:00
3 changed files with 62 additions and 47 deletions

View File

@@ -50,13 +50,13 @@ jobs:
uses: docker/login-action@v2
with:
registry: git.triggermeelmo.com
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
username: ${{ secrets.AUTOMATION_USERNAME }}
password: ${{ secrets.AUTOMATION_PASSWORD }}
- name: Build and Push Multi-Arch Docker Image
run: |
docker buildx build \
--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 }} \
--push .

View File

@@ -1,23 +0,0 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the OS, Python version, and other tools you might need
build:
os: ubuntu-24.04
tools:
python: "3.13"
# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# Optionally, but recommended,
# declare the Python requirements required to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt

View File

@@ -55,26 +55,26 @@ public class MetricDto
public double GPU_Temp { get; set; } // deg C
public double GPU_Vram_Size { get; set; } // GB
public double GPU_Vram_Size { get; set; } // Bytes
public double GPU_Vram_Usage { get; set; } // %
public double GPU_Vram_Load { get; set; } // %
// RAM
public double RAM_Size { get; set; } // GB
public double RAM_Size { get; set; } // Bytes
public double RAM_Load { get; set; } // %
// Disks
public double DISK_Size { get; set; } // GB
public double DISK_Size { get; set; } // Bytes
public double DISK_Usage { get; set; } // %
public double DISK_Usage { get; set; } // Bytes
public double DISK_Temp { get; set; } // deg C
public double DISK_Temp { get; set; } // deg C (if available)
// Network
public double NET_In { get; set; } // Bit
public double NET_In { get; set; } // Bytes/s
public double NET_Out { get; set; } // Bit
public double NET_Out { get; set; } // Bytes/s
}
@@ -173,26 +173,28 @@ public class MonitoringController : Controller
if (server != null)
{
// neues Metric-Objekt erstellen
var NewMetric = new Metric
{
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,
GPU_Vram_Size = dto.GPU_Vram_Size,
GPU_Vram_Usage = dto.GPU_Vram_Usage,
RAM_Load = dto.RAM_Load,
RAM_Size = dto.RAM_Size,
DISK_Size = dto.RAM_Size,
DISK_Usage = dto.DISK_Usage,
DISK_Temp = dto.DISK_Temp,
NET_In = dto.NET_In,
NET_Out = dto.NET_Out
CPU_Load = sanitizeInput(dto.CPU_Load),
CPU_Temp = sanitizeInput(dto.CPU_Temp),
GPU_Load = sanitizeInput(dto.GPU_Load),
GPU_Temp = sanitizeInput(dto.GPU_Temp),
GPU_Vram_Size = calculateGigabyte(dto.GPU_Vram_Size),
GPU_Vram_Usage = sanitizeInput(dto.GPU_Vram_Load),
RAM_Load = sanitizeInput(dto.RAM_Load),
RAM_Size = calculateGigabyte(dto.RAM_Size),
DISK_Size = calculateGigabyte(dto.DISK_Size),
DISK_Usage = calculateGigabyte(dto.DISK_Usage),
DISK_Temp = sanitizeInput(dto.DISK_Temp),
NET_In = calculateMegabit(dto.NET_In),
NET_Out = calculateMegabit(dto.NET_Out)
};
try
{
// Metric Objekt in Datenbank einfügen
_context.Metrics.Add(NewMetric);
await _context.SaveChangesAsync();
@@ -281,4 +283,40 @@ public class MonitoringController : Controller
return Ok(data);
}
// Metric Input Byte zu Gigabyte umwandeln
public static double calculateGigabyte(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;
}
// 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
public static double sanitizeInput(double metric_input)
{
Math.Round(metric_input, 2);
return metric_input;
}
}