MM-43082: Added new telemetry values for groups. (#19918)

Этот коммит содержится в:
mkraft
2022-04-08 11:25:40 -04:00
коммит произвёл GitHub
родитель 1418828443
Коммит 0e4b0b6939
8 изменённых файлов: 96 добавлений и 0 удалений

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

@@ -1106,6 +1106,16 @@ func (ts *TelemetryService) trackGroups() {
mlog.Debug("Could not get group_count", mlog.Err(err))
}
ldapGroupCount, err := ts.dbStore.Group().GroupCountBySource(model.GroupSourceLdap)
if err != nil {
mlog.Debug("Could not get group_count", mlog.Err(err))
}
customGroupCount, err := ts.dbStore.Group().GroupCountBySource(model.GroupSourceCustom)
if err != nil {
mlog.Debug("Could not get group_count", mlog.Err(err))
}
groupTeamCount, err := ts.dbStore.Group().GroupTeamCount()
if err != nil {
mlog.Debug("Could not get group_team_count", mlog.Err(err))
@@ -1143,6 +1153,8 @@ func (ts *TelemetryService) trackGroups() {
ts.SendTelemetry(TrackGroups, map[string]interface{}{
"group_count": groupCount,
"ldap_group_count": ldapGroupCount,
"custom_group_count": customGroupCount,
"group_team_count": groupTeamCount,
"group_channel_count": groupChannelCount,
"group_synced_team_count": groupSyncedTeamCount,

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

@@ -130,6 +130,8 @@ func initializeMocks(cfg *model.Config) (*mocks.ServerIface, *storeMocks.Store,
groupStore.On("GroupMemberCount").Return(int64(32), nil)
groupStore.On("DistinctGroupMemberCount").Return(int64(22), nil)
groupStore.On("GroupCountWithAllowReference").Return(int64(13), nil)
groupStore.On("GroupCountBySource", model.GroupSourceCustom).Return(int64(10), nil)
groupStore.On("GroupCountBySource", model.GroupSourceLdap).Return(int64(2), nil)
schemeStore := storeMocks.SchemeStore{}
schemeStore.On("CountByScope", "channel").Return(int64(8), nil)