Exemplo n.º 1
0
func (self *PointRange) UpdateRange(point *protocol.Point) {
	timestamp := *point.GetTimestampInMicroseconds()
	if timestamp < self.startTime {
		self.startTime = timestamp
	}
	if timestamp > self.endTime {
		self.endTime = timestamp
	}
}
Exemplo n.º 2
0
func (self *TimestampAggregator) AggregatePoint(series string, group interface{}, p *protocol.Point) error {
	timestamps := self.timestamps[series]
	if timestamps == nil {
		timestamps = make(map[interface{}]int64)
		self.timestamps[series] = timestamps
	}
	if self.duration != nil {
		timestamps[group] = *p.GetTimestampInMicroseconds() / *self.duration * *self.duration
	} else {
		timestamps[group] = *p.GetTimestampInMicroseconds()
	}
	return nil
}
Exemplo n.º 3
0
func getTimestampFromPoint(window time.Duration, point *protocol.Point) int64 {
	multiplier := int64(window / time.Microsecond)
	return *point.GetTimestampInMicroseconds() / int64(multiplier) * int64(multiplier)
}
Exemplo n.º 4
0
func (self *QueryEngine) getTimestampFromPoint(point *protocol.Point) int64 {
	return self.getTimestampBucket(uint64(*point.GetTimestampInMicroseconds()))
}
Exemplo n.º 5
0
func (self *QueryEngine) getTimestampFromPoint(point *protocol.Point) int64 {
	multiplier := uint64(*self.duration)
	timestampNanoseconds := uint64(*point.GetTimestampInMicroseconds() * 1000)
	return int64(timestampNanoseconds / multiplier * multiplier / 1000)
}