zulip/zerver
Mateusz Mandera 9406bfbc0a analytics: Store realm disk space used as a CountStat.
Fixes #29632.

The issue description explains this well:

We currently recalculate `currently_used_upload_space_bytes` every file
upload, by dint of calling `flush_used_upload_space_cache`  on
save/delete, and then immediately calling
`user_profile.realm.currently_used_upload_space_bytes()` in
`notify_attachment_update`.  Since this walks the Attachments table,
recalculating this can take seconds in large realms.

Switch this to using a CountStat, so we don't need to walk significant
chunks of the Attachment table when we upload an attachment.  This will
also give us a historical daily graph of usage.
2024-05-09 10:54:44 -07:00
..
actions groups: Allow setting anonymous group to settings while editing. 2024-05-08 18:20:14 -07:00
data_import help: Rename and redirect set-default-streams-for-new-users for channel. 2024-05-03 13:02:20 -07:00
integration_fixtures/nagios
lib retention: Add .restored_timestamp to ArchiveTransaction. 2024-05-09 10:54:44 -07:00
management export: Create REALM_EXPORTED audit log for exports via shell. 2024-05-08 16:16:37 -07:00
migrations models: Add (realm, create_time) index for the Attachment table. 2024-05-09 10:54:44 -07:00
models analytics: Store realm disk space used as a CountStat. 2024-05-09 10:54:44 -07:00
openapi groups: Allow setting anonymous group to settings while editing. 2024-05-08 18:20:14 -07:00
tests analytics: Store realm disk space used as a CountStat. 2024-05-09 10:54:44 -07:00
tornado requirements: Upgrade Python requirements. 2024-05-06 12:56:30 -07:00
transaction_tests user_groups: Create NamedUserGroup objects when creating new groups. 2024-04-26 17:03:09 -07:00
views groups: Allow setting anonymous group to settings while editing. 2024-05-08 18:20:14 -07:00
webhooks webhooks: Rename remaining stream references to channel. 2024-05-06 09:07:57 -07:00
worker missedmessage_emails: Backoff the background worker retries. 2024-05-06 12:50:27 -07:00
__init__.py
apps.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
context_processors.py realm: Add an alias `realm_url` and deprecate `realm_uri` in the API. 2024-05-08 17:39:15 -07:00
decorator.py test_decorators: Replace some deleted tests. 2024-03-29 09:39:34 -07:00
filters.py mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
forms.py models: Replace realm.uri with realm.url. 2024-05-08 11:12:43 -07:00
logging_handlers.py error_notify: Remove custom email error reporting handler. 2023-07-20 11:00:09 -07:00
middleware.py models: Replace realm.uri with realm.url. 2024-05-08 11:12:43 -07:00
signals.py ruff: Fix UP036 Version block is outdated for minimum Python version. 2024-04-01 18:32:52 -07:00