Skip to content

Commit

Permalink
renaming MetricCountPair to stat
Browse files Browse the repository at this point in the history
Signed-off-by: Hima Varsha <varshahima1994@gmail.com>
  • Loading branch information
HimaVarsha94 committed Jun 23, 2020
1 parent 97fe9c2 commit 55646ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions api/prometheus/v1/api.go
Expand Up @@ -407,16 +407,16 @@ type queryResult struct {
v model.Value
}

// TSDBResult contains the result from querying the tsdb endpoint
// 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"`
SeriesCountByMetricName []Stat `json:"seriesCountByMetricName"`
LabelValueCountByLabelName []Stat `json:"labelValueCountByLabelName"`
MemoryInBytesByLabelName []Stat `json:"memoryInBytesByLabelName"`
SeriesCountByLabelValuePair []Stat `json:"seriesCountByLabelValuePair"`
}

// MetricCountPair models information about metric name and count
type MetricCountPair struct {
// Stat models information about statistic value.
type Stat struct {
Name string `json:"name"`
Value uint64 `json:"value"`
}
Expand Down
8 changes: 4 additions & 4 deletions api/prometheus/v1/api_test.go
Expand Up @@ -1000,25 +1000,25 @@ func TestAPIs(t *testing.T) {
},
},
res: TSDBResult{
SeriesCountByMetricName: []MetricCountPair{
SeriesCountByMetricName: []Stat{
{
Name: "kubelet_http_requests_duration_seconds_bucket",
Value: 1000,
},
},
LabelValueCountByLabelName: []MetricCountPair{
LabelValueCountByLabelName: []Stat{
{
Name: "__name__",
Value: 200,
},
},
MemoryInBytesByLabelName: []MetricCountPair{
MemoryInBytesByLabelName: []Stat{
{
Name: "id",
Value: 4096,
},
},
SeriesCountByLabelValuePair: []MetricCountPair{
SeriesCountByLabelValuePair: []Stat{
{
Name: "job=kubelet",
Value: 30000,
Expand Down

0 comments on commit 55646ef

Please sign in to comment.