Skip to content

Commit

Permalink
dashboards: Add debug logging for when connecting to postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed May 17, 2024
1 parent 507ff46 commit a0ec8ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion locust_plugins/listeners/timescale.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# See timescale_listener_ex.py for documentation
from contextlib import contextmanager
from locust.exception import CatchResponseError # need to do this first to make sure monkey patching is done
import json
Expand Down Expand Up @@ -143,6 +142,9 @@ def on_test_start(self, environment: locust.env.Environment):
self._user_count_logger = gevent.spawn(self._log_user_count)

def _dbconn(self) -> psycopg2.extensions.connection:
logging.debug(
f"Connecting to Postgres ({self.env.parsed_options.pguser}@{self.env.parsed_options.pghost}:{self.env.parsed_options.pgport or 5432})"
)
try:
conn = psycopg2.connect(
host=self.env.parsed_options.pghost,
Expand Down

0 comments on commit a0ec8ff

Please sign in to comment.