Beispiel #1
0
 def __init__(self, **options):
     self.backends = {
         "dummy": DummyTSDB(),
         "redis": RedisTSDB(**options.pop("redis", {})),
         "snuba": SnubaTSDB(**options.pop("snuba", {})),
     }
     super(RedisSnubaTSDB, self).__init__(**options)
Beispiel #2
0
 def __init__(self, **options):
     self.backends = {
         'dummy': DummyTSDB(),
         'redis': RedisTSDB(**options.pop('redis', {})),
         'snuba': SnubaTSDB(**options.pop('snuba', {})),
     }
     super(RedisSnubaTSDB, self).__init__(**options)
Beispiel #3
0
    def __init__(self, switchover_timestamp=None, **options):
        """
        A TSDB backend that uses the Snuba outcomes and events datasets as far
        as possible instead of reading/writing to redis. Reading will trigger a
        Snuba query, while writing is a noop as Snuba reads from outcomes.

        Note: Using this backend requires you to start Snuba outcomes consumers
        (not to be confused with the outcomes consumers in Sentry itself).

        :param switchover_timestamp: When set, only start reading from snuba
            after this timestamp (as returned by `time.time()`). When this
            timestamp has not been reached yet, this backend just degrades to
            Redis for *all* keys.

            The default `None` will start reading from Snuba immediately and is
            equivalent to setting a past timestamp.
        """
        self.switchover_timestamp = switchover_timestamp
        self.backends = {
            "dummy": DummyTSDB(),
            "redis": RedisTSDB(**options.pop("redis", {})),
            "snuba": SnubaTSDB(**options.pop("snuba", {})),
        }
        super().__init__(**options)
Beispiel #4
0
 def __init__(self, **options):
     self.dummy = DummyTSDB()
     self.redis = RedisTSDB(**options.pop('redis', {}))
     self.snuba = SnubaTSDB(**options.pop('snuba', {}))
     super(RedisSnubaTSDB, self).__init__(**options)