mirror of
https://github.com/MaxenceG2M/prometheus-immich-exporter.git
synced 2025-12-08 14:53:23 +00:00
feat: add CPU usage metrics
This commit is contained in:
@@ -198,6 +198,7 @@ class ImmichMetricsCollector:
|
||||
def get_system_stats(self):
|
||||
loadAvg = os.getloadavg()
|
||||
virtualMem = psutil.virtual_memory()
|
||||
cpu = psutil.cpu_percent(interval=1, percpu=False)
|
||||
return [
|
||||
{
|
||||
"name": f"{self.config['metrics_prefix']}_system_info_loadAverage",
|
||||
@@ -247,6 +248,11 @@ class ImmichMetricsCollector:
|
||||
"help": "Virtual Memory - Free",
|
||||
"labels": {"type": "Free"},
|
||||
},
|
||||
{
|
||||
"name": f"{self.config['metrics_prefix']}_system_info_cpu_usage",
|
||||
"value": cpu,
|
||||
"help": "Representing the current system-wide CPU utilization as a percentage",
|
||||
},
|
||||
]
|
||||
|
||||
def combine_url(self, api_endpoint):
|
||||
|
||||
Reference in New Issue
Block a user