Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ElasticSearch: Find the indexing rate of an index

I am interested in knowing how many documents are being indexed (created/updated) within a particular index. I looked at the _stats api but could not make much sense out of it. Can anyone please tell me how to figure out the indexing rate. It can be per second/minute. Thanks

like image 896
Fizi Avatar asked Dec 04 '25 23:12

Fizi


1 Answers

Elasticsearch does not provide this data directly, but you are right about the API.

On the _stat API you will have to look at the total of index operation (since the server started) and store the time of when you call it:

GET _stats?filter_path=indices.index_name_here.total.indexing.index_total

{
  "indices": {
    "index_name_here": {
      "total": {
        "indexing": {
          "index_total": 555
        }
      }
    }
  }
}

Some times later, you will need to make a second call, to the same API:

{
  "indices": {
    "index_name_here": {
      "total": {
        "indexing": {
          "index_total": 666
        }
      }
    }
  }
}

And with a bit of calculation, you will have your indexing rate:

  • first call at 12:00:00 => 555
  • second call at 12:01:00 => 666
  • Indexing rate is 111 document per minute.
like image 140
Damien Avatar answered Dec 06 '25 15:12

Damien



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!