# How to measure an 'Empty' operation

**URL:** <https://discuss.elastic.co/t/how-to-measure-an-empty-operation/195122>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [August 14, 2019, 1:02am UTC](https://discuss.elastic.co/t/how-to-measure-an-empty-operation/195122 "2019-08-14T01:02:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Samokovlisky](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_samokovlisky/32/44993_2.png) [@David\_Samokovlisky](https://discuss.elastic.co/u/David_Samokovlisky)\
**Post date:** [August 14, 2019, 1:02am UTC](https://discuss.elastic.co/t/how-to-measure-an-empty-operation/195122/1 "2019-08-14T01:02:44Z")

</div>

Hi

Because esrally doesn't support upsert's I want to try a different approach, as to use esrally only for measurements, and do the operation externally.

My question is, is there a way to make an empty operation, that will take X amount of time and this way I can try bench upsert's?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 14, 2019, 7:18am UTC](https://discuss.elastic.co/t/how-to-measure-an-empty-operation/195122/2 "2019-08-14T07:18:50Z")

</div>

I do not see why Rally would not support upsets. You should be able to do that by creating a custom parameter source to generate the request though.

---

<div class="post-metadata">

**Author:** ![David\_Samokovlisky](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_samokovlisky/32/44993_2.png) [@David\_Samokovlisky](https://discuss.elastic.co/u/David_Samokovlisky)\
**Post date:** [August 14, 2019, 7:35am UTC](https://discuss.elastic.co/t/how-to-measure-an-empty-operation/195122/3 "2019-08-14T07:35:23Z")

</div>

By that you mean, instead of using the dump as a source for bulk operation, I should use custom source for example :  
{ "update" : {"\_id" : "2", "\_type" : "type1", "\_index" : "index1", "\_retry\_on\_conflict" : 3} }  
{ "doc" : {"field" : "value"}, "doc\_as\_upsert" : true }

Is this possible? And how? If you have an example?

Thank you!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 14, 2019, 8:05am UTC](https://discuss.elastic.co/t/how-to-measure-an-empty-operation/195122/4 "2019-08-14T08:05:50Z")

</div>

You would need to create a [custom parameter source](https://esrally.readthedocs.io/en/1.2.1/adding_tracks.html#custom-parameter-sources) in Python and then use this in your track. The [rally-eventdata-track](https://github.com/elastic/rally-eventdata-track) uses this method to generate custom bulk requests and [simulate a set of Kibana dashboards](https://github.com/elastic/rally-eventdata-track/blob/master/eventdata/parameter_sources/elasticlogs_kibana_source.py). This is discussed in [this webinar](https://www.elastic.co/webinars/using-rally-to-get-your-elasticsearch-cluster-size-right).

---

<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:** [August 14, 2019, 8:06am UTC](https://discuss.elastic.co/t/how-to-measure-an-empty-operation/195122/5 "2019-08-14T08:06:41Z")

</div>

Also please check the documentation for [custom parameter sources](https://esrally.readthedocs.io/en/stable/adding_tracks.html?highlight=custom%20parameter%20sources#custom-parameter-sources).

There is a similar (older) discussion containing more guidance regarding the use of a custom parameter source for updates in [this topic](https://discuss.elastic.co/t/does-rally-support-benchmarking-partial-updates-doc-as-upsert/101081/2).

---

<div class="post-metadata">

**Author:** ![David\_Samokovlisky](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_samokovlisky/32/44993_2.png) [@David\_Samokovlisky](https://discuss.elastic.co/u/David_Samokovlisky)\
**Post date:** [August 14, 2019, 4:10pm UTC](https://discuss.elastic.co/t/how-to-measure-an-empty-operation/195122/6 "2019-08-14T16:10:50Z")

</div>

Ok, so for my use case, I should write a custom parameter source, that will just read from the file the ES qurys, for example sets of

{ "update" : {"\_id" : "2", "\_type" : "type1", "\_index" : "index1", "\_retry\_on\_conflict" : 3} }  
{ "doc" : {"field" : "value"}, "doc\_as\_upsert" : true }

And then to just bind it to a bulk operation?  
Also why would I have issues with clients? If each one of them reads a chunk from it?

---

<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:** [September 11, 2019, 4:10pm UTC](https://discuss.elastic.co/t/how-to-measure-an-empty-operation/195122/7 "2019-09-11T16:10:53Z")

</div>

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