|
|
|
|
@@ -552,6 +552,22 @@ func (s *TimerLayerChannelStore) ClearCaches() {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerChannelStore) CountPostsAfter(channelId string, timestamp int64, userId string) (int, *model.AppError) {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
resultVar0, resultVar1 := s.ChannelStore.CountPostsAfter(channelId, timestamp, userId)
|
|
|
|
|
|
|
|
|
|
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
|
|
|
|
|
if s.Root.Metrics != nil {
|
|
|
|
|
success := "false"
|
|
|
|
|
if resultVar1 == nil {
|
|
|
|
|
success = "true"
|
|
|
|
|
}
|
|
|
|
|
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.CountPostsAfter", success, elapsed)
|
|
|
|
|
}
|
|
|
|
|
return resultVar0, resultVar1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerChannelStore) CreateDirectChannel(userId *model.User, otherUserId *model.User) (*model.Channel, *model.AppError) {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
@@ -1560,6 +1576,22 @@ func (s *TimerLayerChannelStore) SearchAllChannels(term string, opts ChannelSear
|
|
|
|
|
return resultVar0, resultVar1, resultVar2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerChannelStore) SearchArchivedInTeam(teamId string, term string, userId string) (*model.ChannelList, *model.AppError) {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
resultVar0, resultVar1 := s.ChannelStore.SearchArchivedInTeam(teamId, term, userId)
|
|
|
|
|
|
|
|
|
|
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
|
|
|
|
|
if s.Root.Metrics != nil {
|
|
|
|
|
success := "false"
|
|
|
|
|
if resultVar1 == nil {
|
|
|
|
|
success = "true"
|
|
|
|
|
}
|
|
|
|
|
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.SearchArchivedInTeam", success, elapsed)
|
|
|
|
|
}
|
|
|
|
|
return resultVar0, resultVar1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerChannelStore) SearchForUserInTeam(userId string, teamId string, term string, includeDeleted bool) (*model.ChannelList, *model.AppError) {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
@@ -1672,6 +1704,22 @@ func (s *TimerLayerChannelStore) UpdateLastViewedAt(channelIds []string, userId
|
|
|
|
|
return resultVar0, resultVar1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerChannelStore) UpdateLastViewedAtPost(unreadPost *model.Post, userID string, mentionCount int) (*model.ChannelUnreadAt, *model.AppError) {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
resultVar0, resultVar1 := s.ChannelStore.UpdateLastViewedAtPost(unreadPost, userID, mentionCount)
|
|
|
|
|
|
|
|
|
|
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
|
|
|
|
|
if s.Root.Metrics != nil {
|
|
|
|
|
success := "false"
|
|
|
|
|
if resultVar1 == nil {
|
|
|
|
|
success = "true"
|
|
|
|
|
}
|
|
|
|
|
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.UpdateLastViewedAtPost", success, elapsed)
|
|
|
|
|
}
|
|
|
|
|
return resultVar0, resultVar1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerChannelStore) UpdateMember(member *model.ChannelMember) (*model.ChannelMember, *model.AppError) {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
@@ -2733,14 +2781,13 @@ func (s *TimerLayerGroupStore) GetByName(name string) (*model.Group, *model.AppE
|
|
|
|
|
|
|
|
|
|
resultVar0, resultVar1 := s.GroupStore.GetByName(name)
|
|
|
|
|
|
|
|
|
|
t := timemodule.Now()
|
|
|
|
|
elapsed := t.Sub(start)
|
|
|
|
|
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
|
|
|
|
|
if s.Root.Metrics != nil {
|
|
|
|
|
success := "false"
|
|
|
|
|
if resultVar1 == nil {
|
|
|
|
|
success = "true"
|
|
|
|
|
}
|
|
|
|
|
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetByName", success, float64(elapsed))
|
|
|
|
|
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetByName", success, elapsed)
|
|
|
|
|
}
|
|
|
|
|
return resultVar0, resultVar1
|
|
|
|
|
}
|
|
|
|
|
@@ -2766,14 +2813,13 @@ func (s *TimerLayerGroupStore) GetByUser(userId string) ([]*model.Group, *model.
|
|
|
|
|
|
|
|
|
|
resultVar0, resultVar1 := s.GroupStore.GetByUser(userId)
|
|
|
|
|
|
|
|
|
|
t := timemodule.Now()
|
|
|
|
|
elapsed := t.Sub(start)
|
|
|
|
|
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
|
|
|
|
|
if s.Root.Metrics != nil {
|
|
|
|
|
success := "false"
|
|
|
|
|
if resultVar1 == nil {
|
|
|
|
|
success = "true"
|
|
|
|
|
}
|
|
|
|
|
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetByUser", success, float64(elapsed))
|
|
|
|
|
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.GetByUser", success, elapsed)
|
|
|
|
|
}
|
|
|
|
|
return resultVar0, resultVar1
|
|
|
|
|
}
|
|
|
|
|
@@ -2890,6 +2936,22 @@ func (s *TimerLayerGroupStore) GetMemberUsersPage(groupID string, page int, perP
|
|
|
|
|
return resultVar0, resultVar1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerGroupStore) PermanentDeleteMembersByUser(userId string) *model.AppError {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
resultVar0 := s.GroupStore.PermanentDeleteMembersByUser(userId)
|
|
|
|
|
|
|
|
|
|
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
|
|
|
|
|
if s.Root.Metrics != nil {
|
|
|
|
|
success := "false"
|
|
|
|
|
if resultVar0 == nil {
|
|
|
|
|
success = "true"
|
|
|
|
|
}
|
|
|
|
|
s.Root.Metrics.ObserveStoreMethodDuration("GroupStore.PermanentDeleteMembersByUser", success, elapsed)
|
|
|
|
|
}
|
|
|
|
|
return resultVar0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerGroupStore) TeamMembersMinusGroupMembers(teamID string, groupIDs []string, page int, perPage int) ([]*model.UserWithGroups, *model.AppError) {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
@@ -3674,6 +3736,22 @@ func (s *TimerLayerPluginStore) SaveOrUpdate(keyVal *model.PluginKeyValue) (*mod
|
|
|
|
|
return resultVar0, resultVar1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerPluginStore) SetWithOptions(pluginId string, key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError) {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
resultVar0, resultVar1 := s.PluginStore.SetWithOptions(pluginId, key, value, options)
|
|
|
|
|
|
|
|
|
|
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
|
|
|
|
|
if s.Root.Metrics != nil {
|
|
|
|
|
success := "false"
|
|
|
|
|
if resultVar1 == nil {
|
|
|
|
|
success = "true"
|
|
|
|
|
}
|
|
|
|
|
s.Root.Metrics.ObserveStoreMethodDuration("PluginStore.SetWithOptions", success, elapsed)
|
|
|
|
|
}
|
|
|
|
|
return resultVar0, resultVar1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerPostStore) AnalyticsPostCount(teamId string, mustHaveFile bool, mustHaveHashtag bool) (int64, *model.AppError) {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
@@ -5706,6 +5784,22 @@ func (s *TimerLayerTeamStore) SearchAll(term string) ([]*model.Team, *model.AppE
|
|
|
|
|
return resultVar0, resultVar1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerTeamStore) SearchAllPaged(term string, page int, perPage int) ([]*model.Team, int64, *model.AppError) {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
resultVar0, resultVar1, resultVar2 := s.TeamStore.SearchAllPaged(term, page, perPage)
|
|
|
|
|
|
|
|
|
|
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
|
|
|
|
|
if s.Root.Metrics != nil {
|
|
|
|
|
success := "false"
|
|
|
|
|
if resultVar2 == nil {
|
|
|
|
|
success = "true"
|
|
|
|
|
}
|
|
|
|
|
s.Root.Metrics.ObserveStoreMethodDuration("TeamStore.SearchAllPaged", success, elapsed)
|
|
|
|
|
}
|
|
|
|
|
return resultVar0, resultVar1, resultVar2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerTeamStore) SearchOpen(term string) ([]*model.Team, *model.AppError) {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
@@ -6026,6 +6120,22 @@ func (s *TimerLayerUserStore) Count(options model.UserCountOptions) (int64, *mod
|
|
|
|
|
return resultVar0, resultVar1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerUserStore) DeactivateGuests() ([]string, *model.AppError) {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
resultVar0, resultVar1 := s.UserStore.DeactivateGuests()
|
|
|
|
|
|
|
|
|
|
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
|
|
|
|
|
if s.Root.Metrics != nil {
|
|
|
|
|
success := "false"
|
|
|
|
|
if resultVar1 == nil {
|
|
|
|
|
success = "true"
|
|
|
|
|
}
|
|
|
|
|
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.DeactivateGuests", success, elapsed)
|
|
|
|
|
}
|
|
|
|
|
return resultVar0, resultVar1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerUserStore) DemoteUserToGuest(userID string) *model.AppError {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
@@ -6498,7 +6608,7 @@ func (s *TimerLayerUserStore) GetUnreadCount(userId string) (int64, *model.AppEr
|
|
|
|
|
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
|
|
|
|
|
if s.Root.Metrics != nil {
|
|
|
|
|
success := "false"
|
|
|
|
|
if true {
|
|
|
|
|
if resultVar1 == nil {
|
|
|
|
|
success = "true"
|
|
|
|
|
}
|
|
|
|
|
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetUnreadCount", success, elapsed)
|
|
|
|
|
@@ -6554,10 +6664,10 @@ func (s *TimerLayerUserStore) InferSystemInstallDate() (int64, *model.AppError)
|
|
|
|
|
return resultVar0, resultVar1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *TimerLayerUserStore) InvalidatProfileCacheForUser(userId string) {
|
|
|
|
|
func (s *TimerLayerUserStore) InvalidateProfileCacheForUser(userId string) {
|
|
|
|
|
start := timemodule.Now()
|
|
|
|
|
|
|
|
|
|
s.UserStore.InvalidatProfileCacheForUser(userId)
|
|
|
|
|
s.UserStore.InvalidateProfileCacheForUser(userId)
|
|
|
|
|
|
|
|
|
|
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
|
|
|
|
|
if s.Root.Metrics != nil {
|
|
|
|
|
@@ -6565,7 +6675,7 @@ func (s *TimerLayerUserStore) InvalidatProfileCacheForUser(userId string) {
|
|
|
|
|
if true {
|
|
|
|
|
success = "true"
|
|
|
|
|
}
|
|
|
|
|
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.InvalidatProfileCacheForUser", success, elapsed)
|
|
|
|
|
s.Root.Metrics.ObserveStoreMethodDuration("UserStore.InvalidateProfileCacheForUser", success, elapsed)
|
|
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|