Documentation ¶
Index ¶
- Constants
- type AutoBatchOpt
- type AutoBatchOptAsyncFlush
- type AutoBatchWriter
- func (instance *AutoBatchWriter) AddToBatch(series *Series, ts uint64, v float64) error
- func (instance *AutoBatchWriter) AsyncFlush() bool
- func (instance *AutoBatchWriter) Close() error
- func (instance *AutoBatchWriter) Errors(intOpts ...int) chan error
- func (instance *AutoBatchWriter) Flush() error
- func (instance *AutoBatchWriter) FlushCount() uint64
- func (instance *AutoBatchWriter) SetPostFlushFn(postFlushFn func())
- type BatchItem
- type BatchWriter
- type ConnectionPool
- type EagerInitSeriesHelper
- type GenericPool
- type IClosablePoolValue
- type IPool
- type InitState
- type Instance
- func (client *Instance) Close()
- func (client *Instance) EagerInitSeries(series *Series)
- func (client *Instance) GetConnection() (managedConnection *ManagedConnection, err error)
- func (client *Instance) MultiQueryBuilder() *MultiQueryBuilder
- func (client *Instance) NewAutoBatchWriter(batchSize uint64, timeout time.Duration, opts ...AutoBatchOpt) *AutoBatchWriter
- func (client *Instance) NewBatchWriter() *BatchWriter
- func (client *Instance) NewClient() (*ManagedConnection, error)
- func (client *Instance) NewConnectionPool() *ConnectionPool
- func (client *Instance) Now() uint64
- func (client *Instance) Series(name string, opts ...SeriesOpt) *Series
- func (client *Instance) SeriesPool() *SeriesPooldeprecated
- type ManagedConnection
- type MultiQueryBuilder
- type MultiQueryResult
- type Opts
- type PoolOpts
- type Query
- type QueryBuilder
- type QueryResult
- type QueryResultIterator
- type Series
- func (series *Series) Create() (id uint64, err error)
- func (series *Series) Id() uint64
- func (series *Series) Init(conn *ManagedConnection) (id uint64, err error)
- func (series *Series) InitState() InitState
- func (series *Series) Name() string
- func (series *Series) Namespace() int
- func (series *Series) NoOp() (err error)
- func (series *Series) QueryBuilder() *QueryBuilder
- func (series *Series) ResetInit()
- func (series *Series) SetInitState(state InitState)
- func (series *Series) TTL() uint
- func (series *Series) Tags() []string
- func (series *Series) Write(ts uint64, v float64) (res WriteResult)
- type SeriesNamespace
- type SeriesOpt
- type SeriesPool
- type SeriesTTL
- type SeriesTags
- type WriteResult
Constants ¶
View Source
const DefaultPoolTtl = 1 * time.Hour
View Source
const DefaultRpcBaseSleep = 100 * time.Millisecond
View Source
const EagerSeriesInitTimeout = time.Second * 10
View Source
const ErrorState = 4
View Source
const InitialState = 0
View Source
const PanicState = 2
View Source
const QueryBuilderFromInf uint64 = 1
View Source
const QueryBuilderToInf uint64 = math.MaxUint64
View Source
const SuccessState = 3
View Source
const TimeoutState = 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoBatchOpt ¶
type AutoBatchOpt interface {
Apply(*AutoBatchWriter) error
}
type AutoBatchOptAsyncFlush ¶
type AutoBatchOptAsyncFlush struct {
// contains filtered or unexported fields
}
func NewAutoBatchOptAsyncFlush ¶
func NewAutoBatchOptAsyncFlush(val bool) *AutoBatchOptAsyncFlush
func (*AutoBatchOptAsyncFlush) Apply ¶
func (opt *AutoBatchOptAsyncFlush) Apply(w *AutoBatchWriter) error
type AutoBatchWriter ¶
type AutoBatchWriter struct {
// contains filtered or unexported fields
}
func (*AutoBatchWriter) AddToBatch ¶
func (instance *AutoBatchWriter) AddToBatch(series *Series, ts uint64, v float64) error
func (*AutoBatchWriter) AsyncFlush ¶
func (instance *AutoBatchWriter) AsyncFlush() bool
func (*AutoBatchWriter) Close ¶
func (instance *AutoBatchWriter) Close() error
func (*AutoBatchWriter) Errors ¶
func (instance *AutoBatchWriter) Errors(intOpts ...int) chan error
subscribe to this channel to prevent panics in the ticker
func (*AutoBatchWriter) Flush ¶
func (instance *AutoBatchWriter) Flush() error
func (*AutoBatchWriter) FlushCount ¶
func (instance *AutoBatchWriter) FlushCount() uint64
func (*AutoBatchWriter) SetPostFlushFn ¶
func (instance *AutoBatchWriter) SetPostFlushFn(postFlushFn func())
type BatchWriter ¶
type BatchWriter struct {
// contains filtered or unexported fields
}
func (*BatchWriter) AddToBatch ¶
func (batch *BatchWriter) AddToBatch(series *Series, ts uint64, v float64) error
func (*BatchWriter) Execute ¶
func (batch *BatchWriter) Execute() (res WriteResult)
func (*BatchWriter) Size ¶
func (batch *BatchWriter) Size() int
func (*BatchWriter) ToWriteRequest ¶
func (batch *BatchWriter) ToWriteRequest(conn *ManagedConnection) (request types.WriteRequest, err error)
type ConnectionPool ¶
type ConnectionPool struct {
GenericPool
}
type EagerInitSeriesHelper ¶
type EagerInitSeriesHelper struct {
// contains filtered or unexported fields
}
func (*EagerInitSeriesHelper) SetPreEagerInitFn ¶
func (helper *EagerInitSeriesHelper) SetPreEagerInitFn(f func(series *Series))
type GenericPool ¶
type GenericPool struct { New func() interface{} // contains filtered or unexported fields }
func NewGenericPool ¶
func NewGenericPool(opts PoolOpts) GenericPool
func (*GenericPool) Capacity ¶
func (p *GenericPool) Capacity() int
func (*GenericPool) Discard ¶
func (p *GenericPool) Discard(_ interface{})
func (*GenericPool) Get ¶
func (p *GenericPool) Get() interface{}
func (*GenericPool) Put ¶
func (p *GenericPool) Put(v interface{})
func (*GenericPool) Size ¶
func (p *GenericPool) Size() int
type IClosablePoolValue ¶
type IClosablePoolValue interface {
DiscardPool()
}
type Instance ¶
type Instance struct { *EagerInitSeriesHelper // contains filtered or unexported fields }
func DefaultClient ¶
func DefaultClient() *Instance
func (*Instance) EagerInitSeries ¶
func (*Instance) GetConnection ¶
func (client *Instance) GetConnection() (managedConnection *ManagedConnection, err error)
func (*Instance) MultiQueryBuilder ¶
func (client *Instance) MultiQueryBuilder() *MultiQueryBuilder
func (*Instance) NewAutoBatchWriter ¶
func (client *Instance) NewAutoBatchWriter(batchSize uint64, timeout time.Duration, opts ...AutoBatchOpt) *AutoBatchWriter
func (*Instance) NewBatchWriter ¶
func (client *Instance) NewBatchWriter() *BatchWriter
func (*Instance) NewClient ¶
func (client *Instance) NewClient() (*ManagedConnection, error)
func (*Instance) NewConnectionPool ¶
func (client *Instance) NewConnectionPool() *ConnectionPool
func (*Instance) SeriesPool
deprecated
func (client *Instance) SeriesPool() *SeriesPool
Deprecated: only use for testing
type ManagedConnection ¶
type ManagedConnection struct {
// contains filtered or unexported fields
}
func (*ManagedConnection) Close ¶
func (conn *ManagedConnection) Close() error
func (*ManagedConnection) Discard ¶
func (conn *ManagedConnection) Discard()
Discard call this to make sure connection is not reused
func (*ManagedConnection) DiscardPool ¶
func (conn *ManagedConnection) DiscardPool()
type MultiQueryBuilder ¶
type MultiQueryBuilder struct {
// contains filtered or unexported fields
}
func (*MultiQueryBuilder) AddQuery ¶
func (multi *MultiQueryBuilder) AddQuery(queryBuilder *QueryBuilder) error
func (*MultiQueryBuilder) Execute ¶
func (multi *MultiQueryBuilder) Execute() (res MultiQueryResult)
will return queries in the order as they are added via AddQuery
type MultiQueryResult ¶
type MultiQueryResult struct { Error error Results []QueryResult // indexed by the queries provided }
type Opts ¶
type Opts struct { rpc.OptsConnection SeriesCacheSize int64 EagerInitSeries bool // will load metadata on creation (async, instead of during flush, more equally spreading out load) }
type QueryBuilder ¶
type QueryBuilder struct {
// contains filtered or unexported fields
}
func (*QueryBuilder) Execute ¶
func (builder *QueryBuilder) Execute() (res QueryResult)
func (*QueryBuilder) From ¶
func (builder *QueryBuilder) From(from uint64) *QueryBuilder
func (*QueryBuilder) IsValid ¶
func (builder *QueryBuilder) IsValid() error
func (*QueryBuilder) To ¶
func (builder *QueryBuilder) To(to uint64) *QueryBuilder
func (*QueryBuilder) ToQuery ¶
func (builder *QueryBuilder) ToQuery() (*Query, error)
type QueryResult ¶
type QueryResult struct { Series *Series Error error Results map[uint64]float64 // in random order due to Go map implementation, if you need sorted results call QueryResult.Iterator() }
func (QueryResult) Iterator ¶
func (res QueryResult) Iterator() *QueryResultIterator
type QueryResultIterator ¶
type QueryResultIterator struct {
// contains filtered or unexported fields
}
func (*QueryResultIterator) Next ¶
func (iter *QueryResultIterator) Next() bool
func (*QueryResultIterator) Reset ¶
func (iter *QueryResultIterator) Reset()
func (*QueryResultIterator) Value ¶
func (iter *QueryResultIterator) Value() (uint64, float64)
type Series ¶
type Series struct {
// contains filtered or unexported fields
}
func (*Series) QueryBuilder ¶
func (series *Series) QueryBuilder() *QueryBuilder
func (*Series) SetInitState ¶
type SeriesNamespace ¶
type SeriesNamespace struct {
// contains filtered or unexported fields
}
func NewSeriesNamespace ¶
func NewSeriesNamespace(namespace int) *SeriesNamespace
func (SeriesNamespace) Apply ¶
func (opt SeriesNamespace) Apply(series *Series) error
type SeriesPool ¶
type SeriesPool struct {
// contains filtered or unexported fields
}
func NewSeriesPool ¶
func NewSeriesPool(clientOpts *Opts) *SeriesPool
func (*SeriesPool) Count ¶
func (pool *SeriesPool) Count() int
func (*SeriesPool) EvictCache
deprecated
func (pool *SeriesPool) EvictCache() int
Deprecated: only use for testing
func (*SeriesPool) Get ¶
func (pool *SeriesPool) Get(name string) *Series
func (*SeriesPool) Hits ¶
func (pool *SeriesPool) Hits() uint64
func (*SeriesPool) Set ¶
func (pool *SeriesPool) Set(name string, value *Series)
type SeriesTTL ¶
type SeriesTTL struct {
// contains filtered or unexported fields
}
func NewSeriesTTL ¶
expires the whole series after creation. e.g. setting this to 86400 the whole series will be removed after 1 day, regardless of additional timeseries values being added
type SeriesTags ¶
type SeriesTags struct {
// contains filtered or unexported fields
}
func NewSeriesTags ¶
func NewSeriesTags(tags ...string) *SeriesTags
func (SeriesTags) Apply ¶
func (opt SeriesTags) Apply(series *Series) error
type WriteResult ¶
Source Files ¶
- client.go
- connection.go
- connection_pool.go
- multi_query_result.go
- noop.go
- opts.go
- panicer.go
- query_builder.go
- query_builder_multi.go
- query_result.go
- retry_handler.go
- series.go
- series_init.go
- series_namespace.go
- series_opts.go
- series_pool.go
- series_tags.go
- series_ttl.go
- time.go
- writer.go
- writer_batch.go
- writer_batch_auto.go
Click to show internal directories.
Click to hide internal directories.