當前位置: 首頁>>代碼示例>>Golang>>正文


Golang protocol.Point類代碼示例

本文整理匯總了Golang中protocol.Point的典型用法代碼示例。如果您正苦於以下問題:Golang Point類的具體用法?Golang Point怎麽用?Golang Point使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Point類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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
	}
}
開發者ID:hyc,項目名稱:influxdb,代碼行數:9,代碼來源:engine.go

示例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
}
開發者ID:rudrapranay,項目名稱:influxdb,代碼行數:13,代碼來源:aggregator.go

示例3: getPoint

// set the fields of the other time series to null making sure that
// the order of the null values match the order of the field
// definitions, i.e. left timeseries first followed by values from the
// right timeseries
func (self *mergeState) getPoint(fields []string, p *protocol.Point) *protocol.Point {
	if !self.modifyValues {
		return p
	}

	newValues := make([]*protocol.FieldValue, len(self.fields))
	oldValues := p.Values
	for idx, f := range fields {
		newIdx := self.fields[f]
		newValues[newIdx] = oldValues[idx]
	}
	p.Values = newValues
	return p
}
開發者ID:nairboon,項目名稱:influxdb,代碼行數:18,代碼來源:merge.go

示例4: normalizePointAndAppend

func (self *CoordinatorImpl) normalizePointAndAppend(fieldNames map[string]int, result *protocol.Series, fields []string, point *protocol.Point) {
	oldValues := point.Values
	point.Values = make([]*protocol.FieldValue, len(fieldNames), len(fieldNames))
	for index, field := range fields {
		indexForField, ok := fieldNames[field]

		// drop this point on the floor if the unexpected happens
		if !ok {
			log.Error("Couldn't lookup field: ", field, fields, fieldNames)
			return
		}
		point.Values[indexForField] = oldValues[index]
	}
	result.Points = append(result.Points, point)
}
開發者ID:schmurfy,項目名稱:influxdb,代碼行數:15,代碼來源:coordinator.go

示例5: filterColumns

func filterColumns(columns map[string]bool, fields []string, point *protocol.Point) {
	if columns["*"] {
		return
	}

	newValues := []*protocol.FieldValue{}
	newFields := []string{}
	for idx, f := range fields {
		if _, ok := columns[f]; !ok {
			continue
		}

		newValues = append(newValues, point.Values[idx])
		newFields = append(newFields, f)
	}
	point.Values = newValues
}
開發者ID:rramos,項目名稱:influxdb,代碼行數:17,代碼來源:filtering.go

示例6: getTimestampFromPoint

func (self *QueryEngine) getTimestampFromPoint(point *protocol.Point) int64 {
	return self.getTimestampBucket(uint64(*point.GetTimestampInMicroseconds()))
}
開發者ID:hyc,項目名稱:influxdb,代碼行數:3,代碼來源:engine.go

示例7: getTimestampFromPoint

func getTimestampFromPoint(window time.Duration, point *protocol.Point) int64 {
	multiplier := int64(window / time.Microsecond)
	return *point.GetTimestampInMicroseconds() / int64(multiplier) * int64(multiplier)
}
開發者ID:ronaldevers,項目名稱:influxdb,代碼行數:4,代碼來源:engine.go

示例8: getTimestampFromPoint

func (self *QueryEngine) getTimestampFromPoint(point *protocol.Point) int64 {
	multiplier := uint64(*self.duration)
	timestampNanoseconds := uint64(*point.GetTimestampInMicroseconds() * 1000)
	return int64(timestampNanoseconds / multiplier * multiplier / 1000)
}
開發者ID:kennylixi,項目名稱:influxdb,代碼行數:5,代碼來源:engine.go


注:本文中的protocol.Point類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。