python-discord / bot-core

A collection of tools and utilities used throughout our discord bot projects.
https://bot-core.pythondiscord.com/
MIT License
15 stars 9 forks source link

Makes statsd optional #47

Open ChrisLovering opened 2 years ago

ChrisLovering commented 2 years ago

In #42 we tried to make statsd optional while adding it, however the way we attempted to do so made it so that editors wouldn't detect that the async statsd client inherited methods from stats client base.

wookie184 commented 2 years ago

If we want to make statsd an optional dependency we shouldn't expose StatsClientBase directly (or by inheriting from it). Instead we should create a wrapper class (e.g. an ABC), with one implementation that uses statsd, and have a separate implementation (that doesn't do anything) for when statsd is not installed.