github.com/psiphon-labs/goarista@v0.0.0-20160825065156-d002785f4c67/cmd/octsdb/tsdb.go (about) 1 // Copyright (C) 2016 Arista Networks, Inc. 2 // Use of this source code is governed by the Apache License 2.0 3 // that can be found in the COPYING file. 4 5 package main 6 7 // DataPoint for OpenTSDB to store. 8 type DataPoint struct { 9 // Metric name. 10 Metric string `json:"metric"` 11 12 // UNIX timestamp with millisecond resolution. 13 Timestamp uint64 `json:"timestamp"` 14 15 // Value of the data point (integer or floating point). 16 Value interface{} `json:"value"` 17 18 // Tags. The host is automatically populated by the OpenTSDBConn. 19 Tags map[string]string `json:"tags"` 20 } 21 22 // OpenTSDBConn is a managed connection to an OpenTSDB instance (or cluster). 23 type OpenTSDBConn interface { 24 Put(d *DataPoint) error 25 }