File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,6 @@ func TestMain(m *testing.M) {
4848 os .Exit (m .Run ())
4949}
5050
51- var stats struct {
52- GeoIPStats `json:"stats"`
53- }
54-
55- type GeoIPStats struct {
56- DatabasesCount int `json:"databases_count"`
57- }
58-
5951const requestBody = `{"metadata": { "service": {"name": "alice", "agent": {"version": "3.14.0", "name": "elastic-node"}}}}
6052{"metricset": {"samples":{"a":{"value":3.2}}, "timestamp": 1496170422281000}}`
6153
@@ -113,10 +105,15 @@ func waitGeoIPDownload() error {
113105 if err != nil {
114106 return err
115107 }
108+ var stats = struct {
109+ Stats struct {
110+ DatabasesCount int `json:"databases_count"`
111+ } `json:"stats"`
112+ }{}
116113 if err := json .Unmarshal (body , & stats ); err != nil {
117114 return err
118115 }
119- if stats .DatabasesCount == 3 {
116+ if stats .Stats . DatabasesCount == 3 {
120117 log .Println ("GeoIP database downloaded" )
121118 return nil
122119 }
You can’t perform that action at this time.
0 commit comments