1 //test_types.h 2 3 #ifndef _TEST_TYPES_H 4 #define _TEST_TYPES_H 5 6 #define FILE_TYPE_COUNT 6 7 #define MAX_STORAGE_COUNT 5 8 9 #define STAT_FILENAME_BY_FILE_TYPE "stat_by_file_type" 10 #define STAT_FILENAME_BY_STORAGE_IP "stat_by_storage_ip" 11 #define STAT_FILENAME_BY_OVERALL "stat_by_overall" 12 13 #define FILENAME_FILE_ID "file_id" 14 #define FILENAME_FAIL "fail" 15 16 #define IP_ADDRESS_SIZE 16 17 #define SRAND_SEED 1225420780 18 19 #define TIME_SUB_MS(tv1, tv2) ((tv1.tv_sec - tv2.tv_sec) * 1000 + (tv1.tv_usec - tv2.tv_usec) / 1000) 20 21 typedef struct { 22 char ip_addr[IP_ADDRESS_SIZE]; 23 int total_count; 24 int success_count; 25 int64_t time_used; 26 } StorageStat; 27 28 typedef struct { 29 char id[64]; 30 int total_count; 31 int success_count; 32 int64_t time_used; 33 } EntryStat; 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 39 #ifdef __cplusplus 40 } 41 #endif 42 43 #endif 44