Skip to content

Commit

Permalink
Make metric names comply with Prometheus standards
Browse files Browse the repository at this point in the history
Signed-Off-By: Joe Handzik <joseph.t.handzik@hpe.com>
  • Loading branch information
Joe Handzik committed May 10, 2017
1 parent faceb27 commit 5d14aed
Showing 1 changed file with 98 additions and 98 deletions.
196 changes: 98 additions & 98 deletions sources/procfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,68 +125,68 @@ func newLustreProcMetric(filename string, promName string, source string, path s
func (s *lustreSource) generateOSTMetricTemplates() error {
metricMap := map[string][]lustreHelpStruct{
"obdfilter/*": {
{"blocksize", "blocksize", "Filesystem block size in bytes"},
{"brw_size", "brw_size", "Block read/write size in bytes"},
{"brw_stats", "pages_per_bulk_rw", pagesPerBlockRWHelp},
{"brw_stats", "discontiguous_pages", discontiguousPagesHelp},
{"brw_stats", "disk_ios_in_flight", diskIOsInFlightHelp},
{"brw_stats", "io_time", ioTimeHelp},
{"brw_stats", "disk_io_size", diskIOSizeHelp},
{"degraded", "degraded", "Binary indicator as to whether or not the pool is degraded - 0 for not degraded, 1 for degraded"},
{"filesfree", "filesfree", "The number of inodes (objects) available"},
{"filestotal", "filestotal", "The maximum number of inodes (objects) the filesystem can hold"},
{"grant_compat_disable", "grant_compat_disable", "Binary indicator as to whether clients with OBD_CONNECT_GRANT_PARAM setting will be granted space"},
{"grant_precreate", "grant_precreate", "Maximum space in bytes that clients can preallocate for objects"},
{"job_cleanup_interval", "job_cleanup_interval", "Interval in seconds between cleanup of tuning statistics"},
{"job_stats", "job_read_samples", readSamplesHelp},
{"job_stats", "job_read_minimum", readMinimumHelp},
{"job_stats", "job_read_maximum", readMaximumHelp},
{"job_stats", "job_read_total", readTotalHelp},
{"job_stats", "job_write_samples", writeSamplesHelp},
{"job_stats", "job_write_minimum", writeMinimumHelp},
{"job_stats", "job_write_maximum", writeMaximumHelp},
{"job_stats", "job_write_total", writeTotalHelp},
{"job_stats", "job_num_getattr", getattrHelp},
{"job_stats", "job_num_setattr", setattrHelp},
{"job_stats", "job_num_punch", punchHelp},
{"job_stats", "job_num_sync", syncHelp},
{"job_stats", "job_num_destroy", destroyHelp},
{"job_stats", "job_num_create", createHelp},
{"job_stats", "job_num_statfs", statfsHelp},
{"job_stats", "job_num_get_info", getInfoHelp},
{"job_stats", "job_num_set_info", setInfoHelp},
{"job_stats", "job_num_quotactl", quotactlHelp},
{"kbytesavail", "kbytesavail", "Number of kilobytes readily available in the pool"},
{"kbytesfree", "kbytesfree", "Number of kilobytes allocated to the pool"},
{"kbytestotal", "kbytestotal", "Capacity of the pool in kilobytes"},
{"lfsck_speed_limit", "lfsck_speed_limit", "Maximum operations per second LFSCK (Lustre filesystem verification) can run"},
{"num_exports", "num_exports", "Total number of times the pool has been exported"},
{"precreate_batch", "precreate_batch", "Maximum number of objects that can be included in a single transaction"},
{"recovery_time_hard", "recovery_time_hard", "Maximum timeout 'recover_time_soft' can increment to for a single server"},
{"recovery_time_soft", "recovery_time_soft", "Duration in seconds for a client to attempt to reconnect after a crash (automatically incremented if servers are still in an error state)"},
{"soft_sync_limit", "soft_sync_limit", "Number of RPCs necessary before triggering a sync"},
{"stats", "read_samples_total", readSamplesHelp},
{"stats", "read_minimum_size_bytes", readMinimumHelp},
{"stats", "read_maximum_size_bytes", readMaximumHelp},
{"stats", "read_total_bytes", readTotalHelp},
{"stats", "write_samples_total", writeSamplesHelp},
{"stats", "write_minimum_size_bytes", writeMinimumHelp},
{"stats", "write_maximum_size_bytes", writeMaximumHelp},
{"stats", "write_total_bytes", writeTotalHelp},
{"sync_journal", "sync_journal", "Binary indicator as to whether or not the journal is set for asynchronous commits"},
{"tot_dirty", "tot_dirty", "Total number of exports that have been marked dirty"},
{"tot_granted", "tot_granted", "Total number of exports that have been marked granted"},
{"tot_pending", "tot_pending", "Total number of exports that have been marked pending"},
{"blocksize", "ost_blocksize_bytes", "Filesystem block size in bytes"},
{"brw_size", "ost_brw_size_bytes", "Block read/write size in bytes"},
{"brw_stats", "ost_pages_per_bulk_rw_total", pagesPerBlockRWHelp},
{"brw_stats", "ost_discontiguous_pages_total", discontiguousPagesHelp},
{"brw_stats", "ost_disk_io_now", diskIOsInFlightHelp},
{"brw_stats", "ost_io_time_ms_total", ioTimeHelp},
{"brw_stats", "ost_disk_io_total", diskIOSizeHelp},
{"degraded", "ost_degraded_now", "Binary indicator as to whether or not the pool is degraded - 0 for not degraded, 1 for degraded"},
{"filesfree", "ost_files_free_now", "The number of inodes (objects) available"},
{"filestotal", "ost_file_capacity", "The maximum number of inodes (objects) the filesystem can hold"},
{"grant_compat_disable", "ost_grant_compat_disabled", "Binary indicator as to whether clients with OBD_CONNECT_GRANT_PARAM setting will be granted space"},
{"grant_precreate", "ost_grant_precreate_capacity_bytes", "Maximum space in bytes that clients can preallocate for objects"},
{"job_cleanup_interval", "ost_job_cleanup_interval_seconds", "Interval in seconds between cleanup of tuning statistics"},
{"job_stats", "ost_job_read_samples_total", readSamplesHelp},
{"job_stats", "ost_job_read_minimum_size_bytes", readMinimumHelp},
{"job_stats", "ost_job_read_maximum_size_bytes", readMaximumHelp},
{"job_stats", "ost_job_read_bytes_total", readTotalHelp},
{"job_stats", "ost_job_write_samples_total", writeSamplesHelp},
{"job_stats", "ost_job_write_minimum_size_bytes", writeMinimumHelp},
{"job_stats", "ost_job_write_maximum_size_bytes", writeMaximumHelp},
{"job_stats", "ost_job_write_bytes_total", writeTotalHelp},
{"job_stats", "ost_job_getattr_total", getattrHelp},
{"job_stats", "ost_job_setattr_total", setattrHelp},
{"job_stats", "ost_job_punch_total", punchHelp},
{"job_stats", "ost_job_sync_total", syncHelp},
{"job_stats", "ost_job_destroy_total", destroyHelp},
{"job_stats", "ost_job_create_total", createHelp},
{"job_stats", "ost_job_statfs_total", statfsHelp},
{"job_stats", "ost_job_get_info_total", getInfoHelp},
{"job_stats", "ost_job_set_info_total", setInfoHelp},
{"job_stats", "ost_job_quotactl_total", quotactlHelp},
{"kbytesavail", "ost_kilobytes_available_now", "Number of kilobytes readily available in the pool"},
{"kbytesfree", "ost_kilobytes_free_now", "Number of kilobytes allocated to the pool"},
{"kbytestotal", "ost_kilobytes_capacity", "Capacity of the pool in kilobytes"},
{"lfsck_speed_limit", "ost_lfsck_speed_limit", "Maximum operations per second LFSCK (Lustre filesystem verification) can run"},
{"num_exports", "ost_exports_total", "Total number of times the pool has been exported"},
{"precreate_batch", "ost_precreate_batch", "Maximum number of objects that can be included in a single transaction"},
{"recovery_time_hard", "ost_recovery_time_hard_seconds", "Maximum timeout 'recover_time_soft' can increment to for a single server"},
{"recovery_time_soft", "ost_recovery_time_soft_seconds", "Duration in seconds for a client to attempt to reconnect after a crash (automatically incremented if servers are still in an error state)"},
{"soft_sync_limit", "ost_soft_sync_limit", "Number of RPCs necessary before triggering a sync"},
{"stats", "ost_read_samples_total", readSamplesHelp},
{"stats", "ost_read_minimum_size_bytes", readMinimumHelp},
{"stats", "ost_read_maximum_size_bytes", readMaximumHelp},
{"stats", "ost_read_bytes_total", readTotalHelp},
{"stats", "ost_write_samples_total", writeSamplesHelp},
{"stats", "ost_write_minimum_size_bytes", writeMinimumHelp},
{"stats", "ost_write_maximum_size_bytes", writeMaximumHelp},
{"stats", "ost_write_bytes_total", writeTotalHelp},
{"sync_journal", "ost_sync_journal_enabled", "Binary indicator as to whether or not the journal is set for asynchronous commits"},
{"tot_dirty", "ost_exports_dirty_total", "Total number of exports that have been marked dirty"},
{"tot_granted", "ost_exports_granted_total", "Total number of exports that have been marked granted"},
{"tot_pending", "ost_exports_pending_total", "Total number of exports that have been marked pending"},
},
"ldlm/namespaces/filter-*": {
{"lock_count", "lock_count", "Number of locks"},
{"lock_timeouts", "lock_timeouts", "Number of lock timeouts"},
{"contended_locks", "contended_locks", "Number of contended locks"},
{"contention_seconds", "contention_seconds", "Time in seconds during which locks were contended"},
{"pool/granted", "granted", "Number of granted locks"},
{"pool/grant_rate", "grant_rate", "Lock grant rate"},
{"pool/cancel_rate", "cancel_rate", "Lock cancel rate"},
{"pool/grant_speed", "grant_speed", "Lock grant speed"},
{"lock_count", "ost_lock_count_total", "Number of locks"},
{"lock_timeouts", "ost_lock_timeout_total", "Number of lock timeouts"},
{"contended_locks", "ost_lock_contended_total", "Number of contended locks"},
{"contention_seconds", "ost_lock_contention_seconds_total", "Time in seconds during which locks were contended"},
{"pool/granted", "ost_locks_granted_total", "Number of granted locks"},
{"pool/grant_rate", "ost_lock_grant_rate", "Lock grant rate"},
{"pool/cancel_rate", "ost_lock_cancel_rate", "Lock cancel rate"},
{"pool/grant_speed", "ost_lock_grant_speed", "Lock grant speed"},
},
}
for path := range metricMap {
Expand All @@ -201,30 +201,30 @@ func (s *lustreSource) generateOSTMetricTemplates() error {
func (s *lustreSource) generateMDTMetricTemplates() error {
metricMap := map[string][]lustreHelpStruct{
"mdt/*": {
{"md_stats", "mdt_opens", openHelp},
{"md_stats", "mdt_closes", closeHelp},
{"md_stats", "mdt_getattrs", getattrHelp},
{"md_stats", "mdt_setattrs", setattrHelp},
{"md_stats", "mdt_getxattrs", getxattrHelp},
{"md_stats", "mdt_setxattrs", setxattrHelp},
{"md_stats", "mdt_statfs", statfsHelp},
{"num_exports", "num_exports", "Total number of times the pool has been exported"},
{"job_stats", "num_opens", openHelp},
{"job_stats", "num_closes", closeHelp},
{"job_stats", "num_mknod", mknodHelp},
{"job_stats", "num_link", linkHelp},
{"job_stats", "num_unlink", unlinkHelp},
{"job_stats", "num_mkdir", mkdirHelp},
{"job_stats", "num_rmdir", rmdirHelp},
{"job_stats", "num_rename", renameHelp},
{"job_stats", "num_getattr", getattrHelp},
{"job_stats", "num_setattr", setattrHelp},
{"job_stats", "num_getxattr", getxattrHelp},
{"job_stats", "num_setxattr", setxattrHelp},
{"job_stats", "num_statfs", statfsHelp},
{"job_stats", "num_sync", syncHelp},
{"job_stats", "num_samedir_rename", samedirRenameHelp},
{"job_stats", "num_crossdir_rename", crossdirRenameHelp},
{"md_stats", "mdt_open_total", openHelp},
{"md_stats", "mdt_close_total", closeHelp},
{"md_stats", "mdt_getattr_total", getattrHelp},
{"md_stats", "mdt_setattr_total", setattrHelp},
{"md_stats", "mdt_getxattr_total", getxattrHelp},
{"md_stats", "mdt_setxattr_total", setxattrHelp},
{"md_stats", "mdt_statfs_total", statfsHelp},
{"num_exports", "mdt_exports_total", "Total number of times the pool has been exported"},
{"job_stats", "mdt_job_open_total", openHelp},
{"job_stats", "mdt_job_close_total", closeHelp},
{"job_stats", "mdt_job_mknod_total", mknodHelp},
{"job_stats", "mdt_job_link_total", linkHelp},
{"job_stats", "mdt_job_unlink_total", unlinkHelp},
{"job_stats", "mdt_job_mkdir_total", mkdirHelp},
{"job_stats", "mdt_job_rmdir_total", rmdirHelp},
{"job_stats", "mdt_job_rename_total", renameHelp},
{"job_stats", "mdt_job_getattr_total", getattrHelp},
{"job_stats", "mdt_job_setattr_total", setattrHelp},
{"job_stats", "mdt_job_getxattr_total", getxattrHelp},
{"job_stats", "mdt_job_setxattr_total", setxattrHelp},
{"job_stats", "mdt_job_statfs_total", statfsHelp},
{"job_stats", "mdt_job_sync_total", syncHelp},
{"job_stats", "mdt_job_samedir_rename_total", samedirRenameHelp},
{"job_stats", "mdt_job_crossdir_rename_total", crossdirRenameHelp},
},
}
for path := range metricMap {
Expand All @@ -239,13 +239,13 @@ func (s *lustreSource) generateMDTMetricTemplates() error {
func (s *lustreSource) generateMGSMetricTemplates() error {
metricMap := map[string][]lustreHelpStruct{
"mgs/MGS/osd/": {
{"blocksize", "blocksize", "Filesystem block size in bytes"},
{"filesfree", "filesfree", "The number of inodes (objects) available"},
{"filestotal", "filestotal", "The maximum number of inodes (objects) the filesystem can hold"},
{"kbytesavail", "kbytesavail", "Number of kilobytes readily available in the pool"},
{"kbytesfree", "kbytesfree", "Number of kilobytes allocated to the pool"},
{"kbytestotal", "kbytestotal", "Capacity of the pool in kilobytes"},
{"quota_iused_estimate", "quota_iused_estimate", "Returns '1' if a valid address is returned within the pool, referencing whether free space can be allocated"},
{"blocksize", "mgs_blocksize_bytes", "Filesystem block size in bytes"},
{"filesfree", "mgs_files_free_now", "The number of inodes (objects) available"},
{"filestotal", "mgs_file_capacity", "The maximum number of inodes (objects) the filesystem can hold"},
{"kbytesavail", "mgs_kilobytes_available_now", "Number of kilobytes readily available in the pool"},
{"kbytesfree", "mgs_kilobytes_free_now", "Number of kilobytes allocated to the pool"},
{"kbytestotal", "mgs_kilobytes_capacity", "Capacity of the pool in kilobytes"},
{"quota_iused_estimate", "mgs_quota_iused_estimate", "Returns '1' if a valid address is returned within the pool, referencing whether free space can be allocated"},
},
}
for path := range metricMap {
Expand All @@ -260,13 +260,13 @@ func (s *lustreSource) generateMGSMetricTemplates() error {
func (s *lustreSource) generateMDSMetricTemplates() error {
metricMap := map[string][]lustreHelpStruct{
"mds/MDS/osd": {
{"blocksize", "blocksize", "Filesystem block size in bytes"},
{"filesfree", "filesfree", "The number of inodes (objects) available"},
{"filestotal", "filestotal", "The maximum number of inodes (objects) the filesystem can hold"},
{"kbytesavail", "kbytesavail", "Number of kilobytes readily available in the pool"},
{"kbytesfree", "kbytesfree", "Number of kilobytes allocated to the pool"},
{"kbytestotal", "kbytestotal", "Capacity of the pool in kilobytes"},
{"quota_iused_estimate", "quota_iused_estimate", "Returns '1' if a valid address is returned within the pool, referencing whether free space can be allocated"},
{"blocksize", "mds_blocksize_bytes", "Filesystem block size in bytes"},
{"filesfree", "mds_files_free_now", "The number of inodes (objects) available"},
{"filestotal", "mds_file_capacity", "The maximum number of inodes (objects) the filesystem can hold"},
{"kbytesavail", "mds_kilobytes_available_now", "Number of kilobytes readily available in the pool"},
{"kbytesfree", "mds_kilobytes_free_now", "Number of kilobytes allocated to the pool"},
{"kbytestotal", "mds_kilobytes_capacity", "Capacity of the pool in kilobytes"},
{"quota_iused_estimate", "mds_quota_iused_estimate", "Returns '1' if a valid address is returned within the pool, referencing whether free space can be allocated"},
},
}
for path := range metricMap {
Expand Down

0 comments on commit 5d14aed

Please sign in to comment.