# Some questions on system.diskio latency metrics

**URL:** <https://discuss.elastic.co/t/some-questions-on-system-diskio-latency-metrics/326817>\
**Category:** Metrics\
**Created:** [March 2, 2023, 3:19am UTC](https://discuss.elastic.co/t/some-questions-on-system-diskio-latency-metrics/326817 "2023-03-02T03:19:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CatLoveFishma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/catlovefishma/32/113704_2.png) [@CatLoveFishma](https://discuss.elastic.co/u/CatLoveFishma)\
**Post date:** [March 2, 2023, 3:19am UTC](https://discuss.elastic.co/t/some-questions-on-system-diskio-latency-metrics/326817/1 "2023-03-02T03:19:24Z")

</div>

Hello, I am trying to get a better understanding of the disk io metrics below.  
Included are the definitions for each per the Elastic documentation online.

system.diskio.read.time - total number of milliseconds spent by all reads  
system.diskio.write.time - total number of milliseconds spent by all writes  
system.diskio.write.time - The total number of of milliseconds spent doing I/Os.  
system.diskio.read.bytes - The total number of bytes read successfully  
system.diskio.write.bytes - The total number of bytes write successfully  
system.diskio.read.count - The total number of reads completed successfully.  
system.diskio.write.count - The total number of writes completed successfully.

Q1: In the definitions of system.diskio.read/write.time, the total number of milliseconds spent by all reads/writes.I found that the total time is very large, far greater than the sampling period I set. SO, what time does this total time consist of？  
Q2：Similar to Q1，what bytes does this total bytes consist of？  
Q3: Does system.diskio.write.read/count record all read/write operations in the event.duration time？

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [March 2, 2023, 5:02am UTC](https://discuss.elastic.co/t/some-questions-on-system-diskio-latency-metrics/326817/2 "2023-03-02T05:02:01Z")

</div>

These metrics are counters. This is how they recorded on OSs

That means they a monotonically increasing numbers.

Counter  
A counter is a cumulative metric that represents a single monotonically increasing counter whose value can only increase or be reset to zero on restart. For example, you can use a counter to represent the number of requests served, tasks completed, or errors.

So to calculate the write time per bucket / time range

write.time(1) - write.time(0)

That is the total ms spent on writes during that time span.

Look closely you probably will want to look at them by

`system.filesystem.device_name`

And to calculate the like read/write MB/s

So to visualize them in Lens use the function counter rate.

So to calculate a rate it is a derivative....

(write.bytes(1) - write.bytes(0))/time bucket span

Look closely you probably will want to look at them by

`system.filesystem.device_name`  
Can also look at the OOTB dashboard and visualizations to see..

---

<div class="post-metadata">

**Author:** ![CatLoveFishma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/catlovefishma/32/113704_2.png) [@CatLoveFishma](https://discuss.elastic.co/u/CatLoveFishma)\
**Post date:** [March 2, 2023, 6:47am UTC](https://discuss.elastic.co/t/some-questions-on-system-diskio-latency-metrics/326817/3 "2023-03-02T06:47:56Z")

</div>

Thank you. But I still have a question. Displayed in the metricbeat document, **disk contains disk IO metrics collected from the operating system.** So,does Linux have commands that can obtain similar data？

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [March 2, 2023, 7:00am UTC](https://discuss.elastic.co/t/some-questions-on-system-diskio-latency-metrics/326817/4 "2023-03-02T07:00:31Z")

</div>

Well that is a bit outside elasticsearch topics....

You can look it up on Google

> **[How to Monitor Disk IO in a Linux System | Baeldung on Linux](https://www.baeldung.com/linux/monitor-disk-io)**
>
> In this tutorial, we'll discuss how to monitor disk I/O activity in the Linux system.

> <https://unix.stackexchange.com/questions/55212/how-can-i-monitor-disk-io>

You can also look at the metricbeat code if you like

---

<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:** [March 30, 2023, 7:00am UTC](https://discuss.elastic.co/t/some-questions-on-system-diskio-latency-metrics/326817/5 "2023-03-30T07:00:59Z")

</div>

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