def store() -> Generator[RealtimeMetricsStore, None, None]:
    store = LazyServiceWrapper(
        RealtimeMetricsStore,
        "sentry.processing.realtime_metrics.redis.RedisRealtimeMetricsStore",
        {
            "cluster": "default",
            "counter_bucket_size": 10,
            "counter_time_window": 120,
            "duration_bucket_size": 10,
            "duration_time_window": 120,
            "backoff_timer": 0,
        },
    )

    old_properties = realtime_metrics.__dict__.copy()
    store.expose(realtime_metrics.__dict__)
    yield store

    # cleanup
    realtime_metrics.__dict__.update(old_properties)
Beispiel #2
0
from django.conf import settings

from sentry.utils.services import LazyServiceWrapper

from .base import Newsletter  # NOQA

backend = LazyServiceWrapper(Newsletter, settings.SENTRY_NEWSLETTER,
                             settings.SENTRY_NEWSLETTER_OPTIONS)
backend.expose(locals())
Beispiel #3
0
from __future__ import absolute_import

from django.conf import settings

from sentry.utils.services import LazyServiceWrapper

from .base import TagStorage, TagKeyStatus  # NOQA
from .exceptions import *  # NOQA

backend = LazyServiceWrapper(
    TagStorage, settings.SENTRY_TAGSTORE, settings.SENTRY_TAGSTORE_OPTIONS
)
backend.expose(locals())