Lines Matching refs:je
321 int calc_thread_status(struct jobs_eta *je, int force) in calc_thread_status() argument
354 je->elapsed_sec = (mtime_since_genesis() + 999) / 1000; in calc_thread_status()
363 je->is_pow2 = 1; in calc_thread_status()
364 je->unit_base = td->o.unit_base; in calc_thread_status()
371 je->nr_running++; in calc_thread_status()
373 je->t_rate[0] += td->o.rate[DDIR_READ]; in calc_thread_status()
374 je->t_iops[0] += td->o.rate_iops[DDIR_READ]; in calc_thread_status()
375 je->m_rate[0] += td->o.ratemin[DDIR_READ]; in calc_thread_status()
376 je->m_iops[0] += td->o.rate_iops_min[DDIR_READ]; in calc_thread_status()
379 je->t_rate[1] += td->o.rate[DDIR_WRITE]; in calc_thread_status()
380 je->t_iops[1] += td->o.rate_iops[DDIR_WRITE]; in calc_thread_status()
381 je->m_rate[1] += td->o.ratemin[DDIR_WRITE]; in calc_thread_status()
382 je->m_iops[1] += td->o.rate_iops_min[DDIR_WRITE]; in calc_thread_status()
385 je->t_rate[2] += td->o.rate[DDIR_TRIM]; in calc_thread_status()
386 je->t_iops[2] += td->o.rate_iops[DDIR_TRIM]; in calc_thread_status()
387 je->m_rate[2] += td->o.ratemin[DDIR_TRIM]; in calc_thread_status()
388 je->m_iops[2] += td->o.rate_iops_min[DDIR_TRIM]; in calc_thread_status()
391 je->files_open += td->nr_open_files; in calc_thread_status()
393 je->nr_running++; in calc_thread_status()
394 je->nr_ramp++; in calc_thread_status()
396 je->nr_setting_up++; in calc_thread_status()
398 je->nr_pending++; in calc_thread_status()
400 if (je->elapsed_sec >= 3) in calc_thread_status()
423 je->eta_sec = INT_MAX; in calc_thread_status()
425 je->eta_sec = 0; in calc_thread_status()
429 if (eta_secs[i] < je->eta_sec) in calc_thread_status()
430 je->eta_sec = eta_secs[i]; in calc_thread_status()
432 if (eta_secs[i] > je->eta_sec) in calc_thread_status()
433 je->eta_sec = eta_secs[i]; in calc_thread_status()
444 je->rate); in calc_thread_status()
446 add_agg_sample(je->rate[DDIR_READ], DDIR_READ, 0); in calc_thread_status()
447 add_agg_sample(je->rate[DDIR_WRITE], DDIR_WRITE, 0); in calc_thread_status()
448 add_agg_sample(je->rate[DDIR_TRIM], DDIR_TRIM, 0); in calc_thread_status()
459 calc_rate(unified_rw_rep, disp_time, io_bytes, disp_io_bytes, je->rate); in calc_thread_status()
460 calc_iops(unified_rw_rep, disp_time, io_iops, disp_io_iops, je->iops); in calc_thread_status()
464 if (!force && !je->nr_running && !je->nr_pending) in calc_thread_status()
467 je->nr_threads = thread_number; in calc_thread_status()
469 memcpy(je->run_str, run_str, strlen(run_str)); in calc_thread_status()
473 void display_thread_status(struct jobs_eta *je) in display_thread_status() argument
483 if (je->eta_sec != INT_MAX && je->elapsed_sec) { in display_thread_status()
484 perc = (double) je->elapsed_sec / (double) (je->elapsed_sec + je->eta_sec); in display_thread_status()
485 eta_to_str(eta_str, je->eta_sec); in display_thread_status()
493 p += sprintf(p, "Jobs: %d (f=%d)", je->nr_running, je->files_open); in display_thread_status()
494 if (je->m_rate[0] || je->m_rate[1] || je->t_rate[0] || je->t_rate[1]) { in display_thread_status()
497 mr = num2str(je->m_rate[0] + je->m_rate[1], 4, 0, je->is_pow2, 8); in display_thread_status()
498 tr = num2str(je->t_rate[0] + je->t_rate[1], 4, 0, je->is_pow2, 8); in display_thread_status()
502 } else if (je->m_iops[0] || je->m_iops[1] || je->t_iops[0] || je->t_iops[1]) { in display_thread_status()
504 je->t_iops[0] + je->t_iops[1], in display_thread_status()
505 je->m_iops[0] + je->m_iops[1]); in display_thread_status()
507 if (je->eta_sec != INT_MAX && je->nr_running) { in display_thread_status()
515 if ((!je->eta_sec && !eta_good) || je->nr_ramp == je->nr_running) in display_thread_status()
520 if (je->nr_setting_up && je->nr_running) in display_thread_status()
521 mult *= (1.0 - (double) je->nr_setting_up / (double) je->nr_running); in display_thread_status()
529 rate_str[ddir] = num2str(je->rate[ddir], 5, in display_thread_status()
530 1024, je->is_pow2, je->unit_base); in display_thread_status()
531 iops_str[ddir] = num2str(je->iops[ddir], 4, 1, 0, 0); in display_thread_status()
537 je->run_str, perc_str, rate_str[DDIR_READ], in display_thread_status()
568 struct jobs_eta *je; in get_jobs_eta() local
573 *size = sizeof(*je) + THREAD_RUNSTR_SZ; in get_jobs_eta()
574 je = malloc(*size); in get_jobs_eta()
575 if (!je) in get_jobs_eta()
577 memset(je, 0, *size); in get_jobs_eta()
579 if (!calc_thread_status(je, force)) { in get_jobs_eta()
580 free(je); in get_jobs_eta()
584 *size = sizeof(*je) + strlen((char *) je->run_str) + 1; in get_jobs_eta()
585 return je; in get_jobs_eta()
590 struct jobs_eta *je; in print_thread_status() local
593 je = get_jobs_eta(0, &size); in print_thread_status()
594 if (je) in print_thread_status()
595 display_thread_status(je); in print_thread_status()
597 free(je); in print_thread_status()