(from int64, enc encoding.Encoding)
| 58 | } |
| 59 | |
| 60 | func mkBatch(from int64, enc encoding.Encoding) promchunk.Batch { |
| 61 | var result promchunk.Batch |
| 62 | for i := range int64(promchunk.BatchSize) { |
| 63 | result.Timestamps[i] = from + i |
| 64 | switch enc { |
| 65 | case encoding.PrometheusXorChunk: |
| 66 | result.Values[i] = float64(from + i) |
| 67 | case encoding.PrometheusHistogramChunk: |
| 68 | result.Histograms[i] = testHistogram(int(from+i), 5, 20) |
| 69 | case encoding.PrometheusFloatHistogramChunk: |
| 70 | result.FloatHistograms[i] = testHistogram(int(from+i), 5, 20).ToFloat(nil) |
| 71 | } |
| 72 | } |
| 73 | result.Length = promchunk.BatchSize |
| 74 | result.ValType = enc.ChunkValueType() |
| 75 | return result |
| 76 | } |
| 77 | |
| 78 | func testHistogram(count, numSpans, numBuckets int) *histogram.Histogram { |
| 79 | bucketsPerSide := numBuckets / 2 |
no test coverage detected