Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
RDruon committed Jul 18, 2023
1 parent 417ec13 commit c7ff72f
Show file tree
Hide file tree
Showing 7 changed files with 708 additions and 714 deletions.
163 changes: 81 additions & 82 deletions src/fixtures/valid/valid.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
[email protected]=
52cb8dca-ba5c-4725-9cff-41cd0d45e3e7
ai400-MDT0000-lwp-OST0000_UUID
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions src/osd_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ pub(crate) fn params() -> Vec<String> {
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}"),
]
}

Expand Down
7 changes: 4 additions & 3 deletions src/oss/job_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use crate::types::{JobStatOst, JobStatsOst};
use combine::{
attempt,
attempt, eof,
error::{ParseError, StreamError},
optional,
parser::{
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ pub fn params() -> Vec<String> {
.chain(mgs_parser::params())
.chain(oss::params())
.chain(mds_parser::params())
.chain(ldlm::params())
.chain(quota::params())
.chain(ldlm::params())
.collect()
}

Expand All @@ -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())
}
Expand Down
12 changes: 7 additions & 5 deletions src/quota/quota_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -51,9 +51,10 @@ where
optional(newline()), // If quota stats are present, the whole yaml blob will be on a newline
many::<Vec<_>, _, _>(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::<Vec<QuotaStat>>(&x).map_err(StreamErrorFor::<I>::other)
})
Expand All @@ -68,9 +69,10 @@ where
optional(newline()), // If quota stats are present, the whole yaml blob will be on a newline
many::<Vec<_>, _, _>(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::<Vec<QuotaStatOsd>>(&x).map_err(StreamErrorFor::<I>::other)
})
Expand Down
Loading

0 comments on commit c7ff72f

Please sign in to comment.