diff options
| author | fumingwei <[email protected]> | 2023-11-22 14:38:26 +0800 |
|---|---|---|
| committer | fumingwei <[email protected]> | 2023-11-22 14:42:08 +0800 |
| commit | b7801737151e31c117a41c6354e56b91dd38ae50 (patch) | |
| tree | cafa2a959291fd57049ac02ccd78648e104b843e | |
| parent | 7802746a3750bcf87ece67c068553f0c5e7476bc (diff) | |
bugfix:fix export histogram json error.
| -rw-r--r-- | src/file_output.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/file_output.cpp b/src/file_output.cpp index 5b49d51..cd66ec8 100644 --- a/src/file_output.cpp +++ b/src/file_output.cpp @@ -658,10 +658,9 @@ int output_file_format_json(struct fieldstat_instance *instance, int n_cur_metri case FIELD_TYPE_SUMMARY: case FILED_TYPE_HISTOGRAM: struct hdr_histogram *h_out = read_hdr_unit_output(metric); - tmp_obj = cJSON_CreateObject(); - for(int j = 0; j < metric->histogram.bins_num; j++) { + tmp_obj = cJSON_CreateObject(); if(metric->field_type == FIELD_TYPE_SUMMARY) { value = (long long)hdr_value_at_percentile(h_out, metric->histogram.bins[j]); |
