-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added gufi_stats -c direntries-log2-bins #139
Conversation
scripts/gufi_stats
Outdated
['dirsize-log2-bins', dirsize_log2_bins], | ||
['dirsize-log1024-bins', dirsize_log1024_bins], | ||
['filesize-log2-bins', filesize_log2_bins], | ||
['filesize-log1024-bins', filesize_log1024_bins], | ||
['direntries-log2-bins', direntries_log2_bins], | ||
['direntries-log1024-bins', direntries_log1024_bins], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
group the dir*
stuff together and in the order that they appear as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, I'll just get rid of dirsize.
scripts/gufi_stats
Outdated
@@ -1016,10 +1016,13 @@ def size_bins(args, base, type): # pylint: disable=redefined-builtin | |||
pinode_create = ['{0} INTEGER'.format(pinode_col)] if args.recursive else [] | |||
pinode = [pinode_col] if args.recursive else [] | |||
|
|||
# use log and power to put things into bins. Note that 0 must be handled specially because 2^0 is 1. Also 1 needs to be handled specially because log(N,1) is 0 but it shouldn't be included with 0 | |||
# so this will return items of size zero in a 0 bin and will return items of size 1 in the next bin | |||
# use ceil so that 3 and 4 go into the 4 bin and 5 6 7 8 go into the 8 bin, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which bin ends do we want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a preference. I'll back this out and test with your zero-fix.
scripts/gufi_stats
Outdated
def direntries_log2_bins(_config, args, _where): | ||
return size_bins(args, 2, 'd', 'totfiles') | ||
|
||
def direntries_log1024_bins(_config, args, _where): | ||
return size_bins(args, 1024, 'd', 'totfiles') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe rename to dirfilecount_*
since you are pulling totfiles
and not totfiles + totlinks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can add multiple functions:
- dirfilecount for just files
- dirlinkcount for just links
Cannot do direntrycount bec need totsubdirs. I'll submit an Issue asking for totsubdirs.
scripts/gufi_stats
Outdated
@@ -993,7 +993,7 @@ def uid_size(_config, args, where): | |||
def gid_size(_config, args, where): | |||
return uidgid_size(args, 'gid', where) | |||
|
|||
def size_bins(args, base, type): # pylint: disable=redefined-builtin | |||
def size_bins(args, base, type, field='size'): # pylint: disable=redefined-builtin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets not have default arguments. the only other place there are default arguments is build_where
, and they arent even used
scripts/gufi_stats
Outdated
def dirsize_log2_bins(_config, args, _where): | ||
return size_bins(args, 2, 'd') | ||
|
||
def dirsize_log1024_bins(_config, args, _where): | ||
return size_bins(args, 1024, 'd') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does dirsize tell us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will remove
Also need to update docs and tests. Follow what was done here: |
As discussed, I'll also change 'bits' to 'exponent' as the variable name. |
Added direntries and dirsize cumulative queries into gufi_stats following the logic of the newly added filesize. Also made 0 and 1 size items show in the 0 and 2 bins respectively. Changed floor to ceil so that 5 shows in the 8 bit and not the 4 bin which follows more consistently with the logical handling of 0, 1, 2, 3, 4, etc.
I tested it with the super simple bash script attached.
test.sh.txt
The output is as follows: