10
10
import pandas as pd
11
11
from darshan import DarshanReport # type: ignore
12
12
import drishti .includes .parser as parser
13
+ import drishti .includes .config as config
13
14
14
15
15
16
class ModuleType (str , Enum ):
@@ -272,6 +273,8 @@ class DarshanFile:
272
273
_posix_read_random : Optional [int ] = None
273
274
_posix_write_random : Optional [int ] = None
274
275
276
+ _posix_long_metadata_count : Optional [int ] = None
277
+
275
278
access_pattern : Optional [AccessPatternStats ] = None
276
279
277
280
# Use separate classes for shared operations
@@ -640,4 +643,12 @@ def posix_write_random(self) -> int:
640
643
posix_df = self .report .records [ModuleType .POSIX ].to_df ()
641
644
posix_counters = posix_df ["counters" ]
642
645
self ._posix_write_random = self .io_stats .get_module_ops (ModuleType .POSIX , "write" ) - self .posix_write_consecutive - self .posix_write_sequential
643
- return self ._posix_write_random
646
+ return self ._posix_write_random
647
+
648
+ @cached_property
649
+ def posix_long_metadata_count (self ) -> int :
650
+ if self ._posix_long_metadata_count is None :
651
+ posix_df = self .report .records [ModuleType .POSIX ].to_df ()
652
+ posix_long_metadata_rows = posix_df ['fcounters' ][(posix_df ['fcounters' ]['POSIX_F_META_TIME' ] > config .thresholds ['metadata_time_rank' ][0 ])]
653
+ self ._posix_long_metadata_count = len (posix_long_metadata_rows )
654
+ return self ._posix_long_metadata_count
0 commit comments