zulip/analytics/tests
Mahhheshh 1198785c62 analytics: Improve do_increment_logging_stat performance.
The previous implementation using Django's `get_or_create` for
`do_increment_logging_stat` involved two separate database queries,
potentially leading to race conditions.

Use an `ON CONFLICT ... DO UPDATE` (aka "upsert") query, which
eliminates race conditions and improves performance.  This is mildly
complicated due to the different unique indexes across the various
tables, and the need for bug-for-bug compatibility with the previous
implementation.

Fixes #28947.

Co-authored-by: Alex Vandiver <alexmv@zulip.com>
2024-05-06 16:34:01 -07:00
..
__init__.py
test_counts.py analytics: Improve do_increment_logging_stat performance. 2024-05-06 16:34:01 -07:00
test_fixtures.py tests: Consistently use assert_length helper. 2021-05-19 11:55:56 -07:00
test_stats_views.py streams: Update translated errors for stream to channel rename. 2024-04-24 14:35:05 -07:00