本文整理匯總了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)
}