Reputation: 1861
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
Upvotes: 3
Views: 6765
Reputation: 5882
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:
Upvotes: 7