mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
lint
This commit is contained in:
parent
4654241f4b
commit
46b84ab3fb
|
@ -1493,6 +1493,7 @@ func populateTimeSeries(batch []timeSeries, pendingData []prompb.TimeSeries, sen
|
|||
}
|
||||
return nPendingSamples, nPendingExemplars, nPendingHistograms
|
||||
}
|
||||
|
||||
func (s *shards) sendSamples(ctx context.Context, samples []prompb.TimeSeries, sampleCount, exemplarCount, histogramCount int, pBuf *proto.Buffer, buf *[]byte) {
|
||||
begin := time.Now()
|
||||
// Build the WriteRequest with no metadata.
|
||||
|
|
|
@ -619,38 +619,6 @@ func createTimeseries(numSamples, numSeries int, extraLabels ...labels.Label) ([
|
|||
return samples, series
|
||||
}
|
||||
|
||||
func createDummyTimeseriesBatch(numSeries int, extraLabels ...labels.Label) []timeSeries {
|
||||
result := make([]timeSeries, numSeries)
|
||||
for i := range result {
|
||||
name := fmt.Sprintf("test_metric_%d", i)
|
||||
rand.Shuffle(len(extraLabels), func(i, j int) {
|
||||
extraLabels[i], extraLabels[j] = extraLabels[j], extraLabels[i]
|
||||
})
|
||||
result[i] = timeSeries{
|
||||
seriesLabels: labels.NewBuilder(extraLabels[0:3]).Set(labels.MetricName, name).Labels(),
|
||||
timestamp: int64(i),
|
||||
}
|
||||
switch i % 10 {
|
||||
case 0, 1, 2, 3, 4, 5:
|
||||
result[i].value = float64(i)
|
||||
case 6:
|
||||
result[i].exemplarLabels = extraLabels
|
||||
result[i].value = float64(i)
|
||||
case 7:
|
||||
result[i].histogram = &histogram.Histogram{
|
||||
Schema: 2,
|
||||
ZeroThreshold: 1e-128,
|
||||
}
|
||||
case 8, 9:
|
||||
result[i].floatHistogram = &histogram.FloatHistogram{
|
||||
Schema: 2,
|
||||
ZeroThreshold: 1e-128,
|
||||
}
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func createExemplars(numExemplars, numSeries int) ([]record.RefExemplar, []record.RefSeries) {
|
||||
exemplars := make([]record.RefExemplar, 0, numExemplars)
|
||||
series := make([]record.RefSeries, 0, numSeries)
|
||||
|
@ -1478,7 +1446,6 @@ func createDummyTimeSeries(instances int) []timeSeries {
|
|||
|
||||
func BenchmarkBuildWriteRequest(b *testing.B) {
|
||||
bench := func(b *testing.B, batch []timeSeries) {
|
||||
|
||||
buff := make([]byte, 0)
|
||||
seriesBuff := make([]prompb.TimeSeries, len(batch))
|
||||
for i := range seriesBuff {
|
||||
|
|
|
@ -165,7 +165,6 @@ func (rws *WriteStorage) ApplyConfig(conf *config.Config) error {
|
|||
Headers: rwConf.Headers,
|
||||
RetryOnRateLimit: rwConf.QueueConfig.RetryOnRateLimit,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ func BenchmarkRemoteWritehandler(b *testing.B) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(npazosmendez): add benchmarks with realistc scenarios
|
||||
// TODO(npazosmendez): add benchmarks with realistic scenarios
|
||||
func BenchmarkReducedRemoteWriteHandler(b *testing.B) {
|
||||
const labelValue = "abcdefg'hijlmn234!@#$%^&*()_+~`\"{}[],./<>?hello0123hiOlá你好Dzieńdobry9Zd8ra765v4stvuyte"
|
||||
reqs := []*http.Request{}
|
||||
|
|
Loading…
Reference in a new issue