Commit 8b37e27d by Carl Bergquist

use int64 for timestamps

parent 8a7c4556
...@@ -77,10 +77,8 @@ func (tw *TsdbWrapper) Query(ctx context.Context, ds *models.DataSource, query * ...@@ -77,10 +77,8 @@ func (tw *TsdbWrapper) Query(ctx context.Context, ds *models.DataSource, query *
points := tsdb.TimeSeriesPoints{} points := tsdb.TimeSeriesPoints{}
for _, p := range s.Points { for _, p := range s.Points {
if p.Timestamp != nil { po := tsdb.NewTimePoint(null.FloatFrom(p.Value), float64(p.Timestamp))
po := tsdb.NewTimePoint(null.FloatFrom(p.Value), float64(p.Timestamp.Seconds)) points = append(points, po)
points = append(points, po)
}
} }
res.Results[r.RefId].Series = append(res.Results[r.RefId].Series, &tsdb.TimeSeries{ res.Results[r.RefId].Series = append(res.Results[r.RefId].Series, &tsdb.TimeSeries{
......
...@@ -345,8 +345,8 @@ func (m *TimeSeries) GetPoints() []*Point { ...@@ -345,8 +345,8 @@ func (m *TimeSeries) GetPoints() []*Point {
} }
type Point struct { type Point struct {
Timestamp *google_protobuf.Timestamp `protobuf:"bytes,1,opt,name=timestamp" json:"timestamp,omitempty"` Timestamp int64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"`
Value float64 `protobuf:"fixed64,2,opt,name=value" json:"value,omitempty"` Value float64 `protobuf:"fixed64,2,opt,name=value" json:"value,omitempty"`
} }
func (m *Point) Reset() { *m = Point{} } func (m *Point) Reset() { *m = Point{} }
...@@ -354,11 +354,11 @@ func (m *Point) String() string { return proto1.CompactTextString(m) ...@@ -354,11 +354,11 @@ func (m *Point) String() string { return proto1.CompactTextString(m)
func (*Point) ProtoMessage() {} func (*Point) ProtoMessage() {}
func (*Point) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } func (*Point) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
func (m *Point) GetTimestamp() *google_protobuf.Timestamp { func (m *Point) GetTimestamp() int64 {
if m != nil { if m != nil {
return m.Timestamp return m.Timestamp
} }
return nil return 0
} }
func (m *Point) GetValue() float64 { func (m *Point) GetValue() float64 {
...@@ -454,47 +454,47 @@ var _TsdbPlugin_serviceDesc = grpc.ServiceDesc{ ...@@ -454,47 +454,47 @@ var _TsdbPlugin_serviceDesc = grpc.ServiceDesc{
func init() { proto1.RegisterFile("tsdb_plugin.proto", fileDescriptor0) } func init() { proto1.RegisterFile("tsdb_plugin.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{ var fileDescriptor0 = []byte{
// 672 bytes of a gzipped FileDescriptorProto // 663 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0x5d, 0x6f, 0xd3, 0x3c, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x54, 0x4d, 0x8f, 0xd3, 0x30,
0x14, 0x56, 0x92, 0x7e, 0xe5, 0x54, 0x6f, 0xf5, 0xce, 0xef, 0xf4, 0x12, 0x55, 0x7c, 0x54, 0x11, 0x10, 0x55, 0x92, 0x7e, 0x65, 0x2a, 0x2a, 0xd6, 0xac, 0x20, 0xaa, 0xf8, 0xa8, 0x22, 0xb4, 0xaa,
0x9a, 0x2a, 0x31, 0x65, 0x50, 0x2e, 0x36, 0x21, 0x6e, 0x40, 0x70, 0xb1, 0x49, 0x93, 0x86, 0x57, 0xc4, 0x2a, 0x0b, 0xe5, 0xb0, 0x08, 0xb8, 0x80, 0xe0, 0xb0, 0x2b, 0xad, 0xb4, 0x78, 0xcb, 0x05,
0x84, 0x84, 0x84, 0x90, 0xdb, 0xb8, 0x21, 0x90, 0xc4, 0xc5, 0x76, 0x36, 0x7a, 0xc9, 0x3f, 0xe1, 0x09, 0x21, 0xb7, 0x71, 0x43, 0x20, 0x89, 0x8b, 0xed, 0xec, 0xd2, 0x23, 0xff, 0x84, 0x03, 0x3f,
0x82, 0x9f, 0xc0, 0x35, 0xbf, 0x0d, 0xf9, 0xc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 0x4a,
0x8e, 0x3d, 0x7c, 0xf6, 0x14, 0xc0, 0x8c, 0xb4, 0x0b, 0x94, 0x4b, 0xa2, 0x7a, 0x7a, 0xb4, 0x26, 0x22, 0x51, 0xfd, 0x42, 0xb4, 0x5e, 0xab, 0xfa, 0x51, 0x1b, 0xef, 0x35, 0x58, 0x7d, 0xc7, 0x5e,
0x59, 0x3d, 0xf0, 0xc6, 0x7b, 0x0d, 0x56, 0xf7, 0xdf, 0xf3, 0xfe, 0xdb, 0x6e, 0x75, 0x69, 0x0f, 0xf7, 0x3f, 0x74, 0xab, 0xab, 0xd8, 0xc3, 0xcf, 0xd3, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x55,
0x3f, 0x8f, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x9d, 0x34, 0x4f, 0x60, 0x05, 0x00, 0x00, 0xe4, 0xba, 0x1a, 0x44, 0x05, 0x00, 0x00,
} }
...@@ -61,7 +61,7 @@ message TimeSeries { ...@@ -61,7 +61,7 @@ message TimeSeries {
} }
message Point { message Point {
google.protobuf.Timestamp timestamp = 1; int64 timestamp = 1;
double value = 2; double value = 2;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment