def __init__(self, settings={}):
        """
        Initializes a new Statsite server instance. All configuration
        must be done during instantiate. If configuration changes in the
        future, a new statsite class must be created.
        """
        super(Statsite, self).__init__()

        # Deep merge the default settings with the given settings
        self.settings = deep_merge(self.DEFAULT_SETTINGS, settings)

        # Resolve the classes for each component
        for component in ["aggregator", "collector", "store"]:
            key   = "_%s_cls" % component
            value = resolve_class_string(self.settings[component]["class"])

            # Delete the class from the settings, since the settings are also
            # used for initialization, and components don't expect "class"
            # kwarg.
            del self.settings[component]["class"]

            # Set the attribute on ourself for use everywhere else
            setattr(self, key, value)

        # Setup the logger
        self.logger = logging.getLogger("statsite.statsite")
        self.logger.info(BANNER % {
                "version": __version__,
                "collector_cls": self._collector_cls,
                "aggregator_cls": self._aggregator_cls,
                "store_cls": self._store_cls,
                "configuration": pprint.pformat(self.settings, width=60, indent=2)
        })

        # Setup the store
        self.logger.debug("Initializing metrics store: %s" % self._store_cls)
        self.store = self._store_cls(**self.settings["store"])

        # Setup the aggregator, provide the store
        self.settings["aggregator"]["metrics_store"] = self.store
        self.logger.debug("Initializing aggregator: %s" % self._aggregator_cls)
        self.aggregator = self._create_aggregator()

        # Setup the collector, provide the aggregator
        self.settings["collector"]["aggregator"] = self.aggregator
        self.logger.debug("Initializing collector: %s" % self._collector_cls)
        self.collector = self._collector_cls(**self.settings["collector"])

        # Setup defaults
        self.aliveness_check = None
        self.timer = None
dataset/ETHPy150Open kiip/statsite/statsite/statsite.py/Statsite.__init__/original