Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-21228

lfs find --report: statistics about what a search finds

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • None
    • 3
    • 9223372036854775807

      Add --report to lfs find, so that any search can describe what it finds instead of (or as well as) listing it: counts, histograms of file size, allocated space, space beyond the size, directory entries, name length, links and the age of each time, and the largest directories by entries and by bytes. The output is one YAML document in the style of job_stats, readable as it stands and parsed by any YAML parser.

      It works on every kind of search:

      • a target scan (-device, target, fsname, -local), which reports both what it read (scanned) and what the options matched (matched); a sweep reads its OSTs first, so each file's allocated space is the sum of its objects;
      • a client walk, which stats each size the MDT did not return, or takes lazy SOM with --lazy.
      lfs find --device /dev/sdb --report                  # report saved, path on stderr
      lfs find --fsname testfs -size +1G --report=big.yaml  # one file for the filesystem
      lfs find /mnt/testfs/proj -user bob --report=-        # YAML on stdout
      

      -report[=FILE] is an action, as -fprint is in find(1); no-report, report-format=yaml and -report-memory=SIZE go with it. llapi_find_report() gives programs the same report; with LU-21206 this public interface may become internal, reached through llapi_find() and struct find_param.

      Asked for by Andreas Dilger after the lfu-stats prototype (github.com/scopedog/lfu-stats). Still to agree: a report saved by default on every target scan, repeated --device, and merging reports from separate runs.

            hnishida Hiroshi Nishida
            hnishida Hiroshi Nishida
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: