[MM-16871] Remove bots from "Daily Active Users" and "Monthly… (#11658)

* Add model.UserCountOptions to analyticsActiveCount method
Add new test for analyticsActiveCount method

* Add ability to delete entries from status store, by calling SQl
directly.  There is no method available to delete entries from the
status store interace

* Instead of cleaning up after a test by passing userIds, just delete all
records in the status table and start fresh

* Remove Comment
Этот коммит содержится в:
jfrerich
2019-07-19 13:30:59 -05:00
коммит произвёл GitHub
родитель b2706507e6
Коммит fdde7c8287
7 изменённых файлов: 98 добавлений и 20 удалений

Просмотреть файл

@@ -93,14 +93,14 @@ func (a *App) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *mo
dailyActiveChan := make(chan store.StoreResult, 1)
go func() {
dailyActive, err := a.Srv.Store.User().AnalyticsActiveCount(DAY_MILLISECONDS)
dailyActive, err := a.Srv.Store.User().AnalyticsActiveCount(DAY_MILLISECONDS, model.UserCountOptions{IncludeBotAccounts: false})
dailyActiveChan <- store.StoreResult{Data: dailyActive, Err: err}
close(dailyActiveChan)
}()
monthlyActiveChan := make(chan store.StoreResult, 1)
go func() {
monthlyActive, err := a.Srv.Store.User().AnalyticsActiveCount(MONTH_MILLISECONDS)
monthlyActive, err := a.Srv.Store.User().AnalyticsActiveCount(MONTH_MILLISECONDS, model.UserCountOptions{IncludeBotAccounts: false})
monthlyActiveChan <- store.StoreResult{Data: monthlyActive, Err: err}
close(monthlyActiveChan)
}()