init
PostgreSQL integration / tests (push) Has been cancelled

This commit is contained in:
ms
2026-11-09 13:15:48 +01:00
parent 4fb7613689
commit 2c1c48df0c
78 changed files with 2707 additions and 176 deletions
+14
View File
@@ -0,0 +1,14 @@
import io,threading
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
_lock=threading.Lock()
def heatmap(rows):
with _lock:
fig,ax=plt.subplots(figsize=(9,max(3,len(rows)*.35+1.5)))
values=np.array([[r['cpu'],r['ram'],r['disk']] for r in rows],dtype=float)
sns.heatmap(values,annot=True,fmt='.1f',vmin=0,vmax=100,cmap='YlGnBu',xticklabels=['CPU %','RAM %','Disk %'],yticklabels=[r['server__name'] for r in rows],ax=ax,cbar_kws={'label':'Auslastung (%)'})
ax.set_title('dilib Operations · Mittlere Ressourcenauslastung',pad=18)
fig.tight_layout(); b=io.BytesIO();fig.savefig(b,format='png',dpi=140);plt.close(fig);return b.getvalue()