diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f7865a6..27f8eefc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * [CHANGE] * [FEATURE] * [ENHANCEMENT] Include TCP OutRsts in netstat metrics +* [ENHANCEMENT] Added XFS inode operations to XFS metrics * [BUGFIX] ## 1.0.1 / 2020-06-15 diff --git a/collector/fixtures/e2e-64k-page-output.txt b/collector/fixtures/e2e-64k-page-output.txt index c2f1e499..8ad3d96d 100644 --- a/collector/fixtures/e2e-64k-page-output.txt +++ b/collector/fixtures/e2e-64k-page-output.txt @@ -2806,6 +2806,28 @@ node_xfs_extent_allocation_extents_allocated_total{device="sda1"} 1 # HELP node_xfs_extent_allocation_extents_freed_total Number of extents freed for a filesystem. # TYPE node_xfs_extent_allocation_extents_freed_total counter node_xfs_extent_allocation_extents_freed_total{device="sda1"} 0 +# HELP node_xfs_inode_operation_attempts_total Number of times the OS looked for an XFS inode in the inode cache. +# TYPE node_xfs_inode_operation_attempts_total counter +node_xfs_inode_operation_attempts_total{device="sda1"} 5 +# HELP node_xfs_inode_operation_attribute_changes_total Number of times the OS explicitly changed the attributes of an XFS inode. +# TYPE node_xfs_inode_operation_attribute_changes_total counter +node_xfs_inode_operation_attribute_changes_total{device="sda1"} 1 +# 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. +# TYPE node_xfs_inode_operation_duplicates_total counter +node_xfs_inode_operation_duplicates_total{device="sda1"} 0 +# HELP node_xfs_inode_operation_found_total Number of times the OS looked for and found an XFS inode in the inode cache. +# TYPE node_xfs_inode_operation_found_total counter +node_xfs_inode_operation_found_total{device="sda1"} 1 +# 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. +# TYPE node_xfs_inode_operation_missed_total counter +node_xfs_inode_operation_missed_total{device="sda1"} 4 +# 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. +# TYPE node_xfs_inode_operation_reclaims_total counter +node_xfs_inode_operation_reclaims_total{device="sda1"} 0 +# 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. +# TYPE node_xfs_inode_operation_recycled_total counter +node_xfs_inode_operation_recycled_total{device="sda1"} 0 +# HELP node_xfs_read_calls_total Number of read(2) system calls made to files in a filesystem. # HELP node_xfs_read_calls_total Number of read(2) system calls made to files in a filesystem. # TYPE node_xfs_read_calls_total counter node_xfs_read_calls_total{device="sda1"} 28 diff --git a/collector/fixtures/e2e-output.txt b/collector/fixtures/e2e-output.txt index fd38c034..b2ec9118 100644 --- a/collector/fixtures/e2e-output.txt +++ b/collector/fixtures/e2e-output.txt @@ -2941,6 +2941,27 @@ node_xfs_extent_allocation_extents_allocated_total{device="sda1"} 1 # HELP node_xfs_extent_allocation_extents_freed_total Number of extents freed for a filesystem. # TYPE node_xfs_extent_allocation_extents_freed_total counter node_xfs_extent_allocation_extents_freed_total{device="sda1"} 0 +# HELP node_xfs_inode_operation_attempts_total Number of times the OS looked for an XFS inode in the inode cache. +# TYPE node_xfs_inode_operation_attempts_total counter +node_xfs_inode_operation_attempts_total{device="sda1"} 5 +# HELP node_xfs_inode_operation_attribute_changes_total Number of times the OS explicitly changed the attributes of an XFS inode. +# TYPE node_xfs_inode_operation_attribute_changes_total counter +node_xfs_inode_operation_attribute_changes_total{device="sda1"} 1 +# 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. +# TYPE node_xfs_inode_operation_duplicates_total counter +node_xfs_inode_operation_duplicates_total{device="sda1"} 0 +# HELP node_xfs_inode_operation_found_total Number of times the OS looked for and found an XFS inode in the inode cache. +# TYPE node_xfs_inode_operation_found_total counter +node_xfs_inode_operation_found_total{device="sda1"} 1 +# 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. +# TYPE node_xfs_inode_operation_missed_total counter +node_xfs_inode_operation_missed_total{device="sda1"} 4 +# 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. +# TYPE node_xfs_inode_operation_reclaims_total counter +node_xfs_inode_operation_reclaims_total{device="sda1"} 0 +# 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. +# TYPE node_xfs_inode_operation_recycled_total counter +node_xfs_inode_operation_recycled_total{device="sda1"} 0 # HELP node_xfs_read_calls_total Number of read(2) system calls made to files in a filesystem. # TYPE node_xfs_read_calls_total counter node_xfs_read_calls_total{device="sda1"} 28 diff --git a/collector/xfs_linux.go b/collector/xfs_linux.go index 36dfff50..1952ea82 100644 --- a/collector/xfs_linux.go +++ b/collector/xfs_linux.go @@ -199,6 +199,41 @@ func (c *xfsCollector) updateXFSStats(ch chan<- prometheus.Metric, s *xfs.Stats) desc: "Number of times the directory getdents operation was performed for a filesystem.", value: float64(s.DirectoryOperation.Getdents), }, + { + name: "inode_operation_attempts_total", + desc: "Number of times the OS looked for an XFS inode in the inode cache.", + value: float64(s.InodeOperation.Attempts), + }, + { + name: "inode_operation_found_total", + desc: "Number of times the OS looked for and found an XFS inode in the inode cache.", + value: float64(s.InodeOperation.Found), + }, + { + name: "inode_operation_recycled_total", + desc: "Number of times the OS found an XFS inode in the cache, but could not use it as it was being recycled.", + value: float64(s.InodeOperation.Recycle), + }, + { + name: "inode_operation_missed_total", + desc: "Number of times the OS looked for an XFS inode in the cache, but did not find it.", + value: float64(s.InodeOperation.Missed), + }, + { + name: "inode_operation_duplicates_total", + 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.", + value: float64(s.InodeOperation.Duplicate), + }, + { + name: "inode_operation_reclaims_total", + desc: "Number of times the OS reclaimed an XFS inode from the inode cache to free memory for another purpose.", + value: float64(s.InodeOperation.Reclaims), + }, + { + name: "inode_operation_attribute_changes_total", + desc: "Number of times the OS explicitly changed the attributes of an XFS inode.", + value: float64(s.InodeOperation.AttributeChange), + }, { name: "read_calls_total", desc: "Number of read(2) system calls made to files in a filesystem.",