本文整理汇总了Golang中protocol.Point.GetTimestampInMicroseconds方法的典型用法代码示例。如果您正苦于以下问题:Golang Point.GetTimestampInMicroseconds方法的具体用法?Golang Point.GetTimestampInMicroseconds怎么用?Golang Point.GetTimestampInMicroseconds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类protocol.Point
的用法示例。
在下文中一共展示了Point.GetTimestampInMicroseconds方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: UpdateRange
func (self *PointRange) UpdateRange(point *protocol.Point) {
timestamp := *point.GetTimestampInMicroseconds()
if timestamp < self.startTime {
self.startTime = timestamp
}
if timestamp > self.endTime {
self.endTime = timestamp
}
}
示例2: AggregatePoint
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
}
示例3: getTimestampFromPoint
func getTimestampFromPoint(window time.Duration, point *protocol.Point) int64 {
multiplier := int64(window / time.Microsecond)
return *point.GetTimestampInMicroseconds() / int64(multiplier) * int64(multiplier)
}
示例4: getTimestampFromPoint
func (self *QueryEngine) getTimestampFromPoint(point *protocol.Point) int64 {
return self.getTimestampBucket(uint64(*point.GetTimestampInMicroseconds()))
}
示例5: getTimestampFromPoint
func (self *QueryEngine) getTimestampFromPoint(point *protocol.Point) int64 {
multiplier := uint64(*self.duration)
timestampNanoseconds := uint64(*point.GetTimestampInMicroseconds() * 1000)
return int64(timestampNanoseconds / multiplier * multiplier / 1000)
}