MCPcopy Create free account
hub / github.com/Flagsmith/flagsmith / influxdb

Function influxdb

api/tests/integration/conftest.py:44–64  ·  view source on GitHub ↗
(settings: SettingsWrapper)

Source from the content-addressed store, hash-verified

42
43@pytest.fixture()
44def influxdb(settings: SettingsWrapper) -> InfluxDBClient:
45 settings.INFLUXDB_BUCKET = "api_usage"
46 settings.INFLUXDB_URL = "http://localhost:8086"
47 settings.INFLUXDB_ORG = "flagsmith"
48 settings.INFLUXDB_TOKEN = "admin-token"
49
50 # Matches api.app_analytics.influxdb_wrapper bucket definitions
51 client = InfluxDBWrapper.get_client()
52 bucket_api = client.buckets_api()
53 bucket_names = [
54 "api_usage_downsampled_15m",
55 "api_usage_downsampled_1h",
56 ]
57 for bucket_name in bucket_names:
58 if not bucket_api.find_bucket_by_name(bucket_name): # type: ignore[no-untyped-call]
59 bucket_api.create_bucket(
60 org="flagsmith",
61 bucket_name=bucket_name,
62 )
63
64 return client
65
66
67@pytest.fixture()

Callers

nothing calls this directly

Calls 1

get_clientMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…