Renamed FetchStats() into Stats()

This commit is contained in:
Jérôme Renard 2013-06-18 06:54:31 +02:00
parent 57ab71837a
commit 92081c6d25
2 changed files with 4 additions and 3 deletions

View File

@ -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",

View File

@ -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)