# How to Retrieve Documents Indexed Per Second, Python API

**URL:** <https://discuss.elastic.co/t/how-to-retrieve-documents-indexed-per-second-python-api/105934>\
**Category:** Elasticsearch\
**Created:** [October 31, 2017, 5:28pm UTC](https://discuss.elastic.co/t/how-to-retrieve-documents-indexed-per-second-python-api/105934 "2017-10-31T17:28:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andyiscoding](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@andyiscoding](https://discuss.elastic.co/u/andyiscoding)\
**Post date:** [October 31, 2017, 5:28pm UTC](https://discuss.elastic.co/t/how-to-retrieve-documents-indexed-per-second-python-api/105934/1 "2017-10-31T17:28:51Z")

</div>

I am attempting to retrieve data for how many documents are being ingested into the cluster per second. I am currently using the elasticsearch python API 5.4 on elasticsearch and kibana docker images: [docker.elastic.co/elasticsearch/elasticsearch:5.4.0](http://docker.elastic.co/elasticsearch/elasticsearch:5.4.0) and [docker.elastic.co/kibana/kibana:5.4.0](http://docker.elastic.co/kibana/kibana:5.4.0). I am expecting to retrieve documents per second from the indicies API. However I have had no luck in pulling from the cluster or cat API's. indexing.index\_current is always 0, no matter how many documents are being indexed.

```
elasticsearch_client = Elasticsearch(host=config['es.hostname'], port=config['es.port'])
resp = elasticsearch_client.indices.stats(index="data-20171021", format="json")
total_docs = resp['indices']['data-20171021']['primaries']['indexing']['index_current']
logging.info("Total Docs {0}".format(total_docs))

{  
   'indices':{  
      'data-20171021':{  
         'primaries':{  
            'flush':{  
               'total_time_in_millis':0,
               'total':0
            },
            'refresh':{  
               'listeners':0,
               'total_time_in_millis':209,
               'total':15
            },
            'indexing':{  
               'throttle_time_in_millis':0,
               'delete_total':0,
               'index_time_in_millis':1395,
               'index_failed':0,
               'index_current':0,
               'delete_time_in_millis':0,
               'index_total':426,
               'noop_update_total':0,
               'is_throttled':False,
               'delete_current':0
            },...
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 28, 2017, 5:29pm UTC](https://discuss.elastic.co/t/how-to-retrieve-documents-indexed-per-second-python-api/105934/2 "2017-11-28T17:29:22Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
