Documentation ¶
Overview ¶
Package influxdb provides the InfluxDB Origin Type
Index ¶
- func NewClient(name string, oc *oo.Options, router http.Handler, cache cache.Cache) (origins.Client, error)
- type Client
- func (c *Client) Cache() cache.Cache
- func (c *Client) Configuration() *oo.Options
- func (c *Client) DefaultPathConfigs(oc *oo.Options) map[string]*po.Options
- func (c Client) FastForwardRequest(r *http.Request) (*http.Request, error)
- func (c *Client) HTTPClient() *http.Client
- func (c *Client) Handlers() map[string]http.Handler
- func (c *Client) HealthHandler(w http.ResponseWriter, r *http.Request)
- func (c Client) MarshalTimeseries(ts timeseries.Timeseries) ([]byte, error)
- func (c *Client) Name() string
- func (c *Client) ParseTimeRangeQuery(r *http.Request) (*timeseries.TimeRangeQuery, error)
- func (c *Client) ProxyHandler(w http.ResponseWriter, r *http.Request)
- func (c *Client) QueryHandler(w http.ResponseWriter, r *http.Request)
- func (c *Client) Router() http.Handler
- func (c *Client) SetCache(cc cache.Cache)
- func (c Client) SetExtent(r *http.Request, trq *timeseries.TimeRangeQuery, extent *timeseries.Extent)
- func (c Client) UnmarshalInstantaneous(data []byte) (timeseries.Timeseries, error)
- func (c Client) UnmarshalTimeseries(data []byte) (timeseries.Timeseries, error)
- type Result
- type SeriesEnvelope
- func (se *SeriesEnvelope) Clone() timeseries.Timeseries
- func (se *SeriesEnvelope) CropToRange(e timeseries.Extent)
- func (se *SeriesEnvelope) CropToSize(sz int, t time.Time, lur timeseries.Extent)
- func (se *SeriesEnvelope) Extents() timeseries.ExtentList
- func (se *SeriesEnvelope) Merge(sort bool, collection ...timeseries.Timeseries)
- func (se *SeriesEnvelope) SeriesCount() int
- func (se *SeriesEnvelope) SetExtents(extents timeseries.ExtentList)
- func (se *SeriesEnvelope) SetStep(step time.Duration)
- func (se *SeriesEnvelope) Size() int
- func (se *SeriesEnvelope) Sort()
- func (se *SeriesEnvelope) Step() time.Duration
- func (se *SeriesEnvelope) TimestampCount() int
- func (se *SeriesEnvelope) ValueCount() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client Implements the Proxy Client Interface
func (*Client) Configuration ¶
Configuration returns the upstream Configuration for this Client
func (*Client) DefaultPathConfigs ¶
DefaultPathConfigs returns the default PathConfigs for the given OriginType
func (Client) FastForwardRequest ¶
FastForwardRequest is not used for InfluxDB and is here to conform to the Proxy Client interface
func (*Client) HTTPClient ¶
HTTPClient returns the HTTP Transport the client is using
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) 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 ¶
Router returns the http.Handler that handles request routing for this Client
func (*Client) SetCache ¶
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