Octeth Training Center
Octeth Training Center
User Stats Historical Data Population

User Stats Historical Data Population

Getting started

What’s NewWhat’s NewRoadmapRoadmapOcteth Training ProgramOcteth Training Program

Installation & Setup

RequirementsRequirementsArchitectureArchitectureServer SetupServer SetupOempro InstallationOempro InstallationCommunity Edition InstallCommunity Edition InstallSSL CertificatesSSL CertificatesVersion UpgradeVersion UpgradeTroubleshootingTroubleshooting

Video Tutorials

Video TutorialsVideo Tutorials

Administration

Quick WalkthroughQuick WalkthroughSecuritySecuritySub Admin AccountsSub Admin AccountsSettingsSettingsDelivery ServersDelivery ServersGlobal SegmentsGlobal SegmentsGlobal Custom FieldsGlobal Custom FieldsBounce ProcessingBounce ProcessingSpam ComplaintsSpam ComplaintsSuppression ListSuppression ListPlug-InsPlug-InsDelivery ReportDelivery ReportUser ManagementUser ManagementMaintenanceMaintenance

Audience Management

IntroductionIntroductionSubscriber ListsSubscriber ListsCustom FieldsCustom FieldsSegmentsSegmentsSubscribersSubscribersWebhooksWebhooksWebsite Event TrackingWebsite Event Tracking

Email Marketing

IntroductionIntroductionAuto RespondersAuto RespondersEmail CampaignsEmail CampaignsSender Domain Man.Sender Domain Man.Journeys (Automation)Journeys (Automation)Bounce ProcessingBounce ProcessingEmail PersonalizationEmail PersonalizationFBL ProcessingFBL ProcessingEmail Builder IntegrationsEmail Builder IntegrationsEmail DeliverabilityEmail DeliverabilitySender Domain ManagementSender Domain Management

Plug-Ins & Add-Ons

AI Plug-InAI Plug-InRSS Plug-InRSS Plug-InBounce Catcher Add-OnBounce Catcher Add-OnLink Proxy Add-OnLink Proxy Add-On

Developers

IntroductionIntroductionSingle Sign OnSingle Sign OnAPIAPIPlug-In DevelopmentPlug-In DevelopmentDatabaseDatabase

Advanced

Reverse ProxyReverse ProxyCookbookCookbook

Help

TroubleshootingTroubleshootingContact UsContact Us

User 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-012024-04-01 12:002024-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

  1. Aggregate for the Last Day (Default):
  2. php artisan stats:populate-user-aggregated-stats
  3. Aggregate for a Specific Period:
  4. php artisan stats:populate-user-aggregated-stats --startDate="2024-04-01 00:00:00" --endDate="2024-04-02 23:59:59"
  5. Aggregate for a Month:
  6. 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, while  signifies 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.

On this page

  • User Stats Historical Data Population
  • Purpose of the Command
  • Command Syntax
  • Options
  • Usage Examples
  • Command Features
  • Verifying the Results
💠
image

Homepage Customer Area Community Portal Contact Us

Footer Social Icons

©Copyright Octeth, Inc. All rights reserved.