Abstract out and export summation of thread_stats
[fio.git] / stat.h
diff --git a/stat.h b/stat.h
index 507a76a9689c703883a84d54535671a217c91a91..a35f9b1a327f21db80d55c298f4947d595b63fba 100644 (file)
--- a/stat.h
+++ b/stat.h
@@ -115,8 +115,8 @@ struct group_run_stats {
 struct thread_stat {
        char name[FIO_JOBNAME_SIZE];
        char verror[FIO_VERROR_SIZE];
-       int32_t error;
-       int32_t groupid;
+       uint32_t error;
+       uint32_t groupid;
        uint32_t pid;
        char description[FIO_JOBNAME_SIZE];
        uint32_t members;
@@ -128,6 +128,7 @@ struct thread_stat {
        struct io_stat slat_stat[2];            /* submission latency */
        struct io_stat lat_stat[2];             /* total latency */
        struct io_stat bw_stat[2];              /* bandwidth stats */
+       struct io_stat iops_stat[2];            /* IOPS stats */
 
        /*
         * fio system usage accounting
@@ -141,7 +142,7 @@ struct thread_stat {
         * IO depth and latency stats
         */
        uint64_t clat_percentiles;
-       double *percentile_list;
+       fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN];
 
        uint32_t io_u_map[FIO_IO_U_MAP_NR];
        uint32_t io_u_submit[FIO_IO_U_MAP_NR];
@@ -163,13 +164,35 @@ struct thread_stat {
         */
        uint16_t continue_on_error;
        uint64_t total_err_count;
-       int32_t first_error;
+       uint32_t first_error;
 
        uint32_t kb_base;
 };
 
+struct jobs_eta {
+       uint32_t nr_running;
+       uint32_t nr_ramp;
+       uint32_t nr_pending;
+       uint32_t files_open;
+       uint32_t m_rate, t_rate;
+       uint32_t m_iops, t_iops;
+       uint32_t rate[2];
+       uint32_t iops[2];
+       uint64_t elapsed_sec;
+       uint64_t eta_sec;
+
+       /*
+        * Network 'copy' of run_str[]
+        */
+       uint32_t nr_threads;
+       uint8_t run_str[0];
+};
+
 extern void show_thread_status(struct thread_stat *ts, struct group_run_stats *rs);
 extern void show_group_stats(struct group_run_stats *rs);
-
+extern int calc_thread_status(struct jobs_eta *je, int force);
+extern void display_thread_status(struct jobs_eta *je);
+extern void show_run_stats(void);
+extern void sum_thread_stats(struct thread_stat *dst, struct thread_stat *src, int nr);
 
 #endif