def METHOD_NAME(self, event, force):
    now = time.time()
    if (now - self.last_proc > self.min_seconds) or force:
        for filename, output, handler in self.proc_files:
            with open(os.path.join('/proc', filename), 'rb') as input:
                data = input.read()
                if handler:
                    reduced = handler(now, data)
                else:
                    reduced = (now, data)
                if reduced:
                    if isinstance(reduced[1], bytes):
                        # Use as it is.
                        data = reduced[1]
                    else:
                        # Convert to a single line.
                        data = (' '.join([str(x) for x in reduced[1]]) + '\n').encode('ascii')
                    # Unbuffered raw write, less overhead and useful
                    # in case that we end up with concurrent writes.
                    os.write(output.fileno(),
                             ('%.0f\n' % reduced[0]).encode('ascii') +
                             data +
                             b'\n')
        self.last_proc = now
    if isinstance(event, bb.event.MonitorDiskEvent) and \
       ((now - self.last_disk_monitor > self.min_seconds) or force):
        os.write(self.monitor_disk.fileno(),
                 ('%.0f\n' % now).encode('ascii') +
                 ''.join(['%s: %d\n' % (dev, METHOD_NAME.total_bytes - METHOD_NAME.free_bytes)
                          for dev, METHOD_NAME in event.disk_usage.items()]).encode('ascii') +
                 b'\n')
        self.last_disk_monitor = now