Exemple #1
0
    def setUp(self):
        super(TestCarbonDatabase, self).setUp()
        self.fake_drivers()
        settings = carbon_conf.Settings()
        settings["BG_CASSANDRA_CONTACT_POINTS"] = "host1,host2"
        settings["BG_CASSANDRA_KEYSPACE"] = self.KEYSPACE
        settings["STORAGE_DIR"] = self.tempdir
        self._plugin = bg_carbon.BigGraphiteDatabase(settings)

        def _create(metric):
            self._plugin.cache.create_metric(metric)

        # Make sure we don't create metrics asynchronously
        self._plugin._createAsyncOrig = self._plugin._createAsync
        self._plugin._createAsync = _create

        self._plugin.create(
            _TEST_METRIC,
            retentions=[(1, 60)],
            xfilesfactor=0.5,
            aggregation_method="sum",
        )
Exemple #2
0
 def test_empty_settings(self):
     bg_carbon.BigGraphiteDatabase(carbon_conf.Settings())