Compare commits
11 Commits
32a6c0d108
...
main
Author | SHA1 | Date | |
---|---|---|---|
52927bf64d | |||
7373ea16e0 | |||
9990b35787 | |||
df7674f063 | |||
9d0a2e40be | |||
c8dc8adb0d | |||
0aacf369d7 | |||
2d8bf648d9 | |||
85c5a80360 | |||
36e16fbcf9 | |||
5e2f9e4c3c |
@@ -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 .
|
||||||
|
@@ -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
|
|
||||||
|
|
@@ -55,26 +55,26 @@ public class MetricDto
|
|||||||
|
|
||||||
public double GPU_Temp { get; set; } // deg C
|
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
|
// RAM
|
||||||
public double RAM_Size { get; set; } // GB
|
public double RAM_Size { get; set; } // Bytes
|
||||||
|
|
||||||
public double RAM_Load { get; set; } // %
|
public double RAM_Load { get; set; } // %
|
||||||
|
|
||||||
// Disks
|
// 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
|
// 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)
|
if (server != null)
|
||||||
{
|
{
|
||||||
|
// neues Metric-Objekt erstellen
|
||||||
var NewMetric = new Metric
|
var NewMetric = new Metric
|
||||||
{
|
{
|
||||||
Timestamp = DateTime.UtcNow,
|
Timestamp = DateTime.UtcNow,
|
||||||
ServerId = dto.ServerId,
|
ServerId = dto.ServerId,
|
||||||
CPU_Load = dto.CPU_Load,
|
CPU_Load = sanitizeInput(dto.CPU_Load),
|
||||||
CPU_Temp = dto.CPU_Temp,
|
CPU_Temp = sanitizeInput(dto.CPU_Temp),
|
||||||
GPU_Load = dto.GPU_Load,
|
GPU_Load = sanitizeInput(dto.GPU_Load),
|
||||||
GPU_Temp = dto.GPU_Temp,
|
GPU_Temp = sanitizeInput(dto.GPU_Temp),
|
||||||
GPU_Vram_Size = dto.GPU_Vram_Size,
|
GPU_Vram_Size = calculateGigabyte(dto.GPU_Vram_Size),
|
||||||
GPU_Vram_Usage = dto.GPU_Vram_Usage,
|
GPU_Vram_Usage = sanitizeInput(dto.GPU_Vram_Load),
|
||||||
RAM_Load = dto.RAM_Load,
|
RAM_Load = sanitizeInput(dto.RAM_Load),
|
||||||
RAM_Size = dto.RAM_Size,
|
RAM_Size = calculateGigabyte(dto.RAM_Size),
|
||||||
DISK_Size = dto.RAM_Size,
|
DISK_Size = calculateGigabyte(dto.DISK_Size),
|
||||||
DISK_Usage = dto.DISK_Usage,
|
DISK_Usage = calculateGigabyte(dto.DISK_Usage),
|
||||||
DISK_Temp = dto.DISK_Temp,
|
DISK_Temp = sanitizeInput(dto.DISK_Temp),
|
||||||
NET_In = dto.NET_In,
|
NET_In = calculateMegabit(dto.NET_In),
|
||||||
NET_Out = dto.NET_Out
|
NET_Out = calculateMegabit(dto.NET_Out)
|
||||||
};
|
};
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// Metric Objekt in Datenbank einfügen
|
||||||
_context.Metrics.Add(NewMetric);
|
_context.Metrics.Add(NewMetric);
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
@@ -281,4 +283,40 @@ public class MonitoringController : Controller
|
|||||||
|
|
||||||
return Ok(data);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user