OpenTSDB/tcollector — pull request #168 by lanusau (2014-08-06 17:14:54+00:00)
Title: NUMA stat files have to be opened/closed each time to get fresh stats

Originally in this collector, each NUMA stat file is opened and file descriptor saved in the list (function *open_sysfs_numa_stats*) and files are never closed. For each collection interval, in *print_numa_stats*, collector would do *numafile.seek(0)* and re-read stats. However, at least on our CentOS 5.10 system, this would just print the same numbers over and over for the lifetime of the collector, even while from a different shell we could verify numbers rapidly increasing in NUMA stat files.
The change is to rename *open_sysfs_numa_stats* to *find_sysfs_numa_stats* and instead of returning a list of file descriptors return list of file names. Then each file is opened, scanned and closed in each invocation of *print_numa_stats*.
NUMA stat files seem to be world readable (verified on CentOS 5.10 and 6.5) so I don't see the reason to open files first before *drop_privileges* is called.