Getting started
What’s NewRoadmapOcteth Training ProgramInstallation & Setup
RequirementsArchitectureServer SetupOempro InstallationCommunity Edition InstallSSL CertificatesVersion UpgradeTroubleshootingVideo Tutorials
Video TutorialsAdministration
Quick WalkthroughSecuritySub Admin AccountsSettingsDelivery ServersGlobal SegmentsGlobal Custom FieldsBounce ProcessingSpam ComplaintsSuppression ListPlug-InsDelivery ReportUser ManagementMaintenanceAudience Management
IntroductionSubscriber ListsCustom FieldsSegmentsSubscribersWebhooksWebsite Event TrackingEmail Marketing
IntroductionAuto RespondersEmail CampaignsSender Domain Man.Journeys (Automation)Bounce ProcessingEmail PersonalizationFBL ProcessingEmail Builder IntegrationsEmail DeliverabilitySender Domain ManagementPlug-Ins & Add-Ons
AI Plug-InRSS Plug-InBounce Catcher Add-OnLink Proxy Add-OnDevelopers
IntroductionSingle Sign OnAPIPlug-In DevelopmentDatabaseAdvanced
Reverse ProxyCookbookHelp
TroubleshootingContact UsUser Stats Historical Data Population
You can get aggregated user stats for a time frame using User.Stats API endpoint. To prevent any performance issues, this API command is powered by an advanced caching mechanism. In order to populate the caching with historical data (optional), you may follow these steps:
Purpose of the Command
The stats:populate-user-aggregated-stats
command is designed to populate the oempro_user_aggregated_stats
table with hourly aggregated statistical data for each user.
Command Syntax
php artisan stats:populate-user-aggregated-stats {--startDate=} {--endDate=}
Important: This command must be executed inside oempro_system
container. Therefore, you can run it with docker exec -ti oempro_system bash -c "<insert-command-here>"
Options
-startDate=
: The start date for aggregating statistics. The date format should be recognizable by Carbon (e.g.,2024-04-01
,2024-04-01 12:00
,2024-04
).-endDate=
: The end date for aggregating statistics. The date format is similar to-startDate
.
If these options are not provided, the command defaults to processing statistics for the last day.
Usage Examples
- Aggregate for the Last Day (Default):
- Aggregate for a Specific Period:
- Aggregate for a Month:
php artisan stats:populate-user-aggregated-stats
php artisan stats:populate-user-aggregated-stats --startDate="2024-04-01 00:00:00" --endDate="2024-04-02 23:59:59"
php artisan stats:populate-user-aggregated-stats --startDate="2024-04-01" --endDate="2024-04-30"
Command Features
- Locking Mechanism: The command uses a locking mechanism via Redis to prevent multiple instances from running simultaneously. If the command is already running, you will receive the message
The command is already running.
- Integration with Redis: For the current hour, the command considers data from Redis using
StatsCacheHandler
. After successfully aggregating the data for the current hour, the Redis cache for that period is cleared to avoid duplicate counting. - Logs and Messages: During execution, the command outputs progress information about processing users and periods. The
.
symbol indicates the processing of a period, whilesignifies the presence of non-zero values for metrics.
Verifying the Results
After running the command, you can check the oempro_user_aggregated_stats
table in the oempro
database to ensure that aggregated statistical data has been populated correctly.