Skip to content

Commit

Permalink
apply PR ClickHouse#40
Browse files Browse the repository at this point in the history
  • Loading branch information
sauliusvl committed Oct 14, 2019
1 parent fc3a556 commit 5d85dd8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewExporter(uri url.URL, insecure bool, user, password string) *Exporter {
partsURI := uri
q.Set("query", "select database, table, sum(bytes) as bytes, count() as parts, sum(rows) as rows from system.parts where active = 1 group by database, table")
partsURI.RawQuery = q.Encode()

return &Exporter{
metricsURI: metricsURI.String(),
asyncMetricsURI: asyncMetricsURI.String(),
Expand Down Expand Up @@ -197,7 +197,7 @@ func (e *Exporter) handleResponse(uri string) ([]byte, error) {
}
return nil, fmt.Errorf("Status %s (%d): %s", resp.Status, resp.StatusCode, data)
}

return data, nil
}

Expand All @@ -221,7 +221,7 @@ func (e *Exporter) parseKeyValueResponse(uri string) ([]lineResult, error) {
if len(parts) == 0 {
continue
}
if len(parts) != 2 {
if len(parts) < 2 {
return nil, fmt.Errorf("parseKeyValueResponse: unexpected %d line: %s", i, line)
}
k := strings.TrimSpace(parts[0])
Expand Down

0 comments on commit 5d85dd8

Please sign in to comment.