Documentation
¶
Index ¶
- Constants
- type DataQuery
- type Field
- type First
- type Histogram
- type Last
- type Max
- type Min
- type Point
- func (p *Point) AddField(field Field) *Point
- func (p *Point) AddTag(key, value string) *Point
- func (p *Point) Fields() []Field
- func (p *Point) MetricName() string
- func (p *Point) Namespace() string
- func (p *Point) SetNamespace(namespace string) *Point
- func (p *Point) SetTimestamp(timestamp time.Time) *Point
- func (p *Point) Tags() map[string]string
- func (p *Point) Timestamp() time.Time
- func (p *Point) Valid() bool
- type Sum
- type Write
- type WriteOptions
- func (opt *WriteOptions) AddDefaultTag(key, value string) *WriteOptions
- func (opt *WriteOptions) BatchSize() int
- func (opt *WriteOptions) DefaultTags() map[string]string
- func (opt *WriteOptions) FlushInterval() int64
- func (opt *WriteOptions) MaxRetries() int
- func (opt *WriteOptions) RetryBufferLimit() int
- func (opt *WriteOptions) SetBatchSize(batchSize int) *WriteOptions
- func (opt *WriteOptions) SetFlushInterval(interval int64) *WriteOptions
- func (opt *WriteOptions) SetMaxRetries(maxRetries int) *WriteOptions
- func (opt *WriteOptions) SetRetryBufferLimit(retryBufferLimit int) *WriteOptions
- func (opt *WriteOptions) SetUseGZip(useGZip bool) *WriteOptions
- func (opt *WriteOptions) UseGZip() bool
Constants ¶
const (
// ContentTypeFlat represents flat buffer content type.
ContentTypeFlat = "application/flatbuffer"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataQuery ¶ added in v0.0.2
type DataQuery interface { // DataQuery queries time series data from database by given ql. // LinQL ref: https://lindb.io/guide/lin-ql.html#metric-query // Example: select heap_objects from lindb.runtime.mem where 'role' in ('Broker') group by node DataQuery(ctx context.Context, database, ql string) (*models.ResultSet, error) // MetadataQuery queries metric metadata from database by given ql. // LinQL ref: https://lindb.io/guide/lin-ql.html#metric-meta-query // Example: show fields from lindb.runtime.mem MetadataQuery(ctx context.Context, database, ql string) (*models.Metadata, error) }
DataQuery represents data query client for query time series data from database.
type Field ¶
type Field interface {
// contains filtered or unexported methods
}
Field represents field interface.
func NewHistogram ¶
NewHistogram creates a Histogram field.
type First ¶
type First struct {
// contains filtered or unexported fields
}
First represents first field, implements Field interface.
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
Histogram represents histogram field(compound field).
type Last ¶
type Last struct {
// contains filtered or unexported fields
}
Last represents last field, implements Field interface.
type Max ¶
type Max struct {
// contains filtered or unexported fields
}
Max represents max field, implements Field interface.
type Min ¶
type Min struct {
// contains filtered or unexported fields
}
Min represents min field, implements Field interface.
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
Point represents time series data points with name/tags/fields etc.
func (*Point) SetNamespace ¶
SetNamespace sets namespace.
func (*Point) SetTimestamp ¶
SetTimestamp sets timestamp.
type Sum ¶
type Sum struct {
// contains filtered or unexported fields
}
Sum represents sum field, implements Field interface.
type Write ¶
type Write interface { // AddPoint adds a time series point into buffer. AddPoint(ctx context.Context, point *Point) // Errors watches error in background goroutine. Errors() <-chan error // Close closes write client, before close try to send pending points. Close() }
Write represents write client for writing time series data asynchronously.
type WriteOptions ¶
type WriteOptions struct {
// contains filtered or unexported fields
}
WriteOptions represents write configuration.
func DefaultWriteOptions ¶
func DefaultWriteOptions() *WriteOptions
DefaultWriteOptions creates a WriteOptions with default.
func (*WriteOptions) AddDefaultTag ¶
func (opt *WriteOptions) AddDefaultTag(key, value string) *WriteOptions
AddDefaultTag adds default tag.
func (*WriteOptions) BatchSize ¶
func (opt *WriteOptions) BatchSize() int
BatchSize returns the number of batch size in single write request.
func (*WriteOptions) DefaultTags ¶
func (opt *WriteOptions) DefaultTags() map[string]string
DefaultTags returns the default tags for all metrics.
func (*WriteOptions) FlushInterval ¶
func (opt *WriteOptions) FlushInterval() int64
FlushInterval returns the flush interval(ms).
func (*WriteOptions) MaxRetries ¶
func (opt *WriteOptions) MaxRetries() int
MaxRetries returns maximum count of retry attempts of failed write.
func (*WriteOptions) RetryBufferLimit ¶
func (opt *WriteOptions) RetryBufferLimit() int
RetryBufferLimit returns maximum number of write request to keep for retry.
func (*WriteOptions) SetBatchSize ¶
func (opt *WriteOptions) SetBatchSize(batchSize int) *WriteOptions
SetBatchSize sets batch size in single write request.
func (*WriteOptions) SetFlushInterval ¶
func (opt *WriteOptions) SetFlushInterval(interval int64) *WriteOptions
SetFlushInterval sets flush interval(ms).
func (*WriteOptions) SetMaxRetries ¶
func (opt *WriteOptions) SetMaxRetries(maxRetries int) *WriteOptions
SetMaxRetries sets maximum count of retry attempts of failed write.
func (*WriteOptions) SetRetryBufferLimit ¶
func (opt *WriteOptions) SetRetryBufferLimit(retryBufferLimit int) *WriteOptions
SetRetryBufferLimit sets maximum number of write request to keep for retry.
func (*WriteOptions) SetUseGZip ¶
func (opt *WriteOptions) SetUseGZip(useGZip bool) *WriteOptions
SetUseGZip sets whether to use GZip compress write data.
func (*WriteOptions) UseGZip ¶
func (opt *WriteOptions) UseGZip() bool
UseGZip returns whether to use GZip compress write data.