def __init__(self, bindaddr, sinkspecs, interval, percent, debug=0,
                 key_prefix=''):
        _, host, port = parse_addr(bindaddr)
        if port is None:
            self.exit(E_BADADDR % bindaddr)
        self._bindaddr = (host, port)

        # TODO: generalize to support more than one sink type.  currently
        # only the graphite backend is present, but we may want to write
        # stats to hbase, redis, etc. - ph

        # construct the sink and add hosts to it
        if not sinkspecs:
            self.exit(E_NOSINKS)
        self._sink = sink.GraphiteSink()
        errors = []
        for spec in sinkspecs:
            try:
                self._sink.add(spec)
            except __HOLE__, ex:
                errors.append(ex)
        if errors:
            for err in errors:
                self.error(str(err))
            self.exit('exiting.')

        self._percent = float(percent)
        self._interval = float(interval)
        self._debug = debug
        self._sock = None
        self._flush_task = None
        self._key_prefix = key_prefix

        self._reset_stats()
dataset/ETHPy150Open phensley/gstatsd/gstatsd/service.py/StatsDaemon.__init__