From 92081c6d25dbbe271f38017049fa27110d8eecc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Je=CC=81ro=CC=82me=20Renard?= Date: Tue, 18 Jun 2013 06:54:31 +0200 Subject: [PATCH] Renamed FetchStats() into Stats() --- goes.go | 3 ++- goes_test.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/goes.go b/goes.go index 3c75cdb..79fbc89 100644 --- a/goes.go +++ b/goes.go @@ -68,7 +68,8 @@ func (c *Connection) RefreshIndex(name string) (Response, error) { return r.Run() } -func (c *Connection) FetchStats() (Response, error) { +// Stats fetches statistics (_stats) for the current elasticsearch server +func (c *Connection) Stats() (Response, error) { r := Request{ Conn: c, method: "GET", diff --git a/goes_test.go b/goes_test.go index ee80df6..6f47e6f 100644 --- a/goes_test.go +++ b/goes_test.go @@ -290,7 +290,7 @@ func (s *GoesTestSuite) TestBulkSend(c *C) { c.Assert(err, IsNil) } -func (s *GoesTestSuite) TestFetchStats(c *C) { +func (s *GoesTestSuite) TestStats(c *C) { conn := NewConnection(ES_HOST, ES_PORT) indexName := "testfetchstats" @@ -300,7 +300,7 @@ func (s *GoesTestSuite) TestFetchStats(c *C) { // we must wait for a bit otherwise ES crashes time.Sleep(1 * time.Second) - response, err := conn.FetchStats() + response, err := conn.Stats() c.Assert(err, IsNil) c.Assert(response.All.Indices[indexName].Primaries["docs"].Count, Equals, 0)