cockroach: github.com/abhinavdahiya/cockroach/ts/tspb Index | Files

package tspb

import "github.com/abhinavdahiya/cockroach/ts/tspb"

Package tspb is a generated protocol buffer package.

It is generated from these files:
	cockroach/ts/tspb/timeseries.proto

It has these top-level messages:
	TimeSeriesDatapoint
	TimeSeriesData
	Query
	TimeSeriesQueryRequest
	TimeSeriesQueryResponse

Package tspb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Package Files

timeseries.go timeseries.pb.go timeseries.pb.gw.go

Variables

var (
    ErrInvalidLengthTimeseries = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowTimeseries   = fmt.Errorf("proto: integer overflow")
)
var TimeSeriesQueryAggregator_name = map[int32]string{
    1:  "AVG",
    2:  "SUM",
    3:  "MAX",
    4:  "MIN",
}
var TimeSeriesQueryAggregator_value = map[string]int32{
    "AVG": 1,
    "SUM": 2,
    "MAX": 3,
    "MIN": 4,
}
var TimeSeriesQueryDerivative_name = map[int32]string{
    0:  "NONE",
    1:  "DERIVATIVE",
    2:  "NON_NEGATIVE_DERIVATIVE",
}
var TimeSeriesQueryDerivative_value = map[string]int32{
    "NONE":                    0,
    "DERIVATIVE":              1,
    "NON_NEGATIVE_DERIVATIVE": 2,
}

func RegisterTimeSeriesHandler Uses

func RegisterTimeSeriesHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterTimeSeriesHandler registers the http handlers for service TimeSeries to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterTimeSeriesHandlerFromEndpoint Uses

func RegisterTimeSeriesHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTimeSeriesHandlerFromEndpoint is same as RegisterTimeSeriesHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTimeSeriesServer Uses

func RegisterTimeSeriesServer(s *grpc.Server, srv TimeSeriesServer)

type Query Uses

type Query struct {
    // The name of the time series to query.
    Name string `protobuf:"bytes,1,opt,name=name" json:"name"`
    // A downsampling aggregation function to apply to datapoints within the
    // same sample period.
    Downsampler *TimeSeriesQueryAggregator `protobuf:"varint,2,opt,name=downsampler,enum=cockroach.ts.tspb.TimeSeriesQueryAggregator,def=1" json:"downsampler,omitempty"`
    // An aggregation function used to combine timelike datapoints from the
    // different sources being queried.
    SourceAggregator *TimeSeriesQueryAggregator `protobuf:"varint,3,opt,name=source_aggregator,json=sourceAggregator,enum=cockroach.ts.tspb.TimeSeriesQueryAggregator,def=2" json:"source_aggregator,omitempty"`
    // If set to a value other than 'NONE', query will return a derivative
    // (rate of change) of the aggregated datapoints.
    Derivative *TimeSeriesQueryDerivative `protobuf:"varint,4,opt,name=derivative,enum=cockroach.ts.tspb.TimeSeriesQueryDerivative,def=0" json:"derivative,omitempty"`
    // An optional list of sources to restrict the time series query. If no
    // sources are provided, all available sources will be queried.
    Sources []string `protobuf:"bytes,5,rep,name=sources" json:"sources,omitempty"`
}

Each Query defines a specific metric to query over the time span of this request.

func (*Query) Descriptor Uses

func (*Query) Descriptor() ([]byte, []int)

func (*Query) GetDerivative Uses

func (m *Query) GetDerivative() TimeSeriesQueryDerivative

func (*Query) GetDownsampler Uses

func (m *Query) GetDownsampler() TimeSeriesQueryAggregator

func (*Query) GetName Uses

func (m *Query) GetName() string

func (*Query) GetSourceAggregator Uses

func (m *Query) GetSourceAggregator() TimeSeriesQueryAggregator

func (*Query) GetSources Uses

func (m *Query) GetSources() []string

func (*Query) Marshal Uses

func (m *Query) Marshal() (data []byte, err error)

func (*Query) MarshalTo Uses

func (m *Query) MarshalTo(data []byte) (int, error)

func (*Query) ProtoMessage Uses

func (*Query) ProtoMessage()

func (*Query) Reset Uses

func (m *Query) Reset()

func (*Query) Size Uses

func (m *Query) Size() (n int)

func (*Query) String Uses

func (m *Query) String() string

func (*Query) Unmarshal Uses

func (m *Query) Unmarshal(data []byte) error

type TimeSeriesClient Uses

type TimeSeriesClient interface {
    // URL: /ts/query
    Query(ctx context.Context, in *TimeSeriesQueryRequest, opts ...grpc.CallOption) (*TimeSeriesQueryResponse, error)
}

func NewTimeSeriesClient Uses

func NewTimeSeriesClient(cc *grpc.ClientConn) TimeSeriesClient

type TimeSeriesData Uses

type TimeSeriesData struct {
    // A string which uniquely identifies the variable from which this data was
    // measured.
    Name string `protobuf:"bytes,1,opt,name=name" json:"name"`
    // A string which identifies the unique source from which the variable was measured.
    Source string `protobuf:"bytes,2,opt,name=source" json:"source"`
    // Datapoints representing one or more measurements taken from the variable.
    Datapoints []TimeSeriesDatapoint `protobuf:"bytes,3,rep,name=datapoints" json:"datapoints"`
}

TimeSeriesData is a set of measurements of a single named variable at multiple points in time. This message contains a name and a source which, in combination, uniquely identify the time series being measured. Measurement data is represented as a repeated set of TimeSeriesDatapoint messages.

func (*TimeSeriesData) Descriptor Uses

func (*TimeSeriesData) Descriptor() ([]byte, []int)

func (*TimeSeriesData) Marshal Uses

func (m *TimeSeriesData) Marshal() (data []byte, err error)

func (*TimeSeriesData) MarshalTo Uses

func (m *TimeSeriesData) MarshalTo(data []byte) (int, error)

func (*TimeSeriesData) ProtoMessage Uses

func (*TimeSeriesData) ProtoMessage()

func (*TimeSeriesData) Reset Uses

func (m *TimeSeriesData) Reset()

func (*TimeSeriesData) Size Uses

func (m *TimeSeriesData) Size() (n int)

func (*TimeSeriesData) String Uses

func (m *TimeSeriesData) String() string

func (TimeSeriesData) ToInternal Uses

func (ts TimeSeriesData) ToInternal(
    keyDuration, sampleDuration int64,
) ([]roachpb.InternalTimeSeriesData, error)

ToInternal places the datapoints in a TimeSeriesData message into one or more InternalTimeSeriesData messages. The structure and number of messages returned depends on two variables: a key duration, and a sample duration.

The key duration is an interval length in nanoseconds used to determine how many intervals are grouped into a single InternalTimeSeriesData message.

The sample duration is also an interval length in nanoseconds; it must be less than or equal to the key duration, and must also evenly divide the key duration. Datapoints which fall into the same sample interval will be aggregated together into a single Sample.

Example: Assume the desired result is to aggregate individual datapoints into the same sample if they occurred within the same second; additionally, all samples which occur within the same hour should be stored at the same key location within the same InternalTimeSeriesValue. The sample duration should be 10^9 nanoseconds (value of time.Second), and the key duration should be (3600*10^9) nanoseconds (value of time.Hour).

Note that this method does not accumulate data into individual samples in the case where multiple datapoints fall into the same sample period. Internal data should be merged into the cockroach data store before being read; the engine is responsible for accumulating samples.

The returned slice of InternalTimeSeriesData objects will not be sorted.

For more information on how time series data is stored, see InternalTimeSeriesData and its related structures.

func (*TimeSeriesData) Unmarshal Uses

func (m *TimeSeriesData) Unmarshal(data []byte) error

type TimeSeriesDatapoint Uses

type TimeSeriesDatapoint struct {
    // The timestamp when this datapoint is located, expressed in nanoseconds
    // since the unix epoch.
    TimestampNanos int64 `protobuf:"varint,1,opt,name=timestamp_nanos,json=timestampNanos" json:"timestamp_nanos"`
    // A floating point representation of the value of this datapoint.
    Value float64 `protobuf:"fixed64,2,opt,name=value" json:"value"`
}

TimeSeriesDatapoint is a single point of time series data; a value associated with a timestamp.

func (*TimeSeriesDatapoint) Descriptor Uses

func (*TimeSeriesDatapoint) Descriptor() ([]byte, []int)

func (*TimeSeriesDatapoint) Marshal Uses

func (m *TimeSeriesDatapoint) Marshal() (data []byte, err error)

func (*TimeSeriesDatapoint) MarshalTo Uses

func (m *TimeSeriesDatapoint) MarshalTo(data []byte) (int, error)

func (*TimeSeriesDatapoint) ProtoMessage Uses

func (*TimeSeriesDatapoint) ProtoMessage()

func (*TimeSeriesDatapoint) Reset Uses

func (m *TimeSeriesDatapoint) Reset()

func (*TimeSeriesDatapoint) Size Uses

func (m *TimeSeriesDatapoint) Size() (n int)

func (*TimeSeriesDatapoint) String Uses

func (m *TimeSeriesDatapoint) String() string

func (*TimeSeriesDatapoint) Unmarshal Uses

func (m *TimeSeriesDatapoint) Unmarshal(data []byte) error

type TimeSeriesQueryAggregator Uses

type TimeSeriesQueryAggregator int32

TimeSeriesQueryAggregator describes a set of aggregation functions which can be used to combine multiple datapoints into a single datapoint.

Aggregators are used to "downsample" series by combining datapoints from the same series at different times. They are also used to "aggregate" values from different series, combining data points from different series at the same time.

const (
    // AVG returns the average value of datapoints.
    TimeSeriesQueryAggregator_AVG TimeSeriesQueryAggregator = 1
    // SUM returns the sum value of datapoints.
    TimeSeriesQueryAggregator_SUM TimeSeriesQueryAggregator = 2
    // MAX returns the maximum value of datapoints.
    TimeSeriesQueryAggregator_MAX TimeSeriesQueryAggregator = 3
    // MIN returns the minimum value of datapoints.
    TimeSeriesQueryAggregator_MIN TimeSeriesQueryAggregator = 4
)
const Default_Query_Downsampler TimeSeriesQueryAggregator = TimeSeriesQueryAggregator_AVG
const Default_Query_SourceAggregator TimeSeriesQueryAggregator = TimeSeriesQueryAggregator_SUM

func (TimeSeriesQueryAggregator) Enum Uses

func (x TimeSeriesQueryAggregator) Enum() *TimeSeriesQueryAggregator

func (TimeSeriesQueryAggregator) EnumDescriptor Uses

func (TimeSeriesQueryAggregator) EnumDescriptor() ([]byte, []int)

func (TimeSeriesQueryAggregator) String Uses

func (x TimeSeriesQueryAggregator) String() string

func (*TimeSeriesQueryAggregator) UnmarshalJSON Uses

func (x *TimeSeriesQueryAggregator) UnmarshalJSON(data []byte) error

type TimeSeriesQueryDerivative Uses

type TimeSeriesQueryDerivative int32

TimeSeriesQueryDerivative describes a derivative function used to convert returned datapoints into a rate-of-change.

const (
    // NONE is the default value, and does not apply a derivative function.
    TimeSeriesQueryDerivative_NONE TimeSeriesQueryDerivative = 0
    // DERIVATIVE returns the first-order derivative of values in the time series.
    TimeSeriesQueryDerivative_DERIVATIVE TimeSeriesQueryDerivative = 1
    // NON_NEGATIVE_DERIVATIVE returns only non-negative values of the first-order
    // derivative; negative values are returned as zero. This should be used for
    // counters that monotonically increase, but might wrap or reset.
    TimeSeriesQueryDerivative_NON_NEGATIVE_DERIVATIVE TimeSeriesQueryDerivative = 2
)
const Default_Query_Derivative TimeSeriesQueryDerivative = TimeSeriesQueryDerivative_NONE

func (TimeSeriesQueryDerivative) Enum Uses

func (x TimeSeriesQueryDerivative) Enum() *TimeSeriesQueryDerivative

func (TimeSeriesQueryDerivative) EnumDescriptor Uses

func (TimeSeriesQueryDerivative) EnumDescriptor() ([]byte, []int)

func (TimeSeriesQueryDerivative) String Uses

func (x TimeSeriesQueryDerivative) String() string

func (*TimeSeriesQueryDerivative) UnmarshalJSON Uses

func (x *TimeSeriesQueryDerivative) UnmarshalJSON(data []byte) error

type TimeSeriesQueryRequest Uses

type TimeSeriesQueryRequest struct {
    // A timestamp in nanoseconds which defines the early bound of the time span
    // for this query.
    StartNanos int64 `protobuf:"varint,1,opt,name=start_nanos,json=startNanos" json:"start_nanos"`
    // A timestamp in nanoseconds which defines the late bound of the time span
    // for this query. Must be greater than start_nanos.
    EndNanos int64 `protobuf:"varint,2,opt,name=end_nanos,json=endNanos" json:"end_nanos"`
    // A set of Queries for this request. A request must have at least one
    // Query.
    Queries []Query `protobuf:"bytes,3,rep,name=queries" json:"queries"`
}

TimeSeriesQueryRequest is the standard incoming time series query request accepted from cockroach clients.

func (*TimeSeriesQueryRequest) Descriptor Uses

func (*TimeSeriesQueryRequest) Descriptor() ([]byte, []int)

func (*TimeSeriesQueryRequest) Marshal Uses

func (m *TimeSeriesQueryRequest) Marshal() (data []byte, err error)

func (*TimeSeriesQueryRequest) MarshalTo Uses

func (m *TimeSeriesQueryRequest) MarshalTo(data []byte) (int, error)

func (*TimeSeriesQueryRequest) ProtoMessage Uses

func (*TimeSeriesQueryRequest) ProtoMessage()

func (*TimeSeriesQueryRequest) Reset Uses

func (m *TimeSeriesQueryRequest) Reset()

func (*TimeSeriesQueryRequest) Size Uses

func (m *TimeSeriesQueryRequest) Size() (n int)

func (*TimeSeriesQueryRequest) String Uses

func (m *TimeSeriesQueryRequest) String() string

func (*TimeSeriesQueryRequest) Unmarshal Uses

func (m *TimeSeriesQueryRequest) Unmarshal(data []byte) error

type TimeSeriesQueryResponse Uses

type TimeSeriesQueryResponse struct {
    // A set of Results; there will be one result for each Query in the matching
    // TimeSeriesQueryRequest, in the same order. A Result will be present for
    // each Query even if there are zero datapoints to return.
    Results []TimeSeriesQueryResponse_Result `protobuf:"bytes,1,rep,name=results" json:"results"`
}

TimeSeriesQueryResponse is the standard response for time series queries returned to cockroach clients.

func (*TimeSeriesQueryResponse) Descriptor Uses

func (*TimeSeriesQueryResponse) Descriptor() ([]byte, []int)

func (*TimeSeriesQueryResponse) Marshal Uses

func (m *TimeSeriesQueryResponse) Marshal() (data []byte, err error)

func (*TimeSeriesQueryResponse) MarshalTo Uses

func (m *TimeSeriesQueryResponse) MarshalTo(data []byte) (int, error)

func (*TimeSeriesQueryResponse) ProtoMessage Uses

func (*TimeSeriesQueryResponse) ProtoMessage()

func (*TimeSeriesQueryResponse) Reset Uses

func (m *TimeSeriesQueryResponse) Reset()

func (*TimeSeriesQueryResponse) Size Uses

func (m *TimeSeriesQueryResponse) Size() (n int)

func (*TimeSeriesQueryResponse) String Uses

func (m *TimeSeriesQueryResponse) String() string

func (*TimeSeriesQueryResponse) Unmarshal Uses

func (m *TimeSeriesQueryResponse) Unmarshal(data []byte) error

type TimeSeriesQueryResponse_Result Uses

type TimeSeriesQueryResponse_Result struct {
    Query      `protobuf:"bytes,1,opt,name=query,embedded=query" json:"query"`
    Datapoints []TimeSeriesDatapoint `protobuf:"bytes,2,rep,name=datapoints" json:"datapoints"`
}

Result is the data returned from a single metric query over a time span.

func (*TimeSeriesQueryResponse_Result) Descriptor Uses

func (*TimeSeriesQueryResponse_Result) Descriptor() ([]byte, []int)

func (*TimeSeriesQueryResponse_Result) Marshal Uses

func (m *TimeSeriesQueryResponse_Result) Marshal() (data []byte, err error)

func (*TimeSeriesQueryResponse_Result) MarshalTo Uses

func (m *TimeSeriesQueryResponse_Result) MarshalTo(data []byte) (int, error)

func (*TimeSeriesQueryResponse_Result) ProtoMessage Uses

func (*TimeSeriesQueryResponse_Result) ProtoMessage()

func (*TimeSeriesQueryResponse_Result) Reset Uses

func (m *TimeSeriesQueryResponse_Result) Reset()

func (*TimeSeriesQueryResponse_Result) Size Uses

func (m *TimeSeriesQueryResponse_Result) Size() (n int)

func (*TimeSeriesQueryResponse_Result) String Uses

func (m *TimeSeriesQueryResponse_Result) String() string

func (*TimeSeriesQueryResponse_Result) Unmarshal Uses

func (m *TimeSeriesQueryResponse_Result) Unmarshal(data []byte) error

type TimeSeriesServer Uses

type TimeSeriesServer interface {
    // URL: /ts/query
    Query(context.Context, *TimeSeriesQueryRequest) (*TimeSeriesQueryResponse, error)
}

Package tspb imports 13 packages (graph). Updated 2017-03-13. Refresh now. Tools for package owners. This is a dead-end fork (no commits since the fork).