Skip to content

Commit

Permalink
formatting bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
HimaVarsha94 committed Jun 22, 2020
1 parent 562896f commit fe03095
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions api/prometheus/v1/api.go
Expand Up @@ -138,7 +138,7 @@ const (
epConfig = apiPrefix + "/status/config"
epFlags = apiPrefix + "/status/flags"
epRuntimeinfo = apiPrefix + "/status/runtimeinfo"
epTSDB = apiPrefix + "/status/tsdb"
epTSDB = apiPrefix + "/status/tsdb"
)

// AlertState models the state of an alert.
Expand Down Expand Up @@ -255,7 +255,7 @@ type API interface {
TargetsMetadata(ctx context.Context, matchTarget string, metric string, limit string) ([]MetricMetadata, error)
// Metadata returns metadata about metrics currently scraped by the metric name.
Metadata(ctx context.Context, metric string, limit string) (map[string][]Metadata, error)
// TSDB returns the cardinality statistics
// TSDB returns the cardinality statistics.
TSDB(ctx context.Context) (TSDBResult, error)
}

Expand Down Expand Up @@ -410,12 +410,12 @@ type queryResult struct {
// TSDBResult contains the result from querying the tsdb endpoint
type TSDBResult struct {
SeriesCountByMetricName []MetricCountPair `json:"seriesCountByMetricName"`
LabelValueCountByLabelName []MetricCountPair `json:"labelValueCountByLabelName"`
MemoryInBytesByLabelName []MetricCountPair `json:"memoryInBytesByLabelName"`
SeriesCountByLabelValuePair []MetricCountPair `json:"seriesCountByLabelValuePair"`
LabelValueCountByLabelName []MetricCountPair `json:"labelValueCountByLabelName"`
MemoryInBytesByLabelName []MetricCountPair `json:"memoryInBytesByLabelName"`
SeriesCountByLabelValuePair []MetricCountPair `json:"seriesCountByLabelValuePair"`
}

// MetricCountPair models information about metric name and count
// MetricCountPair models information about metric name and count
type MetricCountPair struct {
Name string `json:"name"`
Value uint64 `json:"value"`
Expand Down Expand Up @@ -903,20 +903,20 @@ func (h *httpAPI) Metadata(ctx context.Context, metric string, limit string) (ma
func (h *httpAPI) TSDB(ctx context.Context) (TSDBResult, error) {
u := h.client.URL(epTSDB, nil)

req, err := http.NewRequest(http.MethodGet, u.String(), nil)
req, err := http.NewRequest(http.MethodGet, u.String(), nil)
if err != nil {
return TSDBResult{}, err
}

_, body, _, err := h.client.Do(ctx, req)
_, body, _, err := h.client.Do(ctx, req)
if err != nil {
return TSDBResult{}, err
}

var res TSDBResult
return res, json.Unmarshal(body, &res)
var res TSDBResult
return res, json.Unmarshal(body, &res)

}
}

// Warnings is an array of non critical errors
type Warnings []string
Expand Down

0 comments on commit fe03095

Please sign in to comment.