mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-01 14:47:38 +00:00
app/vmctl: remove ping from remote read protocol (#4749)
Ping method was never used, so we remove it.
This commit is contained in:
parent
02dba5f728
commit
2d507a8757
1 changed files with 0 additions and 18 deletions
|
@ -23,7 +23,6 @@ import (
|
||||||
const (
|
const (
|
||||||
defaultReadTimeout = 5 * time.Minute
|
defaultReadTimeout = 5 * time.Minute
|
||||||
remoteReadPath = "/api/v1/read"
|
remoteReadPath = "/api/v1/read"
|
||||||
healthPath = "/-/healthy"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// StreamCallback is a callback function for processing time series
|
// StreamCallback is a callback function for processing time series
|
||||||
|
@ -154,23 +153,6 @@ func (c *Client) do(req *http.Request) (*http.Response, error) {
|
||||||
return c.c.Do(req)
|
return c.c.Do(req)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ping checks the health of the read source
|
|
||||||
func (c *Client) Ping() error {
|
|
||||||
url := c.addr + healthPath
|
|
||||||
req, err := http.NewRequest(http.MethodGet, url, nil)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("cannot create request to %q: %s", url, err)
|
|
||||||
}
|
|
||||||
resp, err := c.do(req)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if resp.StatusCode != http.StatusOK {
|
|
||||||
return fmt.Errorf("bad status code: %d", resp.StatusCode)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *Client) fetch(ctx context.Context, data []byte, streamCb StreamCallback) error {
|
func (c *Client) fetch(ctx context.Context, data []byte, streamCb StreamCallback) error {
|
||||||
r := bytes.NewReader(data)
|
r := bytes.NewReader(data)
|
||||||
url := c.addr + remoteReadPath
|
url := c.addr + remoteReadPath
|
||||||
|
|
Loading…
Reference in a new issue