mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
parent
425f591fc9
commit
17f15d024a
|
@ -500,7 +500,7 @@ func (sl *scrapeLoop) append(samples model.Samples) (int, error) {
|
||||||
var wrappedBufApp storage.SampleAppender
|
var wrappedBufApp storage.SampleAppender
|
||||||
wrappedBufApp, countingApp = sl.wrapAppender(bufApp)
|
wrappedBufApp, countingApp = sl.wrapAppender(bufApp)
|
||||||
for _, s := range samples {
|
for _, s := range samples {
|
||||||
// Ignore errors as bufferedAppender always succeds.
|
// Ignore errors as bufferedAppender always succeeds.
|
||||||
wrappedBufApp.Append(s)
|
wrappedBufApp.Append(s)
|
||||||
}
|
}
|
||||||
samples = bufApp.buffer
|
samples = bufApp.buffer
|
||||||
|
|
|
@ -143,7 +143,7 @@ func TestQueryRange(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
remote: []model.Matrix{
|
remote: []model.Matrix{
|
||||||
model.Matrix{
|
{
|
||||||
&model.SampleStream{
|
&model.SampleStream{
|
||||||
Metric: model.Metric{
|
Metric: model.Metric{
|
||||||
model.MetricNameLabel: "testmetric",
|
model.MetricNameLabel: "testmetric",
|
||||||
|
@ -164,7 +164,7 @@ func TestQueryRange(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
model.Matrix{
|
{
|
||||||
&model.SampleStream{
|
&model.SampleStream{
|
||||||
Metric: model.Metric{
|
Metric: model.Metric{
|
||||||
model.MetricNameLabel: "testmetric",
|
model.MetricNameLabel: "testmetric",
|
||||||
|
@ -231,7 +231,7 @@ func TestQueryRange(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
remote: []model.Matrix{
|
remote: []model.Matrix{
|
||||||
model.Matrix{
|
{
|
||||||
&model.SampleStream{
|
&model.SampleStream{
|
||||||
Metric: model.Metric{
|
Metric: model.Metric{
|
||||||
model.MetricNameLabel: "testmetric",
|
model.MetricNameLabel: "testmetric",
|
||||||
|
@ -252,7 +252,7 @@ func TestQueryRange(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
model.Matrix{
|
{
|
||||||
&model.SampleStream{
|
&model.SampleStream{
|
||||||
Metric: model.Metric{
|
Metric: model.Metric{
|
||||||
model.MetricNameLabel: "testmetric",
|
model.MetricNameLabel: "testmetric",
|
||||||
|
@ -323,7 +323,7 @@ func TestQueryRange(t *testing.T) {
|
||||||
{
|
{
|
||||||
name: "no local data",
|
name: "no local data",
|
||||||
remote: []model.Matrix{
|
remote: []model.Matrix{
|
||||||
model.Matrix{
|
{
|
||||||
&model.SampleStream{
|
&model.SampleStream{
|
||||||
Metric: model.Metric{
|
Metric: model.Metric{
|
||||||
model.MetricNameLabel: "testmetric",
|
model.MetricNameLabel: "testmetric",
|
||||||
|
@ -345,7 +345,7 @@ func TestQueryRange(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
model.Matrix{
|
{
|
||||||
&model.SampleStream{
|
&model.SampleStream{
|
||||||
Metric: model.Metric{
|
Metric: model.Metric{
|
||||||
model.MetricNameLabel: "testmetric",
|
model.MetricNameLabel: "testmetric",
|
||||||
|
@ -507,7 +507,7 @@ func TestQueryRange(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
remote: []model.Matrix{
|
remote: []model.Matrix{
|
||||||
model.Matrix{
|
{
|
||||||
&model.SampleStream{
|
&model.SampleStream{
|
||||||
Metric: model.Metric{
|
Metric: model.Metric{
|
||||||
model.MetricNameLabel: "testmetric",
|
model.MetricNameLabel: "testmetric",
|
||||||
|
|
|
@ -1209,7 +1209,7 @@ func (s *MemorySeriesStorage) maybeEvict() {
|
||||||
// to 1 to signal that we want to evict chunk but have no evictable chunks
|
// to 1 to signal that we want to evict chunk but have no evictable chunks
|
||||||
// available.
|
// available.
|
||||||
//
|
//
|
||||||
// - Otherwise, calulate the number of chunks to evict and return it:
|
// - Otherwise, calculate the number of chunks to evict and return it:
|
||||||
//
|
//
|
||||||
// MAX( h(nextGC), h(current) ) - h(target)
|
// MAX( h(nextGC), h(current) ) - h(target)
|
||||||
// n(toEvict) = MIN( n(evictable), ---------------------------------------- )
|
// n(toEvict) = MIN( n(evictable), ---------------------------------------- )
|
||||||
|
|
|
@ -453,7 +453,7 @@ func TestEndpoints(t *testing.T) {
|
||||||
endpoint: api.targets,
|
endpoint: api.targets,
|
||||||
response: &TargetDiscovery{
|
response: &TargetDiscovery{
|
||||||
ActiveTargets: []*Target{
|
ActiveTargets: []*Target{
|
||||||
&Target{
|
{
|
||||||
DiscoveredLabels: model.LabelSet{},
|
DiscoveredLabels: model.LabelSet{},
|
||||||
Labels: model.LabelSet{},
|
Labels: model.LabelSet{},
|
||||||
ScrapeURL: "http://example.com:8080/metrics",
|
ScrapeURL: "http://example.com:8080/metrics",
|
||||||
|
@ -465,7 +465,7 @@ func TestEndpoints(t *testing.T) {
|
||||||
endpoint: api.alertmanagers,
|
endpoint: api.alertmanagers,
|
||||||
response: &AlertmanagerDiscovery{
|
response: &AlertmanagerDiscovery{
|
||||||
ActiveAlertmanagers: []*AlertmanagerTarget{
|
ActiveAlertmanagers: []*AlertmanagerTarget{
|
||||||
&AlertmanagerTarget{
|
{
|
||||||
URL: "http://alertmanager.example.com:8080/api/v1/alerts",
|
URL: "http://alertmanager.example.com:8080/api/v1/alerts",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue