コード例 #1
0
ファイル: main.py プロジェクト: bloglovin/salt-metrics
    def setUp(self):
        log.info('MainTest#setUp: start')

        # NOTE: I don't understand what weird pythonic bullshit
        # neccessitates this, but it is needed for using timeout
        # decorator
        self.__name__ = 'MainTest'

        # setup collector instance with enough options to be
        # able to successfully instantiate
        try:
            self.collector

        except:
            log.info('MainTest#setup: exception')
            self.collector = collector({
                '__role': 'master',
                'transport': 'zeromq',
                'sock_dir': '/tmp',
                'pki_dir': '/etc/salt/pki',
                'metrics': {
                    'update_interval': self.UPDATE_INTERVAL,
                    'saved_path': '/tmp/salt_metrics.json',
                    'persistence': True,
                    'decorator': 'prometheus'
                }
            })
コード例 #2
0
ファイル: main.py プロジェクト: bloglovin/salt-metrics
    def setUp(self):
        log.info("MainTest#setUp: start")

        # NOTE: I don't understand what weird pythonic bullshit
        # neccessitates this, but it is needed for using timeout
        # decorator
        self.__name__ = "MainTest"

        # setup collector instance with enough options to be
        # able to successfully instantiate
        try:
            self.collector

        except:
            log.info("MainTest#setup: exception")
            self.collector = collector(
                {
                    "__role": "master",
                    "transport": "zeromq",
                    "sock_dir": "/tmp",
                    "pki_dir": "/etc/salt/pki",
                    "metrics": {
                        "update_interval": self.UPDATE_INTERVAL,
                        "saved_path": "/tmp/salt_metrics.json",
                        "persistence": True,
                        "decorator": "prometheus",
                    },
                }
            )
コード例 #3
0
ファイル: main.py プロジェクト: bloglovin/salt-metrics
 def test_run(self):
     log.info('MainTest#test_run: start')
     self.collector.run()
コード例 #4
0
ファイル: main.py プロジェクト: bloglovin/salt-metrics
 def test_collector(self):
     '''Ensure collector is correct instance type
 '''
     log.info('MainTest#test_collector: start')
     self.assertEqual(type(self.collector),
                      saltmetrics.collectors.DecoratedMetricsCollector)
コード例 #5
0
ファイル: main.py プロジェクト: bloglovin/salt-metrics
 def test_run(self):
     log.info("MainTest#test_run: start")
     self.collector.run()
コード例 #6
0
ファイル: main.py プロジェクト: bloglovin/salt-metrics
 def test_collector(self):
     """Ensure collector is correct instance type
 """
     log.info("MainTest#test_collector: start")
     self.assertEqual(type(self.collector), saltmetrics.collectors.DecoratedMetricsCollector)