MCPcopy Create free account
hub / github.com/AdRoll/baker / Process

Method Process

filter/timestamp_range.go:90–105  ·  view source on GitHub ↗

Process implements baker.Filter.

(l baker.Record, next func(baker.Record))

Source from the content-addressed store, hash-verified

88
89// Process implements baker.Filter.
90func (f *TimestampRange) Process(l baker.Record, next func(baker.Record)) {
91 // Convert the record timestamp to unix time (int64)
92 ts, err := strconv.ParseInt(string(l.Get(f.fidx)), 10, 64)
93 if err != nil {
94 atomic.AddInt64(&f.numFilteredLines, 1)
95 return
96 }
97
98 // Discard records having an out-of-bounds timestamp.
99 if ts < f.startDate || ts >= f.endDate {
100 atomic.AddInt64(&f.numFilteredLines, 1)
101 return
102 }
103
104 next(l)
105}

Callers 1

TestTimestampRangeFunction · 0.95

Calls 1

GetMethod · 0.65

Tested by 1

TestTimestampRangeFunction · 0.76