|| td->runstate == TD_SETTING_UP
|| td->runstate == TD_RAMP
|| td->runstate == TD_PRE_READING) {
- int t_eta = 0, r_eta = 0;
+ int64_t t_eta = 0, r_eta = 0;
unsigned long long rate_bytes;
/*
t_eta -= ramp_left;
}
}
- rate_bytes = ddir_rw_sum(td->o.rate);
+ rate_bytes = 0;
+ if (td_read(td))
+ rate_bytes = td->o.rate[DDIR_READ];
+ if (td_write(td))
+ rate_bytes += td->o.rate[DDIR_WRITE];
+ if (td_trim(td))
+ rate_bytes += td->o.rate[DDIR_TRIM];
+
if (rate_bytes) {
- r_eta = (bytes_total / 1024) / rate_bytes;
+ r_eta = bytes_total / rate_bytes;
r_eta += (td->o.start_delay / 1000000ULL);
}
static void calc_rate(int unified_rw_rep, unsigned long mtime,
unsigned long long *io_bytes,
- unsigned long long *prev_io_bytes, unsigned int *rate)
+ unsigned long long *prev_io_bytes, uint64_t *rate)
{
int i;
{
struct thread_data *td;
int i, unified_rw_rep;
- unsigned long rate_time, disp_time, bw_avg_time, *eta_secs;
+ uint64_t rate_time, disp_time, bw_avg_time, *eta_secs;
unsigned long long io_bytes[DDIR_RWDIR_CNT];
unsigned long long io_iops[DDIR_RWDIR_CNT];
struct timeval now;
if (!ddir_rw_sum(disp_io_bytes))
fill_start_time(&disp_prev_time);
- eta_secs = malloc(thread_number * sizeof(unsigned long));
- memset(eta_secs, 0, thread_number * sizeof(unsigned long));
+ eta_secs = malloc(thread_number * sizeof(uint64_t));
+ memset(eta_secs, 0, thread_number * sizeof(uint64_t));
je->elapsed_sec = (mtime_since_genesis() + 999) / 1000;