The user lookup endpoint previously used a linear scan over the user list,
which degraded performance under high concurrency. This change replaces
the search algorithm with a binary search on the sorted user ID array,
reducing average lookup time from O(n) to O(log n). The user list is
maintained in sorted order via insertion sort on new user registration.
Implement a new aggregation pipeline in the statistics module that groups export events by month and user ID, enabling generation of monthly activity reports for the admin dashboard. The pipeline filters events from the last 12 months, computes per-user export counts, and stores results in a dedicated statistics collection.
Implement a new aggregation pipeline in the statistics module that groups export events by month and user ID, enabling generation of monthly activity reports for administrators. The change includes a new `getMonthlyExportStats` function that queries the exports collection with a date range filter and returns aggregated counts per user.
Implement a new aggregation pipeline in the statistics module that groups export events by month and user ID, computing total exports per user per month. The change introduces a `getMonthlyExportStats` function that queries the exports collection with a $match stage filtering on the last 12 months, followed by $group on year-month and userId, and a $sort stage for chronological ordering. This enables the dashboard to display per-user export volume trends over time.
- Implemented a new statistics module to track export operations
- Added counters for total exports, unique users, and export types
- Integrated statistics logging into the existing export handler
Adds a new BotManager class that maintains a mutable list of active bots, allowing bots to be added or removed at runtime without restarting the application. Includes thread-safe operations for concurrent access and a new API endpoint to query the current bot roster.
The algorithm analyzes user interaction patterns to identify anomalous behavior, flagging accounts with irregular login times, rapid-fire actions, or unusual data access sequences. It integrates with the existing monitoring pipeline to generate alerts for security review.
The polling interval for the metrics collection service has been adjusted from 30 seconds to 60 seconds to reduce system load and network traffic while maintaining adequate monitoring granularity.
Implement a new aggregation pipeline that computes total export volume per month, grouped by product category and destination region. The change introduces a `monthly_export_stats` collection updated via a scheduled cron job, with indexes on `year_month` and `category` for efficient querying. The statistics module now exposes a `/api/stats/exports/monthly` endpoint returning paginated results sorted by descending volume.
- Implemented a new statistics module to record and monitor export operations
- Added tracking for export timestamps, file sizes, and user identifiers
- Updated export handler to log each completed export with relevant metadata
Implement a new export statistics module that records and aggregates metrics for user data export operations, including timestamps, file sizes, and export types. This enables monitoring of export frequency and data volume across the platform.
The export statistics module now includes a new monthly aggregation function that calculates user activity metrics such as total exports, unique users, and average export size per month. This data is stored in a dedicated statistics table and exposed via a new API endpoint for the admin dashboard.
Implement a new aggregation pipeline in the statistics module that groups export events by month and user ID, enabling generation of monthly activity reports for the admin dashboard. The change includes a new `getMonthlyExportStats` function that queries the exports collection with a date range filter and returns aggregated counts per user.
The previous thread pool implementation caused GIL contention under heavy CPU workloads. This change swaps concurrent.futures.ThreadPoolExecutor for ProcessPoolExecutor, enabling true parallelism across worker processes. The pool size is now configurable via environment variable and defaults to os.cpu_count(). Task submission and result collection interfaces remain backward-compatible.
The profiles table previously lacked an index on the user_id column, causing slow query performance when filtering by user. This change adds a B-tree index on user_id to optimize read operations in the user profile retrieval endpoint.