| 876 | } |
| 877 | |
| 878 | static void showLatencyReport(void) { |
| 879 | |
| 880 | const float reqpersec = (float)config.requests_finished/((float)config.totlatency/1000.0f); |
| 881 | const float p0 = ((float) hdr_min(config.latency_histogram))/1000.0f; |
| 882 | const float p50 = hdr_value_at_percentile(config.latency_histogram, 50.0 )/1000.0f; |
| 883 | const float p95 = hdr_value_at_percentile(config.latency_histogram, 95.0 )/1000.0f; |
| 884 | const float p99 = hdr_value_at_percentile(config.latency_histogram, 99.0 )/1000.0f; |
| 885 | const float p100 = ((float) hdr_max(config.latency_histogram))/1000.0f; |
| 886 | const float avg = hdr_mean(config.latency_histogram)/1000.0f; |
| 887 | |
| 888 | if (!config.quiet && !config.csv) { |
| 889 | printf("%*s\r", config.last_printed_bytes, " "); // ensure there is a clean line |
| 890 | printf("====== %s ======\n", config.title); |
| 891 | printf(" %d requests completed in %.2f seconds\n", config.requests_finished, |
| 892 | (float)config.totlatency/1000); |
| 893 | printf(" %d parallel clients\n", config.numclients); |
| 894 | printf(" %d bytes payload\n", config.datasize); |
| 895 | printf(" keep alive: %d\n", config.keepalive); |
| 896 | if (config.cluster_mode) { |
| 897 | printf(" cluster mode: yes (%d masters)\n", |
| 898 | config.cluster_node_count); |
| 899 | int m ; |
| 900 | for (m = 0; m < config.cluster_node_count; m++) { |
| 901 | clusterNode *node = config.cluster_nodes[m]; |
| 902 | redisConfig *cfg = node->redis_config; |
| 903 | if (cfg == NULL) continue; |
| 904 | printf(" node [%d] configuration:\n",m ); |
| 905 | printf(" save: %s\n", |
| 906 | sdslen(cfg->save) ? cfg->save : "NONE"); |
| 907 | printf(" appendonly: %s\n", cfg->appendonly); |
| 908 | } |
| 909 | } else { |
| 910 | if (config.redis_config) { |
| 911 | printf(" host configuration \"save\": %s\n", |
| 912 | config.redis_config->save); |
| 913 | printf(" host configuration \"appendonly\": %s\n", |
| 914 | config.redis_config->appendonly); |
| 915 | } |
| 916 | } |
| 917 | printf(" multi-thread: %s\n", (config.num_threads ? "yes" : "no")); |
| 918 | if (config.num_threads) |
| 919 | printf(" threads: %d\n", config.num_threads); |
| 920 | |
| 921 | printf("\n"); |
| 922 | printf("Latency by percentile distribution:\n"); |
| 923 | struct hdr_iter iter; |
| 924 | long long previous_cumulative_count = -1; |
| 925 | const long long total_count = config.latency_histogram->total_count; |
| 926 | hdr_iter_percentile_init(&iter, config.latency_histogram, 1); |
| 927 | struct hdr_iter_percentiles *percentiles = &iter.specifics.percentiles; |
| 928 | while (hdr_iter_next(&iter)) |
| 929 | { |
| 930 | const double value = iter.highest_equivalent_value / 1000.0f; |
| 931 | const double percentile = percentiles->percentile; |
| 932 | const long long cumulative_count = iter.cumulative_count; |
| 933 | if( previous_cumulative_count != cumulative_count || cumulative_count == total_count ){ |
| 934 | printf("%3.3f%% <= %.3f milliseconds (cumulative count %lld)\n", percentile, value, cumulative_count); |
| 935 | } |
no test coverage detected