|
|
@ -23,7 +23,7 @@ import ( |
|
|
|
"github.com/prometheus/prometheus/pkg/labels" |
|
|
|
"github.com/prometheus/prometheus/pkg/labels" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
var InvalidTimesError = fmt.Errorf("max time is lesser than min time") |
|
|
|
var ErrInvalidTimes = fmt.Errorf("max time is lesser than min time") |
|
|
|
|
|
|
|
|
|
|
|
type MetricSample struct { |
|
|
|
type MetricSample struct { |
|
|
|
TimestampMs int64 |
|
|
|
TimestampMs int64 |
|
|
@ -58,7 +58,7 @@ func CreateBlock(samples []*MetricSample, dir string, mint, maxt int64, logger l |
|
|
|
chunkRange = DefaultBlockDuration |
|
|
|
chunkRange = DefaultBlockDuration |
|
|
|
} |
|
|
|
} |
|
|
|
if chunkRange < 0 { |
|
|
|
if chunkRange < 0 { |
|
|
|
return "", InvalidTimesError |
|
|
|
return "", ErrInvalidTimes |
|
|
|
} |
|
|
|
} |
|
|
|
head, err := CreateHead(samples, chunkRange, logger) |
|
|
|
head, err := CreateHead(samples, chunkRange, logger) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|