Skip to content

Commit ed10485

Browse files
obaudysobaudys@gmail.com
andauthored
Expose XFS inode statistics (#1869) (#1870)
* Expose XFS inode statistics (#1869) Also fixes #1177 @SuperQ @discordianfish Signed-off-by: Ondrej Baudys <obaudys@gmail.com> Co-authored-by: obaudys@gmail.com <ondrej.baudys@nextgen.net>
1 parent dbf8c70 commit ed10485

4 files changed

Lines changed: 79 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* [CHANGE]
55
* [FEATURE]
66
* [ENHANCEMENT] Include TCP OutRsts in netstat metrics
7+
* [ENHANCEMENT] Added XFS inode operations to XFS metrics
78
* [BUGFIX]
89

910
## 1.0.1 / 2020-06-15

collector/fixtures/e2e-64k-page-output.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2806,6 +2806,28 @@ node_xfs_extent_allocation_extents_allocated_total{device="sda1"} 1
28062806
# HELP node_xfs_extent_allocation_extents_freed_total Number of extents freed for a filesystem.
28072807
# TYPE node_xfs_extent_allocation_extents_freed_total counter
28082808
node_xfs_extent_allocation_extents_freed_total{device="sda1"} 0
2809+
# HELP node_xfs_inode_operation_attempts_total Number of times the OS looked for an XFS inode in the inode cache.
2810+
# TYPE node_xfs_inode_operation_attempts_total counter
2811+
node_xfs_inode_operation_attempts_total{device="sda1"} 5
2812+
# HELP node_xfs_inode_operation_attribute_changes_total Number of times the OS explicitly changed the attributes of an XFS inode.
2813+
# TYPE node_xfs_inode_operation_attribute_changes_total counter
2814+
node_xfs_inode_operation_attribute_changes_total{device="sda1"} 1
2815+
# HELP node_xfs_inode_operation_duplicates_total Number of times the OS tried to add a missing XFS inode to the inode cache, but found it had already been added by another process.
2816+
# TYPE node_xfs_inode_operation_duplicates_total counter
2817+
node_xfs_inode_operation_duplicates_total{device="sda1"} 0
2818+
# HELP node_xfs_inode_operation_found_total Number of times the OS looked for and found an XFS inode in the inode cache.
2819+
# TYPE node_xfs_inode_operation_found_total counter
2820+
node_xfs_inode_operation_found_total{device="sda1"} 1
2821+
# HELP node_xfs_inode_operation_missed_total Number of times the OS looked for an XFS inode in the cache, but did not find it.
2822+
# TYPE node_xfs_inode_operation_missed_total counter
2823+
node_xfs_inode_operation_missed_total{device="sda1"} 4
2824+
# HELP node_xfs_inode_operation_reclaims_total Number of times the OS reclaimed an XFS inode from the inode cache to free memory for another purpose.
2825+
# TYPE node_xfs_inode_operation_reclaims_total counter
2826+
node_xfs_inode_operation_reclaims_total{device="sda1"} 0
2827+
# HELP node_xfs_inode_operation_recycled_total Number of times the OS found an XFS inode in the cache, but could not use it as it was being recycled.
2828+
# TYPE node_xfs_inode_operation_recycled_total counter
2829+
node_xfs_inode_operation_recycled_total{device="sda1"} 0
2830+
# HELP node_xfs_read_calls_total Number of read(2) system calls made to files in a filesystem.
28092831
# HELP node_xfs_read_calls_total Number of read(2) system calls made to files in a filesystem.
28102832
# TYPE node_xfs_read_calls_total counter
28112833
node_xfs_read_calls_total{device="sda1"} 28

collector/fixtures/e2e-output.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2941,6 +2941,27 @@ node_xfs_extent_allocation_extents_allocated_total{device="sda1"} 1
29412941
# HELP node_xfs_extent_allocation_extents_freed_total Number of extents freed for a filesystem.
29422942
# TYPE node_xfs_extent_allocation_extents_freed_total counter
29432943
node_xfs_extent_allocation_extents_freed_total{device="sda1"} 0
2944+
# HELP node_xfs_inode_operation_attempts_total Number of times the OS looked for an XFS inode in the inode cache.
2945+
# TYPE node_xfs_inode_operation_attempts_total counter
2946+
node_xfs_inode_operation_attempts_total{device="sda1"} 5
2947+
# HELP node_xfs_inode_operation_attribute_changes_total Number of times the OS explicitly changed the attributes of an XFS inode.
2948+
# TYPE node_xfs_inode_operation_attribute_changes_total counter
2949+
node_xfs_inode_operation_attribute_changes_total{device="sda1"} 1
2950+
# HELP node_xfs_inode_operation_duplicates_total Number of times the OS tried to add a missing XFS inode to the inode cache, but found it had already been added by another process.
2951+
# TYPE node_xfs_inode_operation_duplicates_total counter
2952+
node_xfs_inode_operation_duplicates_total{device="sda1"} 0
2953+
# HELP node_xfs_inode_operation_found_total Number of times the OS looked for and found an XFS inode in the inode cache.
2954+
# TYPE node_xfs_inode_operation_found_total counter
2955+
node_xfs_inode_operation_found_total{device="sda1"} 1
2956+
# HELP node_xfs_inode_operation_missed_total Number of times the OS looked for an XFS inode in the cache, but did not find it.
2957+
# TYPE node_xfs_inode_operation_missed_total counter
2958+
node_xfs_inode_operation_missed_total{device="sda1"} 4
2959+
# HELP node_xfs_inode_operation_reclaims_total Number of times the OS reclaimed an XFS inode from the inode cache to free memory for another purpose.
2960+
# TYPE node_xfs_inode_operation_reclaims_total counter
2961+
node_xfs_inode_operation_reclaims_total{device="sda1"} 0
2962+
# HELP node_xfs_inode_operation_recycled_total Number of times the OS found an XFS inode in the cache, but could not use it as it was being recycled.
2963+
# TYPE node_xfs_inode_operation_recycled_total counter
2964+
node_xfs_inode_operation_recycled_total{device="sda1"} 0
29442965
# HELP node_xfs_read_calls_total Number of read(2) system calls made to files in a filesystem.
29452966
# TYPE node_xfs_read_calls_total counter
29462967
node_xfs_read_calls_total{device="sda1"} 28

collector/xfs_linux.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,41 @@ func (c *xfsCollector) updateXFSStats(ch chan<- prometheus.Metric, s *xfs.Stats)
199199
desc: "Number of times the directory getdents operation was performed for a filesystem.",
200200
value: float64(s.DirectoryOperation.Getdents),
201201
},
202+
{
203+
name: "inode_operation_attempts_total",
204+
desc: "Number of times the OS looked for an XFS inode in the inode cache.",
205+
value: float64(s.InodeOperation.Attempts),
206+
},
207+
{
208+
name: "inode_operation_found_total",
209+
desc: "Number of times the OS looked for and found an XFS inode in the inode cache.",
210+
value: float64(s.InodeOperation.Found),
211+
},
212+
{
213+
name: "inode_operation_recycled_total",
214+
desc: "Number of times the OS found an XFS inode in the cache, but could not use it as it was being recycled.",
215+
value: float64(s.InodeOperation.Recycle),
216+
},
217+
{
218+
name: "inode_operation_missed_total",
219+
desc: "Number of times the OS looked for an XFS inode in the cache, but did not find it.",
220+
value: float64(s.InodeOperation.Missed),
221+
},
222+
{
223+
name: "inode_operation_duplicates_total",
224+
desc: "Number of times the OS tried to add a missing XFS inode to the inode cache, but found it had already been added by another process.",
225+
value: float64(s.InodeOperation.Duplicate),
226+
},
227+
{
228+
name: "inode_operation_reclaims_total",
229+
desc: "Number of times the OS reclaimed an XFS inode from the inode cache to free memory for another purpose.",
230+
value: float64(s.InodeOperation.Reclaims),
231+
},
232+
{
233+
name: "inode_operation_attribute_changes_total",
234+
desc: "Number of times the OS explicitly changed the attributes of an XFS inode.",
235+
value: float64(s.InodeOperation.AttributeChange),
236+
},
202237
{
203238
name: "read_calls_total",
204239
desc: "Number of read(2) system calls made to files in a filesystem.",

0 commit comments

Comments
 (0)