+ # what to expect if just the highest histogram bucket is used
+ def test_e2_get_pctiles_highest_pct(self):
+ fio_v3_bucket_count = 29 * 64
+ with open(self.fn, 'w') as f:
+ # make a empty fio v3 histogram
+ buckets = [ 0 for j in range(0, fio_v3_bucket_count) ]
+ # add one I/O request to last bucket
+ buckets[-1] = 1
+ f.write('9000, 1, 4096, %s\n' % ', '.join([str(b) for b in buckets]))
+ (raw_histo_log, max_timestamp_ms) = parse_hist_file(self.fn, fio_v3_bucket_count)
+ self.A(max_timestamp_ms == 9000)
+ aligned_log = align_histo_log(raw_histo_log, 5, fio_v3_bucket_count, max_timestamp_ms)
+ (time_ms, histo) = aligned_log[1]
+ time_intervals = time_ranges(29, 64)
+ expected_pctiles = { 100.0:(64*(1<<28))/1000.0 }
+ pct = get_pctiles( histo, [ 100.0 ], time_intervals )
+ self.A(pct == expected_pctiles)
+