Exemplo n.º 1
0
class GitoramaStats(Plugin):
    name = 'gitorama'
    host = 'localhost'
    port = 6379

    def __init__(self):
        super(GitoramaStats, self).__init__()
        self._db = None
        self.stats = Stats(self.get_redis)

    def get_redis(self):
        if self._db is None:
            self._db = redis.StrictRedis(
                host=self.host,
                port=self.port,
            )
        return self._db

    def on_read(self):
        values = self.stats.get_all_values()
        for key, value in values.items():
            self.dispatch_value(key, value, 'gauge')
Exemplo n.º 2
0
class GitoramaStats(Plugin):
    name = 'gitorama'
    host = 'localhost'
    port = 6379

    def __init__(self):
        super(GitoramaStats, self).__init__()
        self._db = None
        self.stats = Stats(self.get_redis)

    def get_redis(self):
        if self._db is None:
            self._db = redis.StrictRedis(
                host=self.host,
                port=self.port,
            )
        return self._db

    def on_read(self):
        values = self.stats.get_all_values()
        for key, value in values.items():
            self.dispatch_value(key, value, 'gauge')
Exemplo n.º 3
0
 def __init__(self):
     super(GitoramaStats, self).__init__()
     self._db = None
     self.stats = Stats(self.get_redis)
Exemplo n.º 4
0
 def __init__(self):
     super(GitoramaStats, self).__init__()
     self._db = None
     self.stats = Stats(self.get_redis)