AccountStat

AccountStat is a model used to represent the statistics of all views within all of an account's streams. It details the number of viewers that began or stopped watching one of the account user's streams, active viewers and also the number of published streams.

One thing to note here is that AccountStat data is aggregated via the stat period. These stat periods are five minute intervals and so the values shown in one of the AccountStat models represents the data within the stat period.

FieldDescription
accountIdThe account ID of the user
fromThe start date of the stat period
toThe end date of the stat period
activeThe number of active viewers at the end of the stat period
numStartedThe number of viewers that began watching within the stat period
numEndedThe number of viewers that stopped watching within the stat period
streamsThe number of published streams at the end of the stat period

Example

An example of how a query with this model can be made, finding account-wide views within two days.

{
    accountStatFindMany (filter: { 
        _operators: { 
            from: { 
                gt: "10/10/2022"
            }
        },
        AND: {
            _operators: {
                to: {
                    lt: "12/10/2022"
                }
            }
        }
    }){
        accountId
        from,
        to,
        active,
        numStarted,
        numEnded,
        streams
    }
}