# Visualize how much time (24h) processes took on the server

**URL:** <https://discuss.elastic.co/t/visualize-how-much-time-24h-processes-took-on-the-server/276728>\
**Category:** Kibana\
**Created:** [June 23, 2021, 6:45am UTC](https://discuss.elastic.co/t/visualize-how-much-time-24h-processes-took-on-the-server/276728 "2021-06-23T06:45:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwoxer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kwoxer/32/74809_2.png) [@kwoxer](https://discuss.elastic.co/u/kwoxer)\
**Post date:** [June 23, 2021, 6:45am UTC](https://discuss.elastic.co/t/visualize-how-much-time-24h-processes-took-on-the-server/276728/1 "2021-06-23T06:45:41Z")

</div>

I would like to have a diagram like this

 ![grafik](https://us1.discourse-cdn.com/elastic/original/3X/6/3/63e76ef38a4e628c2db0f8f75977cd2404ac232f.png)

But I was only able to get this one

 ![grafik](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1a69affd11a4c5ab2b14bc1d04f314738e788116.png)

This is the defined fields:

 ![grafik](https://us1.discourse-cdn.com/elastic/original/3X/3/6/36e73224052c2afcbc4e39b996cc9c213201b4b4.png)

So my question are:

- how can I show hours instead of the second?
- how to have bars that show the second but on hover it shows the Success/Error/...?

So the main aim is to see how much time our processes took on the server. And as there can only be one process at the same time it cannot be more then 24 hours.

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [June 23, 2021, 7:40am UTC](https://discuss.elastic.co/t/visualize-how-much-time-24h-processes-took-on-the-server/276728/2 "2021-06-23T07:40:08Z")

</div>

Just to make sure I correctly understand what you are trying to do - the tooltip on hover should show a different breakdown than the bars of the chart, correct (bars should show number of runs by result, hover tooltip should show seconds per process)?

If yes, this is not possible to achieve with a single chart today - it's not possible to show different data in the tooltip, it's always bound to what's visible in the chart. What about two separate charts (one for the result breakdown, one for the seconds per process) next to each other on a dashboard? This seems like an easier way to digest the same information.

---

<div class="post-metadata">

**Author:** ![kwoxer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kwoxer/32/74809_2.png) [@kwoxer](https://discuss.elastic.co/u/kwoxer)\
**Post date:** [June 23, 2021, 7:52am UTC](https://discuss.elastic.co/t/visualize-how-much-time-24h-processes-took-on-the-server/276728/3 "2021-06-23T07:52:28Z")

</div>

Well the hover info is nice to have. So yes this could be also in another chart.

But the issue with the seconds is more heavy. How to get it a hours in the chart?

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [June 23, 2021, 11:37am UTC](https://discuss.elastic.co/t/visualize-how-much-time-24h-processes-took-on-the-server/276728/4 "2021-06-23T11:37:36Z")

</div>

Ah, missed that, sorry.

This sounds like a good use case for a runtime field: [Manage index pattern data fields | Kibana Guide [7.13] | Elastic](https://www.elastic.co/guide/en/kibana/7.13/managing-index-patterns.html)

In your case a runtime field `hours` would be calculated by dividing the value of the field `seconds` by 3600 - then you can build the chart using `hours`.

---

<div class="post-metadata">

**Author:** ![kwoxer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kwoxer/32/74809_2.png) [@kwoxer](https://discuss.elastic.co/u/kwoxer)\
**Post date:** [June 23, 2021, 1:45pm UTC](https://discuss.elastic.co/t/visualize-how-much-time-24h-processes-took-on-the-server/276728/5 "2021-06-23T13:45:32Z")

</div>

Did not work for me to also show 4 comma values. So I now create minutes and hours on filebeat side directly and works. But thank you.

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [June 23, 2021, 5:24pm UTC](https://discuss.elastic.co/t/visualize-how-much-time-24h-processes-took-on-the-server/276728/6 "2021-06-23T17:24:29Z")

</div>

Glad it worked out. If someone stumbles over this later - the most likely issue is an integer field value. To return a decimal value for the runtime field, the it has to be casted before the division:

```auto
emit((double)doc['myField'].value / 3600)

```

---

<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:** [July 21, 2021, 5:25pm UTC](https://discuss.elastic.co/t/visualize-how-much-time-24h-processes-took-on-the-server/276728/7 "2021-07-21T17:25:03Z")

</div>

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