cockroach: github.com/cockroachdb/cockroach/pkg/ts/catalog Index | Files

package catalog

import "github.com/cockroachdb/cockroach/pkg/ts/catalog"

Index

Package Files

catalog_generator.go chart_catalog.go chart_catalog.pb.go

Constants

const (
    Process            = `Process`
    SQLLayer           = `SQL Layer`
    KVTransactionLayer = `KV Transaction Layer`
    DistributionLayer  = `Distribution Layer`
    ReplicationLayer   = `Replication Layer`
    StorageLayer       = `Storage Layer`
    Timeseries         = `Timeseries`
)

These consts represent the top levels of the hierarchy:

Variables

var (
    ErrInvalidLengthChartCatalog = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowChartCatalog   = fmt.Errorf("proto: integer overflow")
)
var AxisUnits_name = map[int32]string{
    0:  "UNSET_UNITS",
    1:  "COUNT",
    2:  "BYTES",
    3:  "DURATION",
}
var AxisUnits_value = map[string]int32{
    "UNSET_UNITS": 0,
    "COUNT":       1,
    "BYTES":       2,
    "DURATION":    3,
}
var DescribeAggregator_name = map[int32]string{
    0:  "UNSET_AGG",
    1:  "AVG",
    2:  "SUM",
    3:  "MAX",
    4:  "MIN",
}
var DescribeAggregator_value = map[string]int32{
    "UNSET_AGG": 0,
    "AVG":       1,
    "SUM":       2,
    "MAX":       3,
    "MIN":       4,
}
var DescribeDerivative_name = map[int32]string{
    0:  "UNSET_DER",
    1:  "NONE",
    2:  "DERIVATIVE",
    3:  "NON_NEGATIVE_DERIVATIVE",
}
var DescribeDerivative_value = map[string]int32{
    "UNSET_DER":               0,
    "NONE":                    1,
    "DERIVATIVE":              2,
    "NON_NEGATIVE_DERIVATIVE": 3,
}

type AxisUnits Uses

type AxisUnits int32

AxisUnits describes the Unit options available in the Admin UI. It is defined here as opposed to importing the value from the Admin UI because the existing pb doesn't include an UNSET value, which we use to check for defaults.

const (
    // UNSET_UNITS expresses that the metric's DisplayUnit wasn't explicitly set.
    AxisUnits_UNSET_UNITS AxisUnits = 0
    // COUNT expresses that the metric's measurement is a count.
    AxisUnits_COUNT AxisUnits = 1
    // BYTES expresses that the metric's measurement is in bytes.
    AxisUnits_BYTES AxisUnits = 2
    // DURATION expresses that the metric's measurement represents some unit of time.
    AxisUnits_DURATION AxisUnits = 3
)

func (AxisUnits) Enum Uses

func (x AxisUnits) Enum() *AxisUnits

func (AxisUnits) EnumDescriptor Uses

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

func (AxisUnits) String Uses

func (x AxisUnits) String() string

func (*AxisUnits) UnmarshalJSON Uses

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

type ChartMetric Uses

type ChartMetric struct {
    // name is the name of the metric.
    Name string `protobuf:"bytes,1,req,name=name" json:"name"`
    // help is the help text from the metric.
    Help string `protobuf:"bytes,2,req,name=help" json:"help"`
    // axisLabel is the label for the metric's y-axis.
    AxisLabel string `protobuf:"bytes,3,req,name=axisLabel" json:"axisLabel"`
    // preferredUnits describes the units the chart should be viewed with
    // e.g. BYTES for storage.
    PreferredUnits AxisUnits `protobuf:"varint,4,req,name=preferredUnits,enum=cockroach.ts.catalog.AxisUnits" json:"preferredUnits"`
    // metricType describes the type of metric this is; all metrics on a chart
    // should be of the same type to ensure the information displays behaves in
    // expected ways.
    MetricType _go.MetricType `protobuf:"varint,5,opt,name=metricType,enum=io.prometheus.client.MetricType" json:"metricType"`
}

ChartMetric converts cockroach.util.metric.Metadata into a struct that's useful for generating Admin UI charts.

func (*ChartMetric) Descriptor Uses

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

func (*ChartMetric) Marshal Uses

func (m *ChartMetric) Marshal() (dAtA []byte, err error)

func (*ChartMetric) MarshalTo Uses

func (m *ChartMetric) MarshalTo(dAtA []byte) (int, error)

func (*ChartMetric) ProtoMessage Uses

func (*ChartMetric) ProtoMessage()

func (*ChartMetric) Reset Uses

func (m *ChartMetric) Reset()

func (*ChartMetric) Size Uses

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

func (*ChartMetric) String Uses

func (m *ChartMetric) String() string

func (*ChartMetric) Unmarshal Uses

func (m *ChartMetric) Unmarshal(dAtA []byte) error

func (*ChartMetric) XXX_DiscardUnknown Uses

func (m *ChartMetric) XXX_DiscardUnknown()

func (*ChartMetric) XXX_Marshal Uses

func (m *ChartMetric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ChartMetric) XXX_Merge Uses

func (dst *ChartMetric) XXX_Merge(src proto.Message)

func (*ChartMetric) XXX_Size Uses

func (m *ChartMetric) XXX_Size() int

func (*ChartMetric) XXX_Unmarshal Uses

func (m *ChartMetric) XXX_Unmarshal(b []byte) error

type ChartSection Uses

type ChartSection struct {
    // title is the title of the section.
    Title string `protobuf:"bytes,1,req,name=title" json:"title"`
    // longname displays the section's organization within the catalog.
    LongTitle string `protobuf:"bytes,2,req,name=longTitle" json:"longTitle"`
    // collectionName uniquely identifies a section.
    CollectionTitle string `protobuf:"bytes,3,req,name=collectionTitle" json:"collectionTitle"`
    // description describes how to interpret the relationship of subsections
    // and charts. It's only planned use is in the catalog page for Level 0
    // sections.
    Description string `protobuf:"bytes,4,req,name=description" json:"description"`
    // level represents the section's depth in the catalog's organization.
    Level int32 `protobuf:"varint,5,req,name=level" json:"level"`
    // subsections are deeper levels of the chart's organization.
    Subsections []*ChartSection `protobuf:"bytes,6,rep,name=subsections" json:"subsections,omitempty"`
    // charts are the IndividualCharts that are grouped into this section.
    Charts []*IndividualChart `protobuf:"bytes,7,rep,name=charts" json:"charts,omitempty"`
}

ChartSections organize charts into groups that contain slices or charts and other subsections.

func GenerateCatalog Uses

func GenerateCatalog(metadata map[string]metric.Metadata) ([]ChartSection, error)

GenerateCatalog creates an array of ChartSections, which is served at /_admin/v1/chartcatalog.

func (*ChartSection) Descriptor Uses

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

func (*ChartSection) Marshal Uses

func (m *ChartSection) Marshal() (dAtA []byte, err error)

func (*ChartSection) MarshalTo Uses

func (m *ChartSection) MarshalTo(dAtA []byte) (int, error)

func (*ChartSection) ProtoMessage Uses

func (*ChartSection) ProtoMessage()

func (*ChartSection) Reset Uses

func (m *ChartSection) Reset()

func (*ChartSection) Size Uses

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

func (*ChartSection) String Uses

func (m *ChartSection) String() string

func (*ChartSection) Unmarshal Uses

func (m *ChartSection) Unmarshal(dAtA []byte) error

func (*ChartSection) XXX_DiscardUnknown Uses

func (m *ChartSection) XXX_DiscardUnknown()

func (*ChartSection) XXX_Marshal Uses

func (m *ChartSection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ChartSection) XXX_Merge Uses

func (dst *ChartSection) XXX_Merge(src proto.Message)

func (*ChartSection) XXX_Size Uses

func (m *ChartSection) XXX_Size() int

func (*ChartSection) XXX_Unmarshal Uses

func (m *ChartSection) XXX_Unmarshal(b []byte) error

type DescribeAggregator Uses

type DescribeAggregator int32

DescribeAggregator works as a proxy for cockroach.ts.tspb.TimeSeriesQueryAggregator which does not support an unset zero value.

const (
    // UNSET_AGG expresses that the Aggregator value wasn't explicitly set and should
    // use the default value for the respective metric type defined in chart_catalog.go.
    DescribeAggregator_UNSET_AGG DescribeAggregator = 0
    // AVG returns the average value of datapoints.
    DescribeAggregator_AVG DescribeAggregator = 1
    // SUM returns the sum value of datapoints.
    DescribeAggregator_SUM DescribeAggregator = 2
    // MAX returns the maximum value of datapoints.
    DescribeAggregator_MAX DescribeAggregator = 3
    // MIN returns the minimum value of datapoints.
    DescribeAggregator_MIN DescribeAggregator = 4
)

func (DescribeAggregator) Enum Uses

func (x DescribeAggregator) Enum() *DescribeAggregator

func (DescribeAggregator) EnumDescriptor Uses

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

func (DescribeAggregator) String Uses

func (x DescribeAggregator) String() string

func (*DescribeAggregator) UnmarshalJSON Uses

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

type DescribeDerivative Uses

type DescribeDerivative int32

DescribeDerivative works as a proxy for cockroach.ts.tspb.TimeSeriesQueryDerivative which has an ambiguous zero value; it's unclear if the value isn't set or if it is intentionally set to NONE.

const (
    // UNSET_DER expresses that the Derivative value wasn't explicitly set and should
    // use the default value for the respective metric type defined in chart_catalog.go.
    DescribeDerivative_UNSET_DER DescribeDerivative = 0
    // NONE does not apply a derivative function.
    DescribeDerivative_NONE DescribeDerivative = 1
    // DERIVATIVE returns the first-order derivative of values in the time series.
    DescribeDerivative_DERIVATIVE DescribeDerivative = 2
    // 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.
    DescribeDerivative_NON_NEGATIVE_DERIVATIVE DescribeDerivative = 3
)

func (DescribeDerivative) Enum Uses

func (x DescribeDerivative) Enum() *DescribeDerivative

func (DescribeDerivative) EnumDescriptor Uses

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

func (DescribeDerivative) String Uses

func (x DescribeDerivative) String() string

func (*DescribeDerivative) UnmarshalJSON Uses

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

type IndividualChart Uses

type IndividualChart struct {
    // title is the title of the chart.
    Title string `protobuf:"bytes,1,req,name=title" json:"title"`
    // longname displays the chart's organization within the catalog,
    // as well as its own name.
    LongTitle string `protobuf:"bytes,2,req,name=longTitle" json:"longTitle"`
    // collectionName uniquely identifies a chart.
    CollectionTitle string `protobuf:"bytes,3,req,name=collectionTitle" json:"collectionTitle"`
    // downsampler specifies the chart's downsampler function.
    Downsampler *tspb.TimeSeriesQueryAggregator `protobuf:"varint,4,req,name=downsampler,enum=cockroach.ts.tspb.TimeSeriesQueryAggregator" json:"downsampler,omitempty"`
    // aggregator specifies the chart's aggregator function.
    Aggregator *tspb.TimeSeriesQueryAggregator `protobuf:"varint,5,req,name=aggregator,enum=cockroach.ts.tspb.TimeSeriesQueryAggregator" json:"aggregator,omitempty"`
    // derivative specifies the chart's derivative function.
    Derivative *tspb.TimeSeriesQueryDerivative `protobuf:"varint,6,req,name=derivative,enum=cockroach.ts.tspb.TimeSeriesQueryDerivative" json:"derivative,omitempty"`
    // units specifies the Admin UI units to display the chart with.
    Units AxisUnits `protobuf:"varint,7,req,name=units,enum=cockroach.ts.catalog.AxisUnits" json:"units"`
    // axisLabel defines the chart's y-axis label.
    AxisLabel string `protobuf:"bytes,8,req,name=axisLabel" json:"axisLabel"`
    // percentiles specifies whether the chart should have its metrics broken
    // out into percentiles; applies only to histograms.
    Percentiles bool `protobuf:"varint,9,req,name=percentiles" json:"percentiles"`
    // metrics specifies the metics the chart should display.
    Metrics []ChartMetric `protobuf:"bytes,10,rep,name=metrics" json:"metrics"`
}

IndividualChart describes both the properties necessary to display AdminUI charts, as well as a key to find them (collectionName).

func (*IndividualChart) Descriptor Uses

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

func (*IndividualChart) Marshal Uses

func (m *IndividualChart) Marshal() (dAtA []byte, err error)

func (*IndividualChart) MarshalTo Uses

func (m *IndividualChart) MarshalTo(dAtA []byte) (int, error)

func (*IndividualChart) ProtoMessage Uses

func (*IndividualChart) ProtoMessage()

func (*IndividualChart) Reset Uses

func (m *IndividualChart) Reset()

func (*IndividualChart) Size Uses

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

func (*IndividualChart) String Uses

func (m *IndividualChart) String() string

func (*IndividualChart) Unmarshal Uses

func (m *IndividualChart) Unmarshal(dAtA []byte) error

func (*IndividualChart) XXX_DiscardUnknown Uses

func (m *IndividualChart) XXX_DiscardUnknown()

func (*IndividualChart) XXX_Marshal Uses

func (m *IndividualChart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IndividualChart) XXX_Merge Uses

func (dst *IndividualChart) XXX_Merge(src proto.Message)

func (*IndividualChart) XXX_Size Uses

func (m *IndividualChart) XXX_Size() int

func (*IndividualChart) XXX_Unmarshal Uses

func (m *IndividualChart) XXX_Unmarshal(b []byte) error

Package catalog imports 10 packages (graph) and is imported by 4 packages. Updated 2019-09-19. Refresh now. Tools for package owners.