Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

New flag 'ingest-from' #1382

Merged
merged 22 commits into from
Aug 12, 2019
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d017857
New option 'ingest-after'
fkaleo Jul 5, 2019
944db44
AggMetric: consider ingestAfter 0 as no-op
fkaleo Jul 8, 2019
d0a0b5e
Fixed test
fkaleo Jul 8, 2019
0f8de4c
AggMetrics.ingestAfter: simplify and generalise by using a map orgId …
fkaleo Jul 8, 2019
33b00cf
Slight performance improvement
fkaleo Jul 31, 2019
0f38e64
Simplified 'ingest-after' flag documentation
fkaleo Aug 2, 2019
e8bb2e4
'ingest-after' flag: support comma separated pairs of org-id:timestamp
fkaleo Aug 2, 2019
bb92223
flag parser: new ParseIngestAfterFlag that MustParseIngestAfterFlag r…
fkaleo Aug 8, 2019
13e2442
Renamed flag 'ingest-after' into 'ingest-from'
fkaleo Aug 8, 2019
bc59f88
Simplified variable naming: 'ingestFromNextChunkT0' becomes 'ingestFr…
fkaleo Aug 8, 2019
2008776
Changed 'ingest-from' definition to include timestamp if it is a chun…
fkaleo Aug 8, 2019
3689d6a
better wording
Dieterbe Aug 8, 2019
1d0bebd
./scripts/dev/sync-configs.sh
Dieterbe Aug 8, 2019
41fece8
clean up flag parsing and testing
Dieterbe Aug 8, 2019
ca6c43e
simpler
Dieterbe Aug 8, 2019
3b4625e
Tests: added exaplanations as to why some data points are not taken i…
fkaleo Aug 9, 2019
2a189e0
extra test case
Dieterbe Aug 9, 2019
16782ef
let aggregators decide whether to keep or drop the point
Dieterbe Aug 9, 2019
909b87e
New test case for Aggregator covering case when a point with an older…
fkaleo Aug 12, 2019
2523ea2
AggMetric: added test for GetAggregated()
fkaleo Aug 12, 2019
4819abf
AggMetric.GetAggregated(): added failing test when using ingestFrom
fkaleo Aug 12, 2019
a27e9f4
AggMetric test: no need to initialize empty slice
fkaleo Aug 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
AggMetric: consider ingestAfter 0 as no-op
fkaleo authored and Dieterbe committed Aug 8, 2019
commit 944db4486798e01144ec59a4c84d7144daa1c840
8 changes: 7 additions & 1 deletion mdata/aggmetric.go
Original file line number Diff line number Diff line change
@@ -56,6 +56,12 @@ func NewAggMetric(store Store, cachePusher cache.CachePusher, key schema.AMKey,
// note: during parsing of retentions, we assure there's at least 1.
ret := retentions[0]

ingestAfterNextChunkT0 := uint32(0)
if ingestAfter > 0 {
// compute start of next chunk after ingestAfter
ingestAfterNextChunkT0 = uint32(ingestAfter-(ingestAfter%int64(ret.ChunkSpan))) + ret.ChunkSpan
}

m := AggMetric{
cachePusher: cachePusher,
store: store,
@@ -64,7 +70,7 @@ func NewAggMetric(store Store, cachePusher cache.CachePusher, key schema.AMKey,
numChunks: ret.NumChunks,
chunks: make([]*chunk.Chunk, 0, ret.NumChunks),
dropFirstChunk: dropFirstChunk,
ingestAfterNextChunkT0: uint32(ingestAfter-(ingestAfter%int64(ret.ChunkSpan))) + ret.ChunkSpan,
ingestAfterNextChunkT0: ingestAfterNextChunkT0,
ttl: uint32(ret.MaxRetention()),
// we set LastWrite here to make sure a new Chunk doesn't get immediately
// garbage collected right after creating it, before we can push to it.