move most old PIMap iterators to new

Documentation of PIVector, PIMap and PIMapIterator
This commit is contained in:
2020-08-03 01:43:23 +03:00
parent df457a1602
commit 427e7411c1
8 changed files with 280 additions and 70 deletions

View File

@@ -331,9 +331,10 @@ void PISystemMonitor::run() {
tstat.cpu_load_system = piClampf(tstat.cpu_load_system, 0.f, 100.f);
tstat.cpu_load_user = piClampf(tstat.cpu_load_user , 0.f, 100.f);
for (PIMap<llong, ThreadStats>::iterator i = cur_tm.begin(); i != cur_tm.end(); ++i) {
auto i = cur_tm.makeIterator();
while (i.next()) {
if (!last_tm.contains(i.key())) continue;
ThreadStats & ts_new(i.value());
ThreadStats & ts_new(i.valueRef());
ThreadStats & ts_old(last_tm[i.key()]);
ts_new.cpu_load_kernel = calcThreadUsage(ts_new.kernel_time, ts_old.kernel_time);
ts_new.cpu_load_user = calcThreadUsage(ts_new.user_time, ts_old.user_time);