# Path: collectors/lib/utils.py
# PY3 = sys.version_info[0] > 2
# USER = "nobody"
# def drop_privileges(user=USER):
# def is_sockfile(path):
# def err(msg):
#     def is_numeric(value):
#     def is_numeric(value):


import copy
import os
import re
import sys
import time
from collectors.lib import utils

    if os.path.exists(filename):
      with open(filename, "r") as f:
        sector_size = int(f.readline())
    else:
      # hmmm?
      sector_size = 512;  # best guess
    cached_device_sector_size[device_name] = sector_size
  return cached_device_sector_size[device_name]


def main():
  """iostats main loop."""
  init_stats = {
    "read_requests": 0,
    "read_merged": 0,
    "read_sectors": 0,
    "msec_read": 0,
    "write_requests": 0,
    "write_merged": 0,
    "write_sectors": 0,
    "msec_write": 0,
    "ios_in_progress": 0,
    "msec_total": 0,
    "msec_weighted_total": 0,
  }
  prev_stats = dict()
  f_diskstats = open("/proc/diskstats")
  HZ = get_system_hz()
  itv = 1.0

# Path: collectors/lib/utils.py
# PY3 = sys.version_info[0] > 2
# USER = "nobody"
# def drop_privileges(user=USER):
# def is_sockfile(path):
# def err(msg):
#     def is_numeric(value):
#     def is_numeric(value):


# Path: collectors/0/iostat.py
import copy
import os
import re
import sys
import time
from collectors.lib import utils


    if os.path.exists(filename):
      with open(filename, "r") as f:
        sector_size = int(f.readline())
    else:
      # hmmm?
      sector_size = 512;  # best guess
    cached_device_sector_size[device_name] = sector_size
  return cached_device_sector_size[device_name]


def main():
  """iostats main loop."""
  init_stats = {
    "read_requests": 0,
    "read_merged": 0,
    "read_sectors": 0,
    "msec_read": 0,
    "write_requests": 0,
    "write_merged": 0,
    "write_sectors": 0,
    "msec_write": 0,
    "ios_in_progress": 0,
    "msec_total": 0,
    "msec_weighted_total": 0,
  }
  prev_stats = dict()
  f_diskstats = open("/proc/diskstats")
  HZ = get_system_hz()
  itv = 1.0

  utils.drop_privileges()