From c7ff72f633020d77b92df9e9ec17a9c2c4386755 Mon Sep 17 00:00:00 2001 From: Raphael Druon Date: Mon, 10 Jul 2023 09:22:29 -0600 Subject: [PATCH] Fix test --- src/fixtures/valid/valid.txt | 163 ++- src/osd_parser.rs | 6 +- src/oss/job_stats.rs | 7 +- src/parser.rs | 4 +- src/quota/quota_parser.rs | 12 +- ...collector__parser__tests__node_output.snap | 1224 ++++++++--------- ...stre_collector__parser__tests__params.snap | 6 + 7 files changed, 708 insertions(+), 714 deletions(-) diff --git a/src/fixtures/valid/valid.txt b/src/fixtures/valid/valid.txt index 7d11c18..06fbd31 100644 --- a/src/fixtures/valid/valid.txt +++ b/src/fixtures/valid/valid.txt @@ -159,6 +159,32 @@ I/O time (1/1000s) ios % cum % | ios % cum % read | write disk I/O size ios % cum % | ios % cum % +osd-ldiskfs.testfs-MDT0000.quota_slave.acct_group= +grp_accounting: +- id: 0 + usage: { inodes: 396, kbytes: 529400 } +osd-ldiskfs.testfs-MDT0001.quota_slave.acct_group= +grp_accounting: +- id: 0 + usage: { inodes: 265, kbytes: 356672 } +osd-ldiskfs.testfs-MDT0000.quota_slave.acct_user= +usr_accounting: +- id: 0 + usage: { inodes: 396, kbytes: 529400 } +osd-ldiskfs.testfs-MDT0001.quota_slave.acct_user= +usr_accounting: +- id: 0 + usage: { inodes: 265, kbytes: 356672 } +osd-ldiskfs.testfs-MDT0000.quota_slave.acct_project= +prj_accounting: +- id: 0 + usage: { inodes: 393, kbytes: 529396 } +- id: 1337 + usage: { inodes: 3, kbytes: 4 } +osd-ldiskfs.testfs-MDT0001.quota_slave.acct_project= +prj_accounting: +- id: 0 + usage: { inodes: 265, kbytes: 356672 } mdt.ai400-MDT0000.exports.0@lo.uuid= 52cb8dca-ba5c-4725-9cff-41cd0d45e3e7 ai400-MDT0000-lwp-OST0000_UUID @@ -272,62 +298,6 @@ getattr 23 samples [usecs] 2 192 629 52487 getxattr 2 samples [usecs] 18 29 47 1165 statfs 44863 samples [usecs] 0 43 323074 3055172 mdt.ai400-MDT0000.num_exports=19 -ldlm.namespaces.mdt-ai400-MDT0000_UUID.contended_locks=32 -ldlm.namespaces.filter-ai400-OST0000_UUID.contended_locks=32 -ldlm.namespaces.filter-ai400-OST0001_UUID.contended_locks=32 -ldlm.namespaces.mdt-ai400-MDT0000_UUID.contention_seconds=2 -ldlm.namespaces.filter-ai400-OST0000_UUID.contention_seconds=2 -ldlm.namespaces.filter-ai400-OST0001_UUID.contention_seconds=2 -ldlm.namespaces.mdt-ai400-MDT0000_UUID.ctime_age_limit=10 -ldlm.namespaces.filter-ai400-OST0000_UUID.ctime_age_limit=10 -ldlm.namespaces.filter-ai400-OST0001_UUID.ctime_age_limit=10 -ldlm.namespaces.mdt-ai400-MDT0000_UUID.early_lock_cancel=0 -ldlm.namespaces.filter-ai400-OST0000_UUID.early_lock_cancel=0 -ldlm.namespaces.filter-ai400-OST0001_UUID.early_lock_cancel=0 -ldlm.namespaces.mdt-ai400-MDT0000_UUID.lock_count=9 -ldlm.namespaces.filter-ai400-OST0000_UUID.lock_count=1 -ldlm.namespaces.filter-ai400-OST0001_UUID.lock_count=0 -ldlm.namespaces.mdt-ai400-MDT0000_UUID.lock_timeouts=0 -ldlm.namespaces.filter-ai400-OST0000_UUID.lock_timeouts=0 -ldlm.namespaces.filter-ai400-OST0001_UUID.lock_timeouts=0 -ldlm.namespaces.mdt-ai400-MDT0000_UUID.lock_unused_count=0 -ldlm.namespaces.filter-ai400-OST0000_UUID.lock_unused_count=0 -ldlm.namespaces.filter-ai400-OST0001_UUID.lock_unused_count=0 -ldlm.namespaces.mdt-ai400-MDT0000_UUID.lru_max_age=3900000 -ldlm.namespaces.filter-ai400-OST0000_UUID.lru_max_age=3900000 -ldlm.namespaces.filter-ai400-OST0001_UUID.lru_max_age=3900000 -ldlm.namespaces.mdt-ai400-MDT0000_UUID.lru_size=2000 -ldlm.namespaces.filter-ai400-OST0000_UUID.lru_size=2000 -ldlm.namespaces.filter-ai400-OST0001_UUID.lru_size=2000 -ldlm.namespaces.mdt-ai400-MDT0000_UUID.max_nolock_bytes=0 -ldlm.namespaces.filter-ai400-OST0000_UUID.max_nolock_bytes=0 -ldlm.namespaces.filter-ai400-OST0001_UUID.max_nolock_bytes=0 -ldlm.namespaces.mdt-ai400-MDT0000_UUID.max_parallel_ast=1024 -ldlm.namespaces.filter-ai400-OST0000_UUID.max_parallel_ast=1024 -ldlm.namespaces.filter-ai400-OST0001_UUID.max_parallel_ast=1024 -ldlm.namespaces.mdt-ai400-MDT0000_UUID.resource_count=4 -ldlm.namespaces.filter-ai400-OST0000_UUID.resource_count=1 -ldlm.namespaces.filter-ai400-OST0001_UUID.resource_count=0 -ldlm.services.ldlm_canceld.stats= -snapshot_time 1688603042.556495184 secs.nsecs -start_time 1688526463.472430928 secs.nsecs -elapsed_time 76579.084064256 secs.nsecs -req_waittime 10 samples [usecs] 33 85 521 28911 -req_qdepth 10 samples [reqs] 0 0 0 0 -req_active 10 samples [reqs] 1 1 10 10 -req_timeout 10 samples [secs] 15 15 150 2250 -reqbuf_avail 31 samples [bufs] 64 64 1984 126976 -ldlm_cancel 10 samples [usecs] 25 100 415 21291 -ldlm.services.ldlm_cbd.stats= -snapshot_time 1688603042.556553639 secs.nsecs -start_time 1688526463.470283048 secs.nsecs -elapsed_time 76579.086270591 secs.nsecs -req_waittime 1 samples [usecs] 26 26 26 676 -req_qdepth 1 samples [reqs] 0 0 0 0 -req_active 1 samples [reqs] 1 1 1 1 -req_timeout 1 samples [secs] 15 15 15 225 -reqbuf_avail 3 samples [bufs] 1 1 3 3 -ldlm_bl_callback 1 samples [usecs] 16 16 16 256 qmt.testfs-QMT0000.dt-0x0.glb-grp= global_pool0_dt_grp - id: 0 @@ -384,30 +354,59 @@ qmt.testfs-QMT0000.md-0x0.glb-usr= global_pool0_md_usr - id: 0 limits: { hard: 0, soft: 0, granted: 0, time: 604800 } -osd-ldiskfs.testfs-MDT0000.quota_slave.acct_group= -grp_accounting: -- id: 0 - usage: { inodes: 396, kbytes: 529400 } -osd-ldiskfs.testfs-MDT0000.quota_slave.acct_project= -prj_accounting: -- id: 0 - usage: { inodes: 393, kbytes: 529396 } -- id: 1337 - usage: { inodes: 3, kbytes: 4 } -osd-ldiskfs.testfs-MDT0000.quota_slave.acct_user= -usr_accounting: -- id: 0 - usage: { inodes: 396, kbytes: 529400 } -osd-ldiskfs.testfs-MDT0001.quota_slave.acct_group= -grp_accounting: -- id: 0 - usage: { inodes: 265, kbytes: 356672 } -osd-ldiskfs.testfs-MDT0001.quota_slave.acct_project= -prj_accounting: -- id: 0 - usage: { inodes: 265, kbytes: 356672 } -osd-ldiskfs.testfs-MDT0001.quota_slave.acct_user= -usr_accounting: -- id: 0 - usage: { inodes: 265, kbytes: 356672 } +ldlm.namespaces.mdt-ai400-MDT0000_UUID.contended_locks=32 +ldlm.namespaces.filter-ai400-OST0000_UUID.contended_locks=32 +ldlm.namespaces.filter-ai400-OST0001_UUID.contended_locks=32 +ldlm.namespaces.mdt-ai400-MDT0000_UUID.contention_seconds=2 +ldlm.namespaces.filter-ai400-OST0000_UUID.contention_seconds=2 +ldlm.namespaces.filter-ai400-OST0001_UUID.contention_seconds=2 +ldlm.namespaces.mdt-ai400-MDT0000_UUID.ctime_age_limit=10 +ldlm.namespaces.filter-ai400-OST0000_UUID.ctime_age_limit=10 +ldlm.namespaces.filter-ai400-OST0001_UUID.ctime_age_limit=10 +ldlm.namespaces.mdt-ai400-MDT0000_UUID.early_lock_cancel=0 +ldlm.namespaces.filter-ai400-OST0000_UUID.early_lock_cancel=0 +ldlm.namespaces.filter-ai400-OST0001_UUID.early_lock_cancel=0 +ldlm.namespaces.mdt-ai400-MDT0000_UUID.lock_count=9 +ldlm.namespaces.filter-ai400-OST0000_UUID.lock_count=1 +ldlm.namespaces.filter-ai400-OST0001_UUID.lock_count=0 +ldlm.namespaces.mdt-ai400-MDT0000_UUID.lock_timeouts=0 +ldlm.namespaces.filter-ai400-OST0000_UUID.lock_timeouts=0 +ldlm.namespaces.filter-ai400-OST0001_UUID.lock_timeouts=0 +ldlm.namespaces.mdt-ai400-MDT0000_UUID.lock_unused_count=0 +ldlm.namespaces.filter-ai400-OST0000_UUID.lock_unused_count=0 +ldlm.namespaces.filter-ai400-OST0001_UUID.lock_unused_count=0 +ldlm.namespaces.mdt-ai400-MDT0000_UUID.lru_max_age=3900000 +ldlm.namespaces.filter-ai400-OST0000_UUID.lru_max_age=3900000 +ldlm.namespaces.filter-ai400-OST0001_UUID.lru_max_age=3900000 +ldlm.namespaces.mdt-ai400-MDT0000_UUID.lru_size=2000 +ldlm.namespaces.filter-ai400-OST0000_UUID.lru_size=2000 +ldlm.namespaces.filter-ai400-OST0001_UUID.lru_size=2000 +ldlm.namespaces.mdt-ai400-MDT0000_UUID.max_nolock_bytes=0 +ldlm.namespaces.filter-ai400-OST0000_UUID.max_nolock_bytes=0 +ldlm.namespaces.filter-ai400-OST0001_UUID.max_nolock_bytes=0 +ldlm.namespaces.mdt-ai400-MDT0000_UUID.max_parallel_ast=1024 +ldlm.namespaces.filter-ai400-OST0000_UUID.max_parallel_ast=1024 +ldlm.namespaces.filter-ai400-OST0001_UUID.max_parallel_ast=1024 +ldlm.namespaces.mdt-ai400-MDT0000_UUID.resource_count=4 +ldlm.namespaces.filter-ai400-OST0000_UUID.resource_count=1 ldlm.namespaces.filter-ai400-OST0001_UUID.resource_count=0 +ldlm.services.ldlm_canceld.stats= +snapshot_time 1688603042.556495184 secs.nsecs +start_time 1688526463.472430928 secs.nsecs +elapsed_time 76579.084064256 secs.nsecs +req_waittime 10 samples [usecs] 33 85 521 28911 +req_qdepth 10 samples [reqs] 0 0 0 0 +req_active 10 samples [reqs] 1 1 10 10 +req_timeout 10 samples [secs] 15 15 150 2250 +reqbuf_avail 31 samples [bufs] 64 64 1984 126976 +ldlm_cancel 10 samples [usecs] 25 100 415 21291 +ldlm.services.ldlm_cbd.stats= +snapshot_time 1688603042.556553639 secs.nsecs +start_time 1688526463.470283048 secs.nsecs +elapsed_time 76579.086270591 secs.nsecs +req_waittime 1 samples [usecs] 26 26 26 676 +req_qdepth 1 samples [reqs] 0 0 0 0 +req_active 1 samples [reqs] 1 1 1 1 +req_timeout 1 samples [secs] 15 15 15 225 +reqbuf_avail 3 samples [bufs] 1 1 3 3 +ldlm_bl_callback 1 samples [usecs] 16 16 16 256 diff --git a/src/osd_parser.rs b/src/osd_parser.rs index da46e6d..107d6eb 100644 --- a/src/osd_parser.rs +++ b/src/osd_parser.rs @@ -39,9 +39,9 @@ pub(crate) fn params() -> Vec { format!("osd-*.*.{KBYTES_FREE}"), format!("osd-*.*.{KBYTES_TOTAL}"), format!("osd-*.*.{BRW_STATS}"), - format!("osd-*.{QUOTA_ACCT_GRP}"), - format!("osd-*.{QUOTA_ACCT_USR}"), - format!("osd-*.{QUOTA_ACCT_PRJ}"), + format!("osd-*.*.{QUOTA_ACCT_GRP}"), + format!("osd-*.*.{QUOTA_ACCT_USR}"), + format!("osd-*.*.{QUOTA_ACCT_PRJ}"), ] } diff --git a/src/oss/job_stats.rs b/src/oss/job_stats.rs index b995b76..bb8679b 100644 --- a/src/oss/job_stats.rs +++ b/src/oss/job_stats.rs @@ -4,7 +4,7 @@ use crate::types::{JobStatOst, JobStatsOst}; use combine::{ - attempt, + attempt, eof, error::{ParseError, StreamError}, optional, parser::{ @@ -22,9 +22,10 @@ where { ( optional(newline()), // If Jobstats are present, the whole yaml blob will be on a newline - take_until(attempt((newline(), alpha_num()))), + take_until(attempt((newline(), alpha_num()).map(drop).or(eof()))), ) - .skip(newline()) + .skip(optional(newline())) + .skip(optional(eof())) .and_then(|(_, x): (_, String)| { serde_yaml::from_str(&x) .map(|x: JobStatsOst| x.job_stats) diff --git a/src/parser.rs b/src/parser.rs index 10f89d2..3206dd4 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -20,8 +20,8 @@ pub fn params() -> Vec { .chain(mgs_parser::params()) .chain(oss::params()) .chain(mds_parser::params()) - .chain(ldlm::params()) .chain(quota::params()) + .chain(ldlm::params()) .collect() } @@ -37,8 +37,8 @@ where mgs_parser::parse().map(|x| vec![x]), mds_parser::parse().map(|x| vec![x]), oss::parse().map(|x| vec![x]), - ldlm::parse().map(|x| vec![x]), quota::parse().map(|x| vec![x]), + ldlm::parse().map(|x| vec![x]), ))) .map(|xs: Vec<_>| xs.into_iter().flatten().collect()) } diff --git a/src/quota/quota_parser.rs b/src/quota/quota_parser.rs index cf6cc6d..3f2f63a 100644 --- a/src/quota/quota_parser.rs +++ b/src/quota/quota_parser.rs @@ -9,7 +9,7 @@ use crate::{ QuotaKind, QuotaStat, QuotaStatOsd, QuotaStats, TargetQuotaStat, }; use combine::{ - attempt, choice, + attempt, choice, eof, error::{ParseError, StreamError}, many, one_of, optional, parser::{ @@ -51,9 +51,10 @@ where optional(newline()), // If quota stats are present, the whole yaml blob will be on a newline many::, _, _>(alpha_num().or(one_of("_-:".chars()))), // But yaml header might not be properly formatted, ignore it newline(), - take_until(attempt((newline(), alpha_num()))), + take_until(attempt((newline(), alpha_num()).map(drop).or(eof()))), ) - .skip(newline()) + .skip(optional(newline())) + .skip(optional(eof())) .and_then(|(_, _, _, x): (_, _, _, String)| { serde_yaml::from_str::>(&x).map_err(StreamErrorFor::::other) }) @@ -68,9 +69,10 @@ where optional(newline()), // If quota stats are present, the whole yaml blob will be on a newline many::, _, _>(alpha_num().or(one_of("_-:".chars()))), // But yaml header might not be properly formatted, ignore it newline(), - take_until(attempt((newline(), alpha_num()))), + take_until(attempt((newline(), alpha_num()).map(drop).or(eof()))), ) - .skip(newline()) + .skip(optional(newline())) + .skip(optional(eof())) .and_then(|(_, _, _, x): (_, _, _, String)| { serde_yaml::from_str::>(&x).map_err(StreamErrorFor::::other) }) diff --git a/src/snapshots/lustre_collector__parser__tests__node_output.snap b/src/snapshots/lustre_collector__parser__tests__node_output.snap index 77450ad..2d3c8e1 100644 --- a/src/snapshots/lustre_collector__parser__tests__node_output.snap +++ b/src/snapshots/lustre_collector__parser__tests__node_output.snap @@ -672,6 +672,163 @@ expression: result }, ), ), + Target( + QuotaStatsOsd( + TargetStat { + kind: Mdt, + param: Param( + "quota_slave.acct_group", + ), + target: Target( + "testfs-MDT0000", + ), + value: QuotaStatsOsd { + kind: Grp, + stats: [ + QuotaStatOsd { + id: 0, + usage: QuotaStatUsage { + inodes: 396, + kbytes: 529400, + }, + }, + ], + }, + }, + ), + ), + Target( + QuotaStatsOsd( + TargetStat { + kind: Mdt, + param: Param( + "quota_slave.acct_group", + ), + target: Target( + "testfs-MDT0001", + ), + value: QuotaStatsOsd { + kind: Grp, + stats: [ + QuotaStatOsd { + id: 0, + usage: QuotaStatUsage { + inodes: 265, + kbytes: 356672, + }, + }, + ], + }, + }, + ), + ), + Target( + QuotaStatsOsd( + TargetStat { + kind: Mdt, + param: Param( + "quota_slave.acct_user", + ), + target: Target( + "testfs-MDT0000", + ), + value: QuotaStatsOsd { + kind: Usr, + stats: [ + QuotaStatOsd { + id: 0, + usage: QuotaStatUsage { + inodes: 396, + kbytes: 529400, + }, + }, + ], + }, + }, + ), + ), + Target( + QuotaStatsOsd( + TargetStat { + kind: Mdt, + param: Param( + "quota_slave.acct_user", + ), + target: Target( + "testfs-MDT0001", + ), + value: QuotaStatsOsd { + kind: Usr, + stats: [ + QuotaStatOsd { + id: 0, + usage: QuotaStatUsage { + inodes: 265, + kbytes: 356672, + }, + }, + ], + }, + }, + ), + ), + Target( + QuotaStatsOsd( + TargetStat { + kind: Mdt, + param: Param( + "quota_slave.acct_project", + ), + target: Target( + "testfs-MDT0000", + ), + value: QuotaStatsOsd { + kind: Prj, + stats: [ + QuotaStatOsd { + id: 0, + usage: QuotaStatUsage { + inodes: 393, + kbytes: 529396, + }, + }, + QuotaStatOsd { + id: 1337, + usage: QuotaStatUsage { + inodes: 3, + kbytes: 4, + }, + }, + ], + }, + }, + ), + ), + Target( + QuotaStatsOsd( + TargetStat { + kind: Mdt, + param: Param( + "quota_slave.acct_project", + ), + target: Target( + "testfs-MDT0001", + ), + value: QuotaStatsOsd { + kind: Prj, + stats: [ + QuotaStatOsd { + id: 0, + usage: QuotaStatUsage { + inodes: 265, + kbytes: 356672, + }, + }, + ], + }, + }, + ), + ), Target( ConnectedClients( TargetStat { @@ -1907,221 +2064,581 @@ expression: result ), ), Target( - ContendedLocks( - TargetStat { - kind: Mdt, + QuotaStats( + TargetQuotaStat { + pool: "dt-0x0", param: Param( - "contended_locks", + "glb-grp", ), target: Target( - "ai400-MDT0000", + "testfs-QMT0000", ), - value: 32, + value: QuotaStats { + kind: Grp, + stats: [ + QuotaStat { + id: 0, + limits: QuotaStatLimits { + hard: 0, + soft: 0, + granted: 0, + time: 604800, + }, + }, + ], + }, }, ), ), Target( - ContendedLocks( - TargetStat { - kind: Ost, + QuotaStats( + TargetQuotaStat { + pool: "dt-0x0", param: Param( - "contended_locks", + "glb-prj", ), target: Target( - "ai400-OST0000", + "testfs-QMT0000", ), - value: 32, + value: QuotaStats { + kind: Grp, + stats: [ + QuotaStat { + id: 0, + limits: QuotaStatLimits { + hard: 0, + soft: 0, + granted: 0, + time: 604800, + }, + }, + QuotaStat { + id: 1337, + limits: QuotaStatLimits { + hard: 309200, + soft: 307200, + granted: 1025032, + time: 1687277628, + }, + }, + ], + }, }, ), ), Target( - ContendedLocks( - TargetStat { - kind: Ost, + QuotaStats( + TargetQuotaStat { + pool: "dt-0x0", param: Param( - "contended_locks", + "glb-usr", ), target: Target( - "ai400-OST0001", + "testfs-QMT0000", ), - value: 32, + value: QuotaStats { + kind: Usr, + stats: [ + QuotaStat { + id: 0, + limits: QuotaStatLimits { + hard: 0, + soft: 0, + granted: 0, + time: 604800, + }, + }, + ], + }, }, ), ), Target( - ContentionSeconds( - TargetStat { - kind: Mdt, + QuotaStats( + TargetQuotaStat { + pool: "dt-ddn_ssd", param: Param( - "contention_seconds", + "glb-grp", ), target: Target( - "ai400-MDT0000", + "testfs-QMT0000", ), - value: 2, - }, - ), - ), - Target( - ContentionSeconds( - TargetStat { - kind: Ost, - param: Param( - "contention_seconds", + value: QuotaStats { + kind: Grp, + stats: [ + QuotaStat { + id: 0, + limits: QuotaStatLimits { + hard: 0, + soft: 0, + granted: 0, + time: 604800, + }, + }, + ], + }, + }, + ), + ), + Target( + QuotaStats( + TargetQuotaStat { + pool: "dt-ddn_ssd", + param: Param( + "glb-prj", ), target: Target( - "ai400-OST0000", + "testfs-QMT0000", ), - value: 2, + value: QuotaStats { + kind: Grp, + stats: [ + QuotaStat { + id: 0, + limits: QuotaStatLimits { + hard: 0, + soft: 0, + granted: 0, + time: 604800, + }, + }, + QuotaStat { + id: 1337, + limits: QuotaStatLimits { + hard: 0, + soft: 0, + granted: 1024004, + time: 281474976710656, + }, + }, + ], + }, }, ), ), Target( - ContentionSeconds( - TargetStat { - kind: Ost, + QuotaStats( + TargetQuotaStat { + pool: "dt-ddn_ssd", param: Param( - "contention_seconds", + "glb-usr", ), target: Target( - "ai400-OST0001", + "testfs-QMT0000", ), - value: 2, + value: QuotaStats { + kind: Usr, + stats: [ + QuotaStat { + id: 0, + limits: QuotaStatLimits { + hard: 0, + soft: 0, + granted: 0, + time: 604800, + }, + }, + ], + }, }, ), ), Target( - CtimeAgeLimit( - TargetStat { - kind: Mdt, + QuotaStats( + TargetQuotaStat { + pool: "dt-pool_1", param: Param( - "ctime_age_limit", + "glb-grp", ), target: Target( - "ai400-MDT0000", + "testfs-QMT0000", ), - value: 10, + value: QuotaStats { + kind: Grp, + stats: [ + QuotaStat { + id: 0, + limits: QuotaStatLimits { + hard: 0, + soft: 0, + granted: 0, + time: 604800, + }, + }, + ], + }, }, ), ), Target( - CtimeAgeLimit( - TargetStat { - kind: Ost, + QuotaStats( + TargetQuotaStat { + pool: "dt-pool_1", param: Param( - "ctime_age_limit", + "glb-prj", ), target: Target( - "ai400-OST0000", + "testfs-QMT0000", ), - value: 10, + value: QuotaStats { + kind: Grp, + stats: [ + QuotaStat { + id: 0, + limits: QuotaStatLimits { + hard: 0, + soft: 0, + granted: 0, + time: 604800, + }, + }, + QuotaStat { + id: 1337, + limits: QuotaStatLimits { + hard: 0, + soft: 0, + granted: 1024004, + time: 281474976710656, + }, + }, + ], + }, }, ), ), Target( - CtimeAgeLimit( - TargetStat { - kind: Ost, + QuotaStats( + TargetQuotaStat { + pool: "dt-pool_1", param: Param( - "ctime_age_limit", + "glb-usr", ), target: Target( - "ai400-OST0001", + "testfs-QMT0000", ), - value: 10, + value: QuotaStats { + kind: Usr, + stats: [ + QuotaStat { + id: 0, + limits: QuotaStatLimits { + hard: 0, + soft: 0, + granted: 0, + time: 604800, + }, + }, + ], + }, }, ), ), Target( - EarlyLockCancel( - TargetStat { - kind: Mdt, + QuotaStats( + TargetQuotaStat { + pool: "md-0x0", param: Param( - "early_lock_cancel", + "glb-grp", ), target: Target( - "ai400-MDT0000", + "testfs-QMT0000", ), - value: 0, + value: QuotaStats { + kind: Grp, + stats: [ + QuotaStat { + id: 0, + limits: QuotaStatLimits { + hard: 0, + soft: 0, + granted: 0, + time: 604800, + }, + }, + ], + }, }, ), ), Target( - EarlyLockCancel( - TargetStat { - kind: Ost, + QuotaStats( + TargetQuotaStat { + pool: "md-0x0", param: Param( - "early_lock_cancel", + "glb-prj", ), target: Target( - "ai400-OST0000", + "testfs-QMT0000", ), - value: 0, + value: QuotaStats { + kind: Grp, + stats: [ + QuotaStat { + id: 0, + limits: QuotaStatLimits { + hard: 0, + soft: 0, + granted: 0, + time: 604800, + }, + }, + QuotaStat { + id: 1337, + limits: QuotaStatLimits { + hard: 11000, + soft: 10000, + granted: 1024, + time: 0, + }, + }, + ], + }, }, ), ), Target( - EarlyLockCancel( - TargetStat { - kind: Ost, + QuotaStats( + TargetQuotaStat { + pool: "md-0x0", param: Param( - "early_lock_cancel", + "glb-usr", ), target: Target( - "ai400-OST0001", + "testfs-QMT0000", ), - value: 0, + value: QuotaStats { + kind: Usr, + stats: [ + QuotaStat { + id: 0, + limits: QuotaStatLimits { + hard: 0, + soft: 0, + granted: 0, + time: 604800, + }, + }, + ], + }, }, ), ), Target( - LockCount( + ContendedLocks( TargetStat { kind: Mdt, param: Param( - "lock_count", + "contended_locks", ), target: Target( "ai400-MDT0000", ), - value: 9, + value: 32, }, ), ), Target( - LockCount( + ContendedLocks( TargetStat { kind: Ost, param: Param( - "lock_count", + "contended_locks", ), target: Target( "ai400-OST0000", ), - value: 1, + value: 32, }, ), ), Target( - LockCount( + ContendedLocks( TargetStat { kind: Ost, param: Param( - "lock_count", + "contended_locks", ), target: Target( "ai400-OST0001", ), - value: 0, + value: 32, }, ), ), Target( - LockTimeouts( + ContentionSeconds( TargetStat { kind: Mdt, param: Param( - "lock_timeouts", + "contention_seconds", + ), + target: Target( + "ai400-MDT0000", + ), + value: 2, + }, + ), + ), + Target( + ContentionSeconds( + TargetStat { + kind: Ost, + param: Param( + "contention_seconds", + ), + target: Target( + "ai400-OST0000", + ), + value: 2, + }, + ), + ), + Target( + ContentionSeconds( + TargetStat { + kind: Ost, + param: Param( + "contention_seconds", + ), + target: Target( + "ai400-OST0001", + ), + value: 2, + }, + ), + ), + Target( + CtimeAgeLimit( + TargetStat { + kind: Mdt, + param: Param( + "ctime_age_limit", + ), + target: Target( + "ai400-MDT0000", + ), + value: 10, + }, + ), + ), + Target( + CtimeAgeLimit( + TargetStat { + kind: Ost, + param: Param( + "ctime_age_limit", + ), + target: Target( + "ai400-OST0000", + ), + value: 10, + }, + ), + ), + Target( + CtimeAgeLimit( + TargetStat { + kind: Ost, + param: Param( + "ctime_age_limit", + ), + target: Target( + "ai400-OST0001", + ), + value: 10, + }, + ), + ), + Target( + EarlyLockCancel( + TargetStat { + kind: Mdt, + param: Param( + "early_lock_cancel", + ), + target: Target( + "ai400-MDT0000", + ), + value: 0, + }, + ), + ), + Target( + EarlyLockCancel( + TargetStat { + kind: Ost, + param: Param( + "early_lock_cancel", + ), + target: Target( + "ai400-OST0000", + ), + value: 0, + }, + ), + ), + Target( + EarlyLockCancel( + TargetStat { + kind: Ost, + param: Param( + "early_lock_cancel", + ), + target: Target( + "ai400-OST0001", + ), + value: 0, + }, + ), + ), + Target( + LockCount( + TargetStat { + kind: Mdt, + param: Param( + "lock_count", + ), + target: Target( + "ai400-MDT0000", + ), + value: 9, + }, + ), + ), + Target( + LockCount( + TargetStat { + kind: Ost, + param: Param( + "lock_count", + ), + target: Target( + "ai400-OST0000", + ), + value: 1, + }, + ), + ), + Target( + LockCount( + TargetStat { + kind: Ost, + param: Param( + "lock_count", + ), + target: Target( + "ai400-OST0001", + ), + value: 0, + }, + ), + ), + Target( + LockTimeouts( + TargetStat { + kind: Mdt, + param: Param( + "lock_timeouts", ), target: Target( "ai400-MDT0000", @@ -2626,537 +3143,6 @@ expression: result ], ), ), - Target( - QuotaStats( - TargetQuotaStat { - kind: "dt-0x0", - param: Param( - "glb-grp", - ), - target: Target( - "testfs-QMT0000", - ), - value: QuotaStats { - kind: Grp, - stats: [ - QuotaStat { - id: 0, - limits: QuotaStatLimits { - hard: 0, - soft: 0, - granted: 0, - time: 604800, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStats( - TargetQuotaStat { - kind: "dt-0x0", - param: Param( - "glb-prj", - ), - target: Target( - "testfs-QMT0000", - ), - value: QuotaStats { - kind: Grp, - stats: [ - QuotaStat { - id: 0, - limits: QuotaStatLimits { - hard: 0, - soft: 0, - granted: 0, - time: 604800, - }, - }, - QuotaStat { - id: 1337, - limits: QuotaStatLimits { - hard: 309200, - soft: 307200, - granted: 1025032, - time: 1687277628, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStats( - TargetQuotaStat { - kind: "dt-0x0", - param: Param( - "glb-usr", - ), - target: Target( - "testfs-QMT0000", - ), - value: QuotaStats { - kind: Usr, - stats: [ - QuotaStat { - id: 0, - limits: QuotaStatLimits { - hard: 0, - soft: 0, - granted: 0, - time: 604800, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStats( - TargetQuotaStat { - kind: "dt-ddn_ssd", - param: Param( - "glb-grp", - ), - target: Target( - "testfs-QMT0000", - ), - value: QuotaStats { - kind: Grp, - stats: [ - QuotaStat { - id: 0, - limits: QuotaStatLimits { - hard: 0, - soft: 0, - granted: 0, - time: 604800, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStats( - TargetQuotaStat { - kind: "dt-ddn_ssd", - param: Param( - "glb-prj", - ), - target: Target( - "testfs-QMT0000", - ), - value: QuotaStats { - kind: Grp, - stats: [ - QuotaStat { - id: 0, - limits: QuotaStatLimits { - hard: 0, - soft: 0, - granted: 0, - time: 604800, - }, - }, - QuotaStat { - id: 1337, - limits: QuotaStatLimits { - hard: 0, - soft: 0, - granted: 1024004, - time: 281474976710656, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStats( - TargetQuotaStat { - kind: "dt-ddn_ssd", - param: Param( - "glb-usr", - ), - target: Target( - "testfs-QMT0000", - ), - value: QuotaStats { - kind: Usr, - stats: [ - QuotaStat { - id: 0, - limits: QuotaStatLimits { - hard: 0, - soft: 0, - granted: 0, - time: 604800, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStats( - TargetQuotaStat { - kind: "dt-pool_1", - param: Param( - "glb-grp", - ), - target: Target( - "testfs-QMT0000", - ), - value: QuotaStats { - kind: Grp, - stats: [ - QuotaStat { - id: 0, - limits: QuotaStatLimits { - hard: 0, - soft: 0, - granted: 0, - time: 604800, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStats( - TargetQuotaStat { - kind: "dt-pool_1", - param: Param( - "glb-prj", - ), - target: Target( - "testfs-QMT0000", - ), - value: QuotaStats { - kind: Grp, - stats: [ - QuotaStat { - id: 0, - limits: QuotaStatLimits { - hard: 0, - soft: 0, - granted: 0, - time: 604800, - }, - }, - QuotaStat { - id: 1337, - limits: QuotaStatLimits { - hard: 0, - soft: 0, - granted: 1024004, - time: 281474976710656, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStats( - TargetQuotaStat { - kind: "dt-pool_1", - param: Param( - "glb-usr", - ), - target: Target( - "testfs-QMT0000", - ), - value: QuotaStats { - kind: Usr, - stats: [ - QuotaStat { - id: 0, - limits: QuotaStatLimits { - hard: 0, - soft: 0, - granted: 0, - time: 604800, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStats( - TargetQuotaStat { - kind: "md-0x0", - param: Param( - "glb-grp", - ), - target: Target( - "testfs-QMT0000", - ), - value: QuotaStats { - kind: Grp, - stats: [ - QuotaStat { - id: 0, - limits: QuotaStatLimits { - hard: 0, - soft: 0, - granted: 0, - time: 604800, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStats( - TargetQuotaStat { - kind: "md-0x0", - param: Param( - "glb-prj", - ), - target: Target( - "testfs-QMT0000", - ), - value: QuotaStats { - kind: Grp, - stats: [ - QuotaStat { - id: 0, - limits: QuotaStatLimits { - hard: 0, - soft: 0, - granted: 0, - time: 604800, - }, - }, - QuotaStat { - id: 1337, - limits: QuotaStatLimits { - hard: 11000, - soft: 10000, - granted: 1024, - time: 0, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStats( - TargetQuotaStat { - kind: "md-0x0", - param: Param( - "glb-usr", - ), - target: Target( - "testfs-QMT0000", - ), - value: QuotaStats { - kind: Usr, - stats: [ - QuotaStat { - id: 0, - limits: QuotaStatLimits { - hard: 0, - soft: 0, - granted: 0, - time: 604800, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStatsOsd( - TargetStat { - kind: Mdt, - param: Param( - "quota_slave.acct_group", - ), - target: Target( - "testfs-MDT0000", - ), - value: QuotaStatsOsd { - kind: Grp, - stats: [ - QuotaStatOsd { - id: 0, - usage: QuotaStatUsage { - inodes: 396, - kbytes: 529400, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStatsOsd( - TargetStat { - kind: Mdt, - param: Param( - "quota_slave.acct_project", - ), - target: Target( - "testfs-MDT0000", - ), - value: QuotaStatsOsd { - kind: Prj, - stats: [ - QuotaStatOsd { - id: 0, - usage: QuotaStatUsage { - inodes: 393, - kbytes: 529396, - }, - }, - QuotaStatOsd { - id: 1337, - usage: QuotaStatUsage { - inodes: 3, - kbytes: 4, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStatsOsd( - TargetStat { - kind: Mdt, - param: Param( - "quota_slave.acct_user", - ), - target: Target( - "testfs-MDT0000", - ), - value: QuotaStatsOsd { - kind: Usr, - stats: [ - QuotaStatOsd { - id: 0, - usage: QuotaStatUsage { - inodes: 396, - kbytes: 529400, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStatsOsd( - TargetStat { - kind: Mdt, - param: Param( - "quota_slave.acct_group", - ), - target: Target( - "testfs-MDT0001", - ), - value: QuotaStatsOsd { - kind: Grp, - stats: [ - QuotaStatOsd { - id: 0, - usage: QuotaStatUsage { - inodes: 265, - kbytes: 356672, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStatsOsd( - TargetStat { - kind: Mdt, - param: Param( - "quota_slave.acct_project", - ), - target: Target( - "testfs-MDT0001", - ), - value: QuotaStatsOsd { - kind: Prj, - stats: [ - QuotaStatOsd { - id: 0, - usage: QuotaStatUsage { - inodes: 265, - kbytes: 356672, - }, - }, - ], - }, - }, - ), - ), - Target( - QuotaStatsOsd( - TargetStat { - kind: Mdt, - param: Param( - "quota_slave.acct_user", - ), - target: Target( - "testfs-MDT0001", - ), - value: QuotaStatsOsd { - kind: Usr, - stats: [ - QuotaStatOsd { - id: 0, - usage: QuotaStatUsage { - inodes: 265, - kbytes: 356672, - }, - }, - ], - }, - }, - ), - ), - Target( - ResourceCount( - TargetStat { - kind: Ost, - param: Param( - "resource_count", - ), - target: Target( - "ai400-OST0001", - ), - value: 0, - }, - ), - ), ], "", ) diff --git a/src/snapshots/lustre_collector__parser__tests__params.snap b/src/snapshots/lustre_collector__parser__tests__params.snap index ff27958..85fc903 100644 --- a/src/snapshots/lustre_collector__parser__tests__params.snap +++ b/src/snapshots/lustre_collector__parser__tests__params.snap @@ -15,6 +15,9 @@ expression: params() "osd-*.*.kbytesfree", "osd-*.*.kbytestotal", "osd-*.*.brw_stats", + "osd-*.*.quota_slave.acct_group", + "osd-*.*.quota_slave.acct_user", + "osd-*.*.quota_slave.acct_project", "mdt.*.exports.*.uuid", "mgs.*.mgs.stats", "mgs.*.mgs.threads_max", @@ -35,6 +38,9 @@ expression: params() "mdt.*.job_stats", "mdt.*.md_stats", "mdt.*MDT*.num_exports", + "qmt.*.*.glb-usr", + "qmt.*.*.glb-prj", + "qmt.*.*.glb-grp", "ldlm.namespaces.{mdt-,filter-}*.contended_locks", "ldlm.namespaces.{mdt-,filter-}*.contention_seconds", "ldlm.namespaces.{mdt-,filter-}*.ctime_age_limit",