influxdb

package
v1.1.0-beta5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package influxdb provides the InfluxDB Origin Type

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client Implements the Proxy Client Interface

func NewClient

func NewClient(name string, oc *oo.Options, router http.Handler,
	cache cache.Cache) (*Client, error)

NewClient returns a new Client Instance

func (*Client) Cache

func (c *Client) Cache() cache.Cache

Cache returns and handle to the Cache instance used by the Client

func (*Client) Configuration

func (c *Client) Configuration() *oo.Options

Configuration returns the upstream Configuration for this Client

func (*Client) DefaultPathConfigs

func (c *Client) DefaultPathConfigs(oc *oo.Options) map[string]*po.Options

DefaultPathConfigs returns the default PathConfigs for the given OriginType

func (Client) FastForwardURL

func (c Client) FastForwardURL(r *http.Request) (*url.URL, error)

FastForwardURL is not used for InfluxDB and is here to conform to the Proxy Client interface

func (*Client) HTTPClient

func (c *Client) HTTPClient() *http.Client

HTTPClient returns the HTTP Transport the client is using

func (*Client) Handlers

func (c *Client) Handlers() map[string]http.Handler

Handlers returns a map of the HTTP Handlers the client has registered

func (*Client) HealthHandler

func (c *Client) HealthHandler(w http.ResponseWriter, r *http.Request)

HealthHandler checks the health of the Configured Upstream Origin

func (Client) MarshalTimeseries

func (c Client) MarshalTimeseries(ts timeseries.Timeseries) ([]byte, error)

MarshalTimeseries converts a Timeseries into a JSON blob

func (*Client) Name

func (c *Client) Name() string

Name returns the name of the upstream Configuration proxied by the Client

func (*Client) ParseTimeRangeQuery

func (c *Client) ParseTimeRangeQuery(r *http.Request) (*timeseries.TimeRangeQuery, error)

ParseTimeRangeQuery parses the key parts of a TimeRangeQuery from the inbound HTTP Request

func (*Client) ProxyHandler

func (c *Client) ProxyHandler(w http.ResponseWriter, r *http.Request)

ProxyHandler sends a request through the basic reverse proxy to the origin, and services non-cacheable InfluxDB API calls

func (*Client) QueryHandler

func (c *Client) QueryHandler(w http.ResponseWriter, r *http.Request)

QueryHandler handles timeseries requests for InfluxDB and processes them through the delta proxy cache

func (*Client) Router

func (c *Client) Router() http.Handler

Router returns the http.Handler that handles request routing for this Client

func (*Client) SetCache

func (c *Client) SetCache(cc cache.Cache)

SetCache sets the Cache object the client will use for caching origin content

func (Client) SetExtent

func (c Client) SetExtent(r *http.Request, trq *timeseries.TimeRangeQuery, extent *timeseries.Extent)

SetExtent will change the upstream request query to use the provided Extent

func (Client) UnmarshalInstantaneous

func (c Client) UnmarshalInstantaneous(data []byte) (timeseries.Timeseries, error)

UnmarshalInstantaneous is not used for InfluxDB and is here to conform to the Proxy Client interface

func (Client) UnmarshalTimeseries

func (c Client) UnmarshalTimeseries(data []byte) (timeseries.Timeseries, error)

UnmarshalTimeseries converts a JSON blob into a Timeseries

type Result

type Result struct {
	StatementID int          `json:"statement_id"`
	Series      []models.Row `json:"series,omitempty"`
	Err         string       `json:"error,omitempty"`
}

Result represents a Result returned from the InfluxDB HTTP API

type SeriesEnvelope

type SeriesEnvelope struct {
	Results      []Result              `json:"results"`
	Err          string                `json:"error,omitempty"`
	StepDuration time.Duration         `json:"step,omitempty"`
	ExtentList   timeseries.ExtentList `json:"extents,omitempty"`
	// contains filtered or unexported fields
}

SeriesEnvelope represents a response object from the InfluxDB HTTP API

func (*SeriesEnvelope) Clone

func (se *SeriesEnvelope) Clone() timeseries.Timeseries

Clone returns a perfect copy of the base Timeseries

func (*SeriesEnvelope) CropToRange

func (se *SeriesEnvelope) CropToRange(e timeseries.Extent)

CropToRange reduces the Timeseries down to timestamps contained within the provided Extents (inclusive). CropToRange assumes the base Timeseries is already sorted, and will corrupt an unsorted Timeseries

func (*SeriesEnvelope) CropToSize

func (se *SeriesEnvelope) CropToSize(sz int, t time.Time, lur timeseries.Extent)

CropToSize reduces the number of elements in the Timeseries to the provided count, by evicting elements using a least-recently-used methodology. The time parameter limits the upper extent to the provided time, in order to support backfill tolerance

func (*SeriesEnvelope) Extents

func (se *SeriesEnvelope) Extents() timeseries.ExtentList

Extents returns the Timeseries's ExentList

func (*SeriesEnvelope) Merge

func (se *SeriesEnvelope) Merge(sort bool, collection ...timeseries.Timeseries)

Merge merges the provided Timeseries list into the base Timeseries (in the order provided) and optionally sorts the merged Timeseries

func (*SeriesEnvelope) SeriesCount

func (se *SeriesEnvelope) SeriesCount() int

SeriesCount returns the count of all Results in the Timeseries it is called SeriesCount due to Interface conformity and the disparity in nomenclature between various TSDBs.

func (*SeriesEnvelope) SetExtents

func (se *SeriesEnvelope) SetExtents(extents timeseries.ExtentList)

SetExtents overwrites a Timeseries's known extents with the provided extent list

func (*SeriesEnvelope) SetStep

func (se *SeriesEnvelope) SetStep(step time.Duration)

SetStep sets the step for the Timeseries

func (*SeriesEnvelope) Size

func (se *SeriesEnvelope) Size() int

Size returns the approximate memory utilization in bytes of the timeseries

func (*SeriesEnvelope) Sort

func (se *SeriesEnvelope) Sort()

Sort sorts all Values in each Series chronologically by their timestamp

func (*SeriesEnvelope) Step

func (se *SeriesEnvelope) Step() time.Duration

Step returns the step for the Timeseries

func (*SeriesEnvelope) TimestampCount

func (se *SeriesEnvelope) TimestampCount() int

TimestampCount returns the count unique timestampes in across all series in the Timeseries

func (*SeriesEnvelope) ValueCount

func (se *SeriesEnvelope) ValueCount() int

ValueCount returns the count of all values across all series in the Timeseries

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL