Update influx package to support MonitoredServices
The Timeseries interface was updated to include MonitoredServices as part of its spec. This adds a stub implementation of that.pull/53/head
parent
baf41951ea
commit
536fa7de8f
|
@ -12,7 +12,9 @@ type Client struct {
|
|||
ix ixClient.Client
|
||||
}
|
||||
|
||||
// NewClient initializes a Client
|
||||
// NewClient initializes an HTTP Client for InfluxDB. UDP, although supported
|
||||
// for querying InfluxDB, is not supported here to remove the need to
|
||||
// explicitly Close the client.
|
||||
func NewClient(host string) (*Client, error) {
|
||||
cl, err := ixClient.NewHTTPClient(ixClient.HTTPConfig{
|
||||
Addr: host,
|
||||
|
@ -46,3 +48,9 @@ func (c *Client) Query(ctx context.Context, query mrfusion.Query) (mrfusion.Resp
|
|||
return nil, TimeoutError{}
|
||||
}
|
||||
}
|
||||
|
||||
// MonitoredServices returns all services for which this instance of InfluxDB
|
||||
// has time series information stored for.
|
||||
func (c *Client) MonitoredServices(ctx context.Context) ([]mrfusion.MonitoredService, error) {
|
||||
return []mrfusion.MonitoredService{}, nil
|
||||
}
|
||||
|
|
|
@ -121,6 +121,10 @@ type Response struct {
|
|||
results []mrfusion.Result
|
||||
}
|
||||
|
||||
func (r *Response) MarshalJSON() ([]byte, error) {
|
||||
return []byte(`{}`), nil
|
||||
}
|
||||
|
||||
var SampleResponse mrfusion.Response = NewResponse(SampleResult)
|
||||
|
||||
func NewResponse(result mrfusion.Result) mrfusion.Response {
|
||||
|
|
Loading…
Reference in New Issue