# Understanding Metrics ( Cumulative indexing time of primary shards )

**URL:** <https://discuss.elastic.co/t/understanding-metrics-cumulative-indexing-time-of-primary-shards/324986>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [February 8, 2023, 8:50am UTC](https://discuss.elastic.co/t/understanding-metrics-cumulative-indexing-time-of-primary-shards/324986 "2023-02-08T08:50:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dliappis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dliappis/32/56174_2.png) [@dliappis](https://discuss.elastic.co/u/dliappis)\
**Post date:** [February 8, 2023, 1:30pm UTC](https://discuss.elastic.co/t/understanding-metrics-cumulative-indexing-time-of-primary-shards/324986/2 "2023-02-08T13:30:14Z")

</div>

These stats use Elasticsearch's [index stats API](https://esrally.readthedocs.io/en/stable/summary_report.html?highlight=cummulative%20indexing#cumulative-indexing-time-of-primary-shards). Specifically, they use [\_stats/\_all?level=shards](https://github.com/elastic/rally/blob/5ef4d697f4996506351517e7c1a89919dd741124/esrally/telemetry.py#L1986) and from there the [`index_time_in_millis`](https://github.com/elastic/rally/blob/5ef4d697f4996506351517e7c1a89919dd741124/esrally/telemetry.py#L1995) stat.

For the sake of an example, I ran the geonames `append-no-conflicts-index-only` benchmark against a single ES 8.6.1 node; this generates one `geonames` index with 5 pri / 0 replica by default.

After the end of the benchmark I checked the stats API:

```json
curl ... https://.../geonames/_stats/_all?pretty\&human\&level=shards | jq ._all.primaries.indexing
{
  "index_total": 11396503,
  "index_time": "12.8m",
  "index_time_in_millis": 773155,
...
}

```

whereas rally reported

`| Cumulative indexing time of primary shards | | 12.8859 | min |`

which matches what stats reported above (see `index_time`)

---

_[View the full topic](https://discuss.elastic.co/t/understanding-metrics-cumulative-indexing-time-of-primary-shards/324986)._
