#1391 closed defect (fixed)

The tahoe_files munin plugins reports an incorrect file count

Reported by: francois Owned by: francois
Priority: minor Milestone: 1.9.0
Component: contrib Version: 1.8.2
Keywords: munin tahoe_files reviewed Cc: francois@…
Launchpad Bug:

Description

This plugin currently incorrectly reports the number of files located under basedir/storage/shares instead of the number of files located inside each sub-directories.

The current code is:

 for nodename, basedir in nodedirs:
   files = len(os.listdir(os.path.join(basedir, "storage", "shares")))
   if os.path.exists(os.path.join(basedir, "storage", "shares", "incoming")):
       files -= 1 # the 'incoming' directory doesn't count
   print "%s.value %d" % (nodename, files)

Attachments (2)

tahoe_files-filecount.darcsdiff (37.0 KB) - added by francois at 2011-04-13T08:44:20Z.
tahoe_files-filecount-v2.darcsdiff (37.1 KB) - added by francois at 2011-04-13T21:18:10Z.

Download all attachments as: .zip

Change History (7)

Changed at 2011-04-13T08:44:20Z by francois

comment:1 Changed at 2011-04-13T08:44:43Z by francois

  • Keywords review-needed added

comment:2 follow-up: Changed at 2011-04-13T12:10:48Z by davidsarah

  • Keywords reviewed added; review-needed removed

"if dirpath == root:" should be "if dirpath == root and "incoming" in dirnames:". Otherwise +1.

comment:3 in reply to: ↑ 2 Changed at 2011-04-13T21:17:47Z by francois

Replying to davidsarah:

"if dirpath == root:" should be "if dirpath == root and "incoming" in dirnames:". Otherwise +1.

Ok, your proposed change looks safer even though I don't know if the incoming could be missing from a regular Tahoe node directory structure? Please find an updated patch below.

Changed at 2011-04-13T21:18:10Z by francois

comment:4 Changed at 2011-04-23T01:45:44Z by davidsarah

Looks good.

comment:5 Changed at 2011-04-28T05:53:23Z by francois@…

  • Resolution set to fixed
  • Status changed from new to closed

In 58af7c8f69f60d37:

(The changeset message doesn't reference this ticket)

Note: See TracTickets for help on using tickets.