Skip to content

Conversation

@inqrphl
Copy link
Contributor

@inqrphl inqrphl commented Jan 22, 2026

fix the sum of file sizes metric by inserting it as 'total_size' instead of 'size'. This fixes the problem where that condition collides with the file attribute 'size'. Three 5mb files would in total take up 15mb space, triggering a critical='size > 10mb' condition

fix checkData if a pattern is used. we use the standard library walkDir function is used to add every directory, but files are checked and skipped if a pattern is present and file does not match it. this can lead to directories that dont have any matching files under them. add a function to trim them, and call it if a pattern is specified.

add argument 'calculate-subdirectory-sizes'. the traversal functions add directories with size "0", and only adds the files with their true size. this argument enables calculating the subdirectory function sizes and adding them as an attibute. implements the addSubdirectorySizes function

add attribute "check_path". if user specified multiple search paths, each one of them add files/directories to the same listData. It is unclear which search paths traversal led to the entry being added. add that as an attribute.

add search path metrics. by default, total_size is calculated from all files added to listData. add a new metric for each search path, it calculates the size sum of file sizes found for that search path. uses the "check_path" attribute.

add subdir metrics. this will add metrics with the name "fullname size" , just like it does for the files "filename size" . currently it is toggled only if subdirectory sizes are calculated and a pattern is specified.

Ahmet Oeztuerk added 3 commits January 21, 2026 11:28
fix the sum of file sizes metric by inserting it as 'total_size' instead
of 'size'. This fixes the problem where that condition collides with the
file attribute 'size'. Three 5mb files would in total take up 15mb
space, triggering a critical='size > 10mb' condition

fix checkData if a pattern is used. we use the standard library walkDir
function is used to add every directory, but files are checked and
skipped if a pattern is present and file does not match it. this can
lead to directories that dont have any matching files under them. add a
function to trim them, and call it if a pattern is specified.

add argument 'calculate-subdirectory-sizes'. the traversal functions add
directories with size "0", and only add the files with their true size.
this argument enables calculating the subdirectory function sizes and
adding them as an attibute. implements the addSubdirectorySizes function

add attribute "check_path". if user specified multiple search paths,
each one of them add files/directories to the same listData. It is
unclear which search paths traversal led to the entry being added. add
that as an attribute.

add search path metrics. by default, total_size is calculated from all
files added to listData. add a new metric for each search path,  it
calculates the size sum of file sizes found for that search path. uses
the "check_path" attribute.

add subdir metrics. this will add metrics with the name "fullname size"
, just like it does for the files "filename size" . currently it is
toggled only if subdirectory sizes are calculated and a pattern is
specified.
@sni
Copy link
Contributor

sni commented Jan 22, 2026

Looks good, could you maybe add 1-2 test cases to pin the current behavior?

@sni sni merged commit 54c13d3 into main Jan 26, 2026
133 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants