Skip to content

Commit

Permalink
Fix JSON structure for cluster stats
Browse files Browse the repository at this point in the history
  • Loading branch information
olivere committed Feb 27, 2016
1 parent 515f705 commit 948f07c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Junpei Tsuji [@jun06t](https://github.com/jun06t)
Maciej Lisiewski [@c2h5oh](https://github.com/c2h5oh)
Mara Kim [@autochthe](https://github.com/autochthe)
Medhi Bechina [@mdzor](https://github.com/mdzor)
Naoya Tsutsumi [@tutuming](https://github.com/tutuming)
Nicholas Wolff [@nwolff](https://github.com/nwolff)
Orne Brocaar [@brocaar](https://github.com/brocaar)
Ryan Schmukler [@rschmukler](https://github.com/rschmukler)
Expand Down
4 changes: 2 additions & 2 deletions cluster_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ type ClusterStatsIndicesPercolate struct {
// ---

type ClusterStatsNodes struct {
Count *ClusterStatsNodesCounts `json:"counts"`
Count *ClusterStatsNodesCount `json:"count"`
Versions []string `json:"versions"`
OS *ClusterStatsNodesOsStats `json:"os"`
Process *ClusterStatsNodesProcessStats `json:"process"`
Expand All @@ -247,7 +247,7 @@ type ClusterStatsNodes struct {
Plugins []*ClusterStatsNodesPlugin `json:"plugins"`
}

type ClusterStatsNodesCounts struct {
type ClusterStatsNodesCount struct {
Total int `json:"total"`
MasterOnly int `json:"master_only"`
DataOnly int `json:"data_only"`
Expand Down
6 changes: 6 additions & 0 deletions cluster_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ func TestClusterStats(t *testing.T) {
if res.ClusterName == "" {
t.Fatalf("expected a cluster name; got: %q", res.ClusterName)
}
if res.Nodes == nil {
t.Fatalf("expected nodes; got: %v", res.Nodes)
}
if res.Nodes.Count == nil {
t.Fatalf("expected nodes count; got: %v", res.Nodes.Count)
}
}

func TestClusterStatsURLs(t *testing.T) {
Expand Down

0 comments on commit 948f07c

Please sign in to comment.