@ -20,6 +20,7 @@ import (
"github.com/prometheus/prometheus/utility"
"github.com/prometheus/prometheus/utility"
"io"
"io"
"io/ioutil"
"io/ioutil"
"time"
)
)
const (
const (
@ -57,7 +58,7 @@ type entity001 []struct {
} ` json:"metric" `
} ` json:"metric" `
}
}
func ( p * processor001 ) Process ( stream io . ReadCloser , baseLabels model . LabelSet , results chan Result ) ( err error ) {
func ( p * processor001 ) Process ( stream io . ReadCloser , timestamp time . Time , baseLabels model . LabelSet , results chan Result ) ( err error ) {
// TODO(matt): Replace with plain-jane JSON unmarshalling.
// TODO(matt): Replace with plain-jane JSON unmarshalling.
defer stream . Close ( )
defer stream . Close ( )
@ -73,8 +74,6 @@ func (p *processor001) Process(stream io.ReadCloser, baseLabels model.LabelSet,
return
return
}
}
now := p . time . Now ( )
// TODO(matt): This outer loop is a great basis for parallelization.
// TODO(matt): This outer loop is a great basis for parallelization.
for _ , entity := range entities {
for _ , entity := range entities {
for _ , value := range entity . Metric . Value {
for _ , value := range entity . Metric . Value {
@ -101,7 +100,7 @@ func (p *processor001) Process(stream io.ReadCloser, baseLabels model.LabelSet,
sample := model . Sample {
sample := model . Sample {
Metric : metric ,
Metric : metric ,
Timestamp : now ,
Timestamp : timestamp ,
Value : model . SampleValue ( sampleValue ) ,
Value : model . SampleValue ( sampleValue ) ,
}
}
@ -136,7 +135,7 @@ func (p *processor001) Process(stream io.ReadCloser, baseLabels model.LabelSet,
sample := model . Sample {
sample := model . Sample {
Metric : childMetric ,
Metric : childMetric ,
Timestamp : now ,
Timestamp : timestamp ,
Value : model . SampleValue ( individualValue ) ,
Value : model . SampleValue ( individualValue ) ,
}
}