Renamed FetchStats() into Stats()
This commit is contained in:
parent
57ab71837a
commit
92081c6d25
3
goes.go
3
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",
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user