updtae
This commit is contained in:
parent
130dfcdf56
commit
ef2e104172
|
|
@ -19,11 +19,6 @@ include 'header.php'; ?>
|
||||||
<div class="chart-wrap"><canvas id="ramChart"></canvas></div>
|
<div class="chart-wrap"><canvas id="ramChart"></canvas></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<h3>Intel iGPU (%)</h3>
|
|
||||||
<div class="chart-wrap"><canvas id="gpuChart"></canvas></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h3>Network (KB/s)</h3>
|
<h3>Network (KB/s)</h3>
|
||||||
<div class="chart-wrap"><canvas id="netChart"></canvas></div>
|
<div class="chart-wrap"><canvas id="netChart"></canvas></div>
|
||||||
|
|
@ -33,6 +28,11 @@ include 'header.php'; ?>
|
||||||
<h3>Disk I/O (KB/s) & Disk %</h3>
|
<h3>Disk I/O (KB/s) & Disk %</h3>
|
||||||
<div class="chart-wrap"><canvas id="diskChart"></canvas></div>
|
<div class="chart-wrap"><canvas id="diskChart"></canvas></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<h3>Intel iGPU (%)</h3>
|
||||||
|
<div class="chart-wrap"><canvas id="gpuChart"></canvas></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="margin-top:12px; color:#9fb2d6; display:flex; justify-content:space-between;">
|
<div style="margin-top:12px; color:#9fb2d6; display:flex; justify-content:space-between;">
|
||||||
|
|
|
||||||
26
install.sh
26
install.sh
|
|
@ -273,25 +273,19 @@ _prev_disk=psutil.disk_io_counters()
|
||||||
_prev_time=time.time()
|
_prev_time=time.time()
|
||||||
|
|
||||||
def igpu_percent():
|
def igpu_percent():
|
||||||
# fastest method (modern kernels)
|
|
||||||
for card in ("card0","card1","card2"):
|
|
||||||
p=f"/sys/class/drm/{card}/gt_busy_percent"
|
|
||||||
if os.path.exists(p):
|
|
||||||
try:
|
|
||||||
return float(open(p).read().strip())
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# fallback: intel_gpu_top JSON snapshot
|
|
||||||
try:
|
try:
|
||||||
out=subprocess.check_output(
|
out = subprocess.check_output(
|
||||||
["intel_gpu_top","-J","-s","100","-o","-"],
|
["intel_gpu_top","-J","-s","200","-o","-"],
|
||||||
stderr=subprocess.DEVNULL,
|
stderr=subprocess.DEVNULL,
|
||||||
timeout=1
|
timeout=2
|
||||||
)
|
)
|
||||||
j=json.loads(out.splitlines()[0])
|
line = out.decode().splitlines()[0]
|
||||||
return float(j["engines"]["Render/3D/0"]["busy"])
|
data = json.loads(line)
|
||||||
except:
|
engines = data.get("engines",{})
|
||||||
|
if not engines:
|
||||||
|
return 0.0
|
||||||
|
return round(max(v.get("busy",0) for v in engines.values()),2)
|
||||||
|
except Exception:
|
||||||
return 0.0
|
return 0.0
|
||||||
|
|
||||||
def sample_once():
|
def sample_once():
|
||||||
|
|
|
||||||
26
setup.sh
26
setup.sh
|
|
@ -202,25 +202,19 @@ _prev_disk=psutil.disk_io_counters()
|
||||||
_prev_time=time.time()
|
_prev_time=time.time()
|
||||||
|
|
||||||
def igpu_percent():
|
def igpu_percent():
|
||||||
# fastest method (modern kernels)
|
|
||||||
for card in ("card0","card1","card2"):
|
|
||||||
p=f"/sys/class/drm/{card}/gt_busy_percent"
|
|
||||||
if os.path.exists(p):
|
|
||||||
try:
|
|
||||||
return float(open(p).read().strip())
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# fallback: intel_gpu_top JSON snapshot
|
|
||||||
try:
|
try:
|
||||||
out=subprocess.check_output(
|
out = subprocess.check_output(
|
||||||
["intel_gpu_top","-J","-s","100","-o","-"],
|
["intel_gpu_top","-J","-s","200","-o","-"],
|
||||||
stderr=subprocess.DEVNULL,
|
stderr=subprocess.DEVNULL,
|
||||||
timeout=1
|
timeout=2
|
||||||
)
|
)
|
||||||
j=json.loads(out.splitlines()[0])
|
line = out.decode().splitlines()[0]
|
||||||
return float(j["engines"]["Render/3D/0"]["busy"])
|
data = json.loads(line)
|
||||||
except:
|
engines = data.get("engines",{})
|
||||||
|
if not engines:
|
||||||
|
return 0.0
|
||||||
|
return round(max(v.get("busy",0) for v in engines.values()),2)
|
||||||
|
except Exception:
|
||||||
return 0.0
|
return 0.0
|
||||||
|
|
||||||
def sample_once():
|
def sample_once():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue