Internal Stats

Status

Active, Maintained, and In Production

Purpose

Populates ppn_dashboard_dailystats daily, with TotalActiveUsers, TotalTrialUsers and TotalPaidUsers

Technology

Application is a C# .net4.6 console app.

Built with Microsoft Visual Studio Professional 2017 

Source code

Application source code is stored in SVN

Local: http://svn.paltalk.com/svn/ppnsystem/Console/InternalStats

EXE: InternalStats.exe

Deployment Method

Copy and paste from webdeploy

Description

Is a simple wrapper around a stored procedure:

Calls: ppn_Maintenance_NightlyStats

ALTER PROCEDURE [dbo].[ppn_Maintenance_NightlyStats]
AS
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    EXECUTE [ppn_dashboard_SetDailyStats]

END

Which in turn calls: ppn_dashboard_SetDailyStats

ALTER PROCEDURE [dbo].[ppn_dashboard_SetDailyStats] 
AS
BEGIN

    DECLARE @TotalActiveUsers int;
    DECLARE @TotalTrialUsers int;
    DECLARE @TotalPaidUsers int;

    -- ACTIVE OR BILLING FAILED = ACTIVE USER
    select @TotalActiveUsers = count(accountno) 
    from ppn_account acc
    where (brandid = '10003' OR brandid = 2)  and (acc.status = 1 OR acc.status = 71)
    
    -- ACTIVE OR BILLING FAILED = ACTIVE USER
    (select @TotalTrialUsers = count(accountno) 
    from ppn_account acc
    where (brandid = '10003' OR brandid = 2)  and (acc.status = 1 OR acc.status = 71) and trialActive = 1)
    
    (select @TotalPaidUsers = count(accountno) 
    from ppn_account acc
    where (brandid = '10003' OR brandid = 2)  and (acc.status = 1 OR acc.status = 71) and trialActive = 0)
    
    INSERT INTO ppn_dashboard_dailystats (addeddate, addedby, TotalActiveUsers, TotalPaidUsers, TotalTrialUsers) 
        values (getdate(), 'ppn_dashboard_dailystats', @TotalActiveUsers, @TotalPaidUsers, @TotalTrialUsers)

END

Hosted

VM: vumWeb1

Method: Sheduled Task

Name: 'NightlyStats'

When: Daily at 6:00 am

Logging

Logged locally