Lines Matching refs:stat

46 #define RNK(p,a)	(((p)->mode&SHELL_DISABLE)?INT_MAX:((p)->flags&IGN)?(INT_MAX/2):((((p)->stat.load/(p)->scale)+((p)->running*BIAS+CPU((p)->cpu,(a)->bias)))*(p)->bias*(((p)==state.home&&(p)->cpu==1)?400:100)/(p)->rating))
249 ap->stat.up = -LOST;
254 if (ap != state.shell && (ap->override || !IDLE(ap->stat.idle, ap->idle) && (!ap->bypass || !(bypass = miscmatch(ap, ap->bypass)))))
281 if (v < sv && ap->running < (state.perhost ? state.perhost : ap->cpu * state.percpu) && (!state.maxload || (ap->stat.load / ap->scale) < state.maxload) && (!sp || bypass || IDLE(ap->stat.idle, ap->idle) || !IDLE(sp->stat.idle, sp->idle)))
287 else if (!ap->fd && (!mp || ap->rank < mp->rank) && (IDLE(ap->stat.idle, ap->idle) || ap->home || ap->bypass && miscmatch(ap, ap->bypass) || ((a->set | op) & (SETMISC|DEF|NEW|SET)) == SETMISC)) mp = ap;
315 if (sp->override || !IDLE(sp->stat.idle, sp->idle)) sp->mode |= SHELL_OVERRIDE;
388 if (sp != state.shell && (sp->override || !IDLE(sp->stat.idle, sp->idle)))
409 if (a->global.set & SETIDLE) sp->stat.idle = a->stat.idle;
410 if (a->global.set & SETLOAD) sp->stat.load = a->stat.load;
411 if (a->global.set & SETUPDATE) sp->update = a->stat.up;
412 if (a->global.set & SETUSERS) sp->stat.users = a->stat.users;
472 if (csstat(sp->name, &sp->stat))
474 sp->stat.up = 0;
475 sp->stat.idle = -1;
476 sp->stat.load = LOAD;
477 sp->stat.users = 0;
482 if (sp->stat.up < 0)
487 sp->stat.up = 0;
499 n += W_LOAD * (((sp->stat.load / sp->scale) + CPU(sp->cpu, W_JOB * LOAD)) / T_LOAD) * sp->bias / sp->rating;
504 if (sp->stat.idle < sp->idle) n += W_IDLE;
505 else if (sp->stat.idle < R_IDLE * sp->idle) n += W_IDLE * (R_IDLE * sp->idle - sp->stat.idle) / ((R_IDLE - 1) * sp->idle);
507 else if (sp->stat.users && sp->stat.idle < R_USER)
508 n += W_USER * (R_USER - sp->stat.idle) / R_USER;
518 if (sp->stat.up < 0) sp->update = cs.time + CS_STAT_DOWN;
522 if (sp->fd > 0 && (2 * sp->stat.up) < (cs.time - sp->start)) shellclose(sp, -1);
523 if (!sp->fd && !IDLE(sp->stat.idle, sp->idle)) sp->update += sp->idle - sp->stat.idle;
525 message((-4, "%s: %s=%s idle=%s load=%s users=%d rank=%s", sp->name, sp->stat.up < 0 ? "down" : "up", fmtelapsed(sp->stat.up < 0 ? -sp->stat.up : sp->stat.up, 1), fmtelapsed(sp->stat.idle, 1), fmtfloat(sp->stat.load), sp->stat.users, fmtfloat(sp->rank)));
538 struct stat st;