github.com/vnforks/kid/v5@v5.22.1-0.20200408055009-b89d99c65676/store/timer_layer.go (about) 1 // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. 2 // See LICENSE.txt for license information. 3 4 // Code generated by "make store-layers" 5 // DO NOT EDIT 6 7 package store 8 9 import ( 10 "context" 11 timemodule "time" 12 13 "github.com/vnforks/kid/v5/einterfaces" 14 "github.com/vnforks/kid/v5/model" 15 ) 16 17 type TimerLayer struct { 18 Store 19 Metrics einterfaces.MetricsInterface 20 AuditStore AuditStore 21 BranchStore BranchStore 22 ClassStore ClassStore 23 ClusterDiscoveryStore ClusterDiscoveryStore 24 CommandStore CommandStore 25 CommandWebhookStore CommandWebhookStore 26 ComplianceStore ComplianceStore 27 EmojiStore EmojiStore 28 FileInfoStore FileInfoStore 29 JobStore JobStore 30 LicenseStore LicenseStore 31 LinkMetadataStore LinkMetadataStore 32 OAuthStore OAuthStore 33 PostStore PostStore 34 PreferenceStore PreferenceStore 35 ReactionStore ReactionStore 36 RoleStore RoleStore 37 SchemeStore SchemeStore 38 SessionStore SessionStore 39 StatusStore StatusStore 40 SystemStore SystemStore 41 TermsOfServiceStore TermsOfServiceStore 42 TokenStore TokenStore 43 UserStore UserStore 44 UserAccessTokenStore UserAccessTokenStore 45 UserTermsOfServiceStore UserTermsOfServiceStore 46 WebhookStore WebhookStore 47 } 48 49 func (s *TimerLayer) Audit() AuditStore { 50 return s.AuditStore 51 } 52 53 func (s *TimerLayer) Branch() BranchStore { 54 return s.BranchStore 55 } 56 57 func (s *TimerLayer) Class() ClassStore { 58 return s.ClassStore 59 } 60 61 func (s *TimerLayer) ClusterDiscovery() ClusterDiscoveryStore { 62 return s.ClusterDiscoveryStore 63 } 64 65 func (s *TimerLayer) Command() CommandStore { 66 return s.CommandStore 67 } 68 69 func (s *TimerLayer) CommandWebhook() CommandWebhookStore { 70 return s.CommandWebhookStore 71 } 72 73 func (s *TimerLayer) Compliance() ComplianceStore { 74 return s.ComplianceStore 75 } 76 77 func (s *TimerLayer) Emoji() EmojiStore { 78 return s.EmojiStore 79 } 80 81 func (s *TimerLayer) FileInfo() FileInfoStore { 82 return s.FileInfoStore 83 } 84 85 func (s *TimerLayer) Job() JobStore { 86 return s.JobStore 87 } 88 89 func (s *TimerLayer) License() LicenseStore { 90 return s.LicenseStore 91 } 92 93 func (s *TimerLayer) LinkMetadata() LinkMetadataStore { 94 return s.LinkMetadataStore 95 } 96 97 func (s *TimerLayer) OAuth() OAuthStore { 98 return s.OAuthStore 99 } 100 101 func (s *TimerLayer) Post() PostStore { 102 return s.PostStore 103 } 104 105 func (s *TimerLayer) Preference() PreferenceStore { 106 return s.PreferenceStore 107 } 108 109 func (s *TimerLayer) Reaction() ReactionStore { 110 return s.ReactionStore 111 } 112 113 func (s *TimerLayer) Role() RoleStore { 114 return s.RoleStore 115 } 116 117 func (s *TimerLayer) Scheme() SchemeStore { 118 return s.SchemeStore 119 } 120 121 func (s *TimerLayer) Session() SessionStore { 122 return s.SessionStore 123 } 124 125 func (s *TimerLayer) Status() StatusStore { 126 return s.StatusStore 127 } 128 129 func (s *TimerLayer) System() SystemStore { 130 return s.SystemStore 131 } 132 133 func (s *TimerLayer) TermsOfService() TermsOfServiceStore { 134 return s.TermsOfServiceStore 135 } 136 137 func (s *TimerLayer) Token() TokenStore { 138 return s.TokenStore 139 } 140 141 func (s *TimerLayer) User() UserStore { 142 return s.UserStore 143 } 144 145 func (s *TimerLayer) UserAccessToken() UserAccessTokenStore { 146 return s.UserAccessTokenStore 147 } 148 149 func (s *TimerLayer) UserTermsOfService() UserTermsOfServiceStore { 150 return s.UserTermsOfServiceStore 151 } 152 153 func (s *TimerLayer) Webhook() WebhookStore { 154 return s.WebhookStore 155 } 156 157 type TimerLayerAuditStore struct { 158 AuditStore 159 Root *TimerLayer 160 } 161 162 type TimerLayerBranchStore struct { 163 BranchStore 164 Root *TimerLayer 165 } 166 167 type TimerLayerClassStore struct { 168 ClassStore 169 Root *TimerLayer 170 } 171 172 type TimerLayerClusterDiscoveryStore struct { 173 ClusterDiscoveryStore 174 Root *TimerLayer 175 } 176 177 type TimerLayerCommandStore struct { 178 CommandStore 179 Root *TimerLayer 180 } 181 182 type TimerLayerCommandWebhookStore struct { 183 CommandWebhookStore 184 Root *TimerLayer 185 } 186 187 type TimerLayerComplianceStore struct { 188 ComplianceStore 189 Root *TimerLayer 190 } 191 192 type TimerLayerEmojiStore struct { 193 EmojiStore 194 Root *TimerLayer 195 } 196 197 type TimerLayerFileInfoStore struct { 198 FileInfoStore 199 Root *TimerLayer 200 } 201 202 type TimerLayerJobStore struct { 203 JobStore 204 Root *TimerLayer 205 } 206 207 type TimerLayerLicenseStore struct { 208 LicenseStore 209 Root *TimerLayer 210 } 211 212 type TimerLayerLinkMetadataStore struct { 213 LinkMetadataStore 214 Root *TimerLayer 215 } 216 217 type TimerLayerOAuthStore struct { 218 OAuthStore 219 Root *TimerLayer 220 } 221 222 type TimerLayerPostStore struct { 223 PostStore 224 Root *TimerLayer 225 } 226 227 type TimerLayerPreferenceStore struct { 228 PreferenceStore 229 Root *TimerLayer 230 } 231 232 type TimerLayerReactionStore struct { 233 ReactionStore 234 Root *TimerLayer 235 } 236 237 type TimerLayerRoleStore struct { 238 RoleStore 239 Root *TimerLayer 240 } 241 242 type TimerLayerSchemeStore struct { 243 SchemeStore 244 Root *TimerLayer 245 } 246 247 type TimerLayerSessionStore struct { 248 SessionStore 249 Root *TimerLayer 250 } 251 252 type TimerLayerStatusStore struct { 253 StatusStore 254 Root *TimerLayer 255 } 256 257 type TimerLayerSystemStore struct { 258 SystemStore 259 Root *TimerLayer 260 } 261 262 type TimerLayerTermsOfServiceStore struct { 263 TermsOfServiceStore 264 Root *TimerLayer 265 } 266 267 type TimerLayerTokenStore struct { 268 TokenStore 269 Root *TimerLayer 270 } 271 272 type TimerLayerUserStore struct { 273 UserStore 274 Root *TimerLayer 275 } 276 277 type TimerLayerUserAccessTokenStore struct { 278 UserAccessTokenStore 279 Root *TimerLayer 280 } 281 282 type TimerLayerUserTermsOfServiceStore struct { 283 UserTermsOfServiceStore 284 Root *TimerLayer 285 } 286 287 type TimerLayerWebhookStore struct { 288 WebhookStore 289 Root *TimerLayer 290 } 291 292 func (s *TimerLayerAuditStore) Get(user_id string, offset int, limit int) (model.Audits, *model.AppError) { 293 start := timemodule.Now() 294 295 resultVar0, resultVar1 := s.AuditStore.Get(user_id, offset, limit) 296 297 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 298 if s.Root.Metrics != nil { 299 success := "false" 300 if resultVar1 == nil { 301 success = "true" 302 } 303 s.Root.Metrics.ObserveStoreMethodDuration("AuditStore.Get", success, elapsed) 304 } 305 return resultVar0, resultVar1 306 } 307 308 func (s *TimerLayerAuditStore) PermanentDeleteByUser(userId string) *model.AppError { 309 start := timemodule.Now() 310 311 resultVar0 := s.AuditStore.PermanentDeleteByUser(userId) 312 313 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 314 if s.Root.Metrics != nil { 315 success := "false" 316 if resultVar0 == nil { 317 success = "true" 318 } 319 s.Root.Metrics.ObserveStoreMethodDuration("AuditStore.PermanentDeleteByUser", success, elapsed) 320 } 321 return resultVar0 322 } 323 324 func (s *TimerLayerAuditStore) Save(audit *model.Audit) *model.AppError { 325 start := timemodule.Now() 326 327 resultVar0 := s.AuditStore.Save(audit) 328 329 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 330 if s.Root.Metrics != nil { 331 success := "false" 332 if resultVar0 == nil { 333 success = "true" 334 } 335 s.Root.Metrics.ObserveStoreMethodDuration("AuditStore.Save", success, elapsed) 336 } 337 return resultVar0 338 } 339 340 func (s *TimerLayerBranchStore) AnalyticsBranchCount(includeDeleted bool) (int64, *model.AppError) { 341 start := timemodule.Now() 342 343 resultVar0, resultVar1 := s.BranchStore.AnalyticsBranchCount(includeDeleted) 344 345 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 346 if s.Root.Metrics != nil { 347 success := "false" 348 if resultVar1 == nil { 349 success = "true" 350 } 351 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.AnalyticsBranchCount", success, elapsed) 352 } 353 return resultVar0, resultVar1 354 } 355 356 func (s *TimerLayerBranchStore) AnalyticsGetBranchCountForScheme(schemeId string) (int64, *model.AppError) { 357 start := timemodule.Now() 358 359 resultVar0, resultVar1 := s.BranchStore.AnalyticsGetBranchCountForScheme(schemeId) 360 361 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 362 if s.Root.Metrics != nil { 363 success := "false" 364 if resultVar1 == nil { 365 success = "true" 366 } 367 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.AnalyticsGetBranchCountForScheme", success, elapsed) 368 } 369 return resultVar0, resultVar1 370 } 371 372 func (s *TimerLayerBranchStore) ClearAllCustomRoleAssignments() *model.AppError { 373 start := timemodule.Now() 374 375 resultVar0 := s.BranchStore.ClearAllCustomRoleAssignments() 376 377 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 378 if s.Root.Metrics != nil { 379 success := "false" 380 if resultVar0 == nil { 381 success = "true" 382 } 383 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.ClearAllCustomRoleAssignments", success, elapsed) 384 } 385 return resultVar0 386 } 387 388 func (s *TimerLayerBranchStore) ClearCaches() { 389 start := timemodule.Now() 390 391 s.BranchStore.ClearCaches() 392 393 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 394 if s.Root.Metrics != nil { 395 success := "false" 396 if true { 397 success = "true" 398 } 399 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.ClearCaches", success, elapsed) 400 } 401 } 402 403 func (s *TimerLayerBranchStore) Get(id string) (*model.Branch, *model.AppError) { 404 start := timemodule.Now() 405 406 resultVar0, resultVar1 := s.BranchStore.Get(id) 407 408 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 409 if s.Root.Metrics != nil { 410 success := "false" 411 if resultVar1 == nil { 412 success = "true" 413 } 414 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.Get", success, elapsed) 415 } 416 return resultVar0, resultVar1 417 } 418 419 func (s *TimerLayerBranchStore) GetActiveMemberCount(branchId string, restrictions *model.ViewUsersRestrictions) (int64, *model.AppError) { 420 start := timemodule.Now() 421 422 resultVar0, resultVar1 := s.BranchStore.GetActiveMemberCount(branchId, restrictions) 423 424 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 425 if s.Root.Metrics != nil { 426 success := "false" 427 if resultVar1 == nil { 428 success = "true" 429 } 430 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetActiveMemberCount", success, elapsed) 431 } 432 return resultVar0, resultVar1 433 } 434 435 func (s *TimerLayerBranchStore) GetAll() ([]*model.Branch, *model.AppError) { 436 start := timemodule.Now() 437 438 resultVar0, resultVar1 := s.BranchStore.GetAll() 439 440 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 441 if s.Root.Metrics != nil { 442 success := "false" 443 if resultVar1 == nil { 444 success = "true" 445 } 446 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetAll", success, elapsed) 447 } 448 return resultVar0, resultVar1 449 } 450 451 func (s *TimerLayerBranchStore) GetAllForExportAfter(limit int, afterId string) ([]*model.BranchForExport, *model.AppError) { 452 start := timemodule.Now() 453 454 resultVar0, resultVar1 := s.BranchStore.GetAllForExportAfter(limit, afterId) 455 456 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 457 if s.Root.Metrics != nil { 458 success := "false" 459 if resultVar1 == nil { 460 success = "true" 461 } 462 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetAllForExportAfter", success, elapsed) 463 } 464 return resultVar0, resultVar1 465 } 466 467 func (s *TimerLayerBranchStore) GetAllPage(offset int, limit int) ([]*model.Branch, *model.AppError) { 468 start := timemodule.Now() 469 470 resultVar0, resultVar1 := s.BranchStore.GetAllPage(offset, limit) 471 472 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 473 if s.Root.Metrics != nil { 474 success := "false" 475 if resultVar1 == nil { 476 success = "true" 477 } 478 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetAllPage", success, elapsed) 479 } 480 return resultVar0, resultVar1 481 } 482 483 func (s *TimerLayerBranchStore) GetBranchMembersForExport(userId string) ([]*model.BranchMemberForExport, *model.AppError) { 484 start := timemodule.Now() 485 486 resultVar0, resultVar1 := s.BranchStore.GetBranchMembersForExport(userId) 487 488 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 489 if s.Root.Metrics != nil { 490 success := "false" 491 if resultVar1 == nil { 492 success = "true" 493 } 494 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetBranchMembersForExport", success, elapsed) 495 } 496 return resultVar0, resultVar1 497 } 498 499 func (s *TimerLayerBranchStore) GetBranchesByScheme(schemeId string, offset int, limit int) ([]*model.Branch, *model.AppError) { 500 start := timemodule.Now() 501 502 resultVar0, resultVar1 := s.BranchStore.GetBranchesByScheme(schemeId, offset, limit) 503 504 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 505 if s.Root.Metrics != nil { 506 success := "false" 507 if resultVar1 == nil { 508 success = "true" 509 } 510 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetBranchesByScheme", success, elapsed) 511 } 512 return resultVar0, resultVar1 513 } 514 515 func (s *TimerLayerBranchStore) GetBranchesByUserId(userId string) ([]*model.Branch, *model.AppError) { 516 start := timemodule.Now() 517 518 resultVar0, resultVar1 := s.BranchStore.GetBranchesByUserId(userId) 519 520 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 521 if s.Root.Metrics != nil { 522 success := "false" 523 if resultVar1 == nil { 524 success = "true" 525 } 526 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetBranchesByUserId", success, elapsed) 527 } 528 return resultVar0, resultVar1 529 } 530 531 func (s *TimerLayerBranchStore) GetBranchesForUser(userId string) ([]*model.BranchMember, *model.AppError) { 532 start := timemodule.Now() 533 534 resultVar0, resultVar1 := s.BranchStore.GetBranchesForUser(userId) 535 536 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 537 if s.Root.Metrics != nil { 538 success := "false" 539 if resultVar1 == nil { 540 success = "true" 541 } 542 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetBranchesForUser", success, elapsed) 543 } 544 return resultVar0, resultVar1 545 } 546 547 func (s *TimerLayerBranchStore) GetBranchesForUserWithPagination(userId string, page int, perPage int) ([]*model.BranchMember, *model.AppError) { 548 start := timemodule.Now() 549 550 resultVar0, resultVar1 := s.BranchStore.GetBranchesForUserWithPagination(userId, page, perPage) 551 552 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 553 if s.Root.Metrics != nil { 554 success := "false" 555 if resultVar1 == nil { 556 success = "true" 557 } 558 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetBranchesForUserWithPagination", success, elapsed) 559 } 560 return resultVar0, resultVar1 561 } 562 563 func (s *TimerLayerBranchStore) GetByName(name string) (*model.Branch, *model.AppError) { 564 start := timemodule.Now() 565 566 resultVar0, resultVar1 := s.BranchStore.GetByName(name) 567 568 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 569 if s.Root.Metrics != nil { 570 success := "false" 571 if resultVar1 == nil { 572 success = "true" 573 } 574 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetByName", success, elapsed) 575 } 576 return resultVar0, resultVar1 577 } 578 579 func (s *TimerLayerBranchStore) GetByNames(name []string) ([]*model.Branch, *model.AppError) { 580 start := timemodule.Now() 581 582 resultVar0, resultVar1 := s.BranchStore.GetByNames(name) 583 584 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 585 if s.Root.Metrics != nil { 586 success := "false" 587 if resultVar1 == nil { 588 success = "true" 589 } 590 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetByNames", success, elapsed) 591 } 592 return resultVar0, resultVar1 593 } 594 595 func (s *TimerLayerBranchStore) GetBySchoolId(schoolId string) (*model.Branch, *model.AppError) { 596 start := timemodule.Now() 597 598 resultVar0, resultVar1 := s.BranchStore.GetBySchoolId(schoolId) 599 600 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 601 if s.Root.Metrics != nil { 602 success := "false" 603 if resultVar1 == nil { 604 success = "true" 605 } 606 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetBySchoolId", success, elapsed) 607 } 608 return resultVar0, resultVar1 609 } 610 611 func (s *TimerLayerBranchStore) GetMember(branchId string, userId string) (*model.BranchMember, *model.AppError) { 612 start := timemodule.Now() 613 614 resultVar0, resultVar1 := s.BranchStore.GetMember(branchId, userId) 615 616 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 617 if s.Root.Metrics != nil { 618 success := "false" 619 if resultVar1 == nil { 620 success = "true" 621 } 622 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetMember", success, elapsed) 623 } 624 return resultVar0, resultVar1 625 } 626 627 func (s *TimerLayerBranchStore) GetMembers(branchId string, offset int, limit int, branchMembersGetOptions *model.BranchMembersGetOptions) ([]*model.BranchMember, *model.AppError) { 628 start := timemodule.Now() 629 630 resultVar0, resultVar1 := s.BranchStore.GetMembers(branchId, offset, limit, branchMembersGetOptions) 631 632 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 633 if s.Root.Metrics != nil { 634 success := "false" 635 if resultVar1 == nil { 636 success = "true" 637 } 638 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetMembers", success, elapsed) 639 } 640 return resultVar0, resultVar1 641 } 642 643 func (s *TimerLayerBranchStore) GetMembersByIds(branchId string, userIds []string, restrictions *model.ViewUsersRestrictions) ([]*model.BranchMember, *model.AppError) { 644 start := timemodule.Now() 645 646 resultVar0, resultVar1 := s.BranchStore.GetMembersByIds(branchId, userIds, restrictions) 647 648 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 649 if s.Root.Metrics != nil { 650 success := "false" 651 if resultVar1 == nil { 652 success = "true" 653 } 654 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetMembersByIds", success, elapsed) 655 } 656 return resultVar0, resultVar1 657 } 658 659 func (s *TimerLayerBranchStore) GetTotalMemberCount(branchId string, restrictions *model.ViewUsersRestrictions) (int64, *model.AppError) { 660 start := timemodule.Now() 661 662 resultVar0, resultVar1 := s.BranchStore.GetTotalMemberCount(branchId, restrictions) 663 664 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 665 if s.Root.Metrics != nil { 666 success := "false" 667 if resultVar1 == nil { 668 success = "true" 669 } 670 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetTotalMemberCount", success, elapsed) 671 } 672 return resultVar0, resultVar1 673 } 674 675 func (s *TimerLayerBranchStore) GetUserBranchIds(userId string, allowFromCache bool) ([]string, *model.AppError) { 676 start := timemodule.Now() 677 678 resultVar0, resultVar1 := s.BranchStore.GetUserBranchIds(userId, allowFromCache) 679 680 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 681 if s.Root.Metrics != nil { 682 success := "false" 683 if resultVar1 == nil { 684 success = "true" 685 } 686 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.GetUserBranchIds", success, elapsed) 687 } 688 return resultVar0, resultVar1 689 } 690 691 func (s *TimerLayerBranchStore) InvalidateAllBranchIdsForUser(userId string) { 692 start := timemodule.Now() 693 694 s.BranchStore.InvalidateAllBranchIdsForUser(userId) 695 696 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 697 if s.Root.Metrics != nil { 698 success := "false" 699 if true { 700 success = "true" 701 } 702 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.InvalidateAllBranchIdsForUser", success, elapsed) 703 } 704 } 705 706 func (s *TimerLayerBranchStore) MigrateBranchMembers(fromBranchId string, fromUserId string) (map[string]string, *model.AppError) { 707 start := timemodule.Now() 708 709 resultVar0, resultVar1 := s.BranchStore.MigrateBranchMembers(fromBranchId, fromUserId) 710 711 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 712 if s.Root.Metrics != nil { 713 success := "false" 714 if resultVar1 == nil { 715 success = "true" 716 } 717 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.MigrateBranchMembers", success, elapsed) 718 } 719 return resultVar0, resultVar1 720 } 721 722 func (s *TimerLayerBranchStore) PermanentDelete(branchId string) *model.AppError { 723 start := timemodule.Now() 724 725 resultVar0 := s.BranchStore.PermanentDelete(branchId) 726 727 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 728 if s.Root.Metrics != nil { 729 success := "false" 730 if resultVar0 == nil { 731 success = "true" 732 } 733 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.PermanentDelete", success, elapsed) 734 } 735 return resultVar0 736 } 737 738 func (s *TimerLayerBranchStore) RemoveAllMembersByBranch(branchId string) *model.AppError { 739 start := timemodule.Now() 740 741 resultVar0 := s.BranchStore.RemoveAllMembersByBranch(branchId) 742 743 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 744 if s.Root.Metrics != nil { 745 success := "false" 746 if resultVar0 == nil { 747 success = "true" 748 } 749 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.RemoveAllMembersByBranch", success, elapsed) 750 } 751 return resultVar0 752 } 753 754 func (s *TimerLayerBranchStore) RemoveAllMembersByUser(userId string) *model.AppError { 755 start := timemodule.Now() 756 757 resultVar0 := s.BranchStore.RemoveAllMembersByUser(userId) 758 759 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 760 if s.Root.Metrics != nil { 761 success := "false" 762 if resultVar0 == nil { 763 success = "true" 764 } 765 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.RemoveAllMembersByUser", success, elapsed) 766 } 767 return resultVar0 768 } 769 770 func (s *TimerLayerBranchStore) RemoveMember(branchId string, userId string) *model.AppError { 771 start := timemodule.Now() 772 773 resultVar0 := s.BranchStore.RemoveMember(branchId, userId) 774 775 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 776 if s.Root.Metrics != nil { 777 success := "false" 778 if resultVar0 == nil { 779 success = "true" 780 } 781 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.RemoveMember", success, elapsed) 782 } 783 return resultVar0 784 } 785 786 func (s *TimerLayerBranchStore) ResetAllBranchSchemes() *model.AppError { 787 start := timemodule.Now() 788 789 resultVar0 := s.BranchStore.ResetAllBranchSchemes() 790 791 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 792 if s.Root.Metrics != nil { 793 success := "false" 794 if resultVar0 == nil { 795 success = "true" 796 } 797 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.ResetAllBranchSchemes", success, elapsed) 798 } 799 return resultVar0 800 } 801 802 func (s *TimerLayerBranchStore) Save(branch *model.Branch) (*model.Branch, *model.AppError) { 803 start := timemodule.Now() 804 805 resultVar0, resultVar1 := s.BranchStore.Save(branch) 806 807 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 808 if s.Root.Metrics != nil { 809 success := "false" 810 if resultVar1 == nil { 811 success = "true" 812 } 813 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.Save", success, elapsed) 814 } 815 return resultVar0, resultVar1 816 } 817 818 func (s *TimerLayerBranchStore) SaveMember(member *model.BranchMember, maxUsersPerBranch int) (*model.BranchMember, *model.AppError) { 819 start := timemodule.Now() 820 821 resultVar0, resultVar1 := s.BranchStore.SaveMember(member, maxUsersPerBranch) 822 823 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 824 if s.Root.Metrics != nil { 825 success := "false" 826 if resultVar1 == nil { 827 success = "true" 828 } 829 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.SaveMember", success, elapsed) 830 } 831 return resultVar0, resultVar1 832 } 833 834 func (s *TimerLayerBranchStore) Update(branch *model.Branch) (*model.Branch, *model.AppError) { 835 start := timemodule.Now() 836 837 resultVar0, resultVar1 := s.BranchStore.Update(branch) 838 839 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 840 if s.Root.Metrics != nil { 841 success := "false" 842 if resultVar1 == nil { 843 success = "true" 844 } 845 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.Update", success, elapsed) 846 } 847 return resultVar0, resultVar1 848 } 849 850 func (s *TimerLayerBranchStore) UpdateLastBranchIconUpdate(branchId string, curTime int64) *model.AppError { 851 start := timemodule.Now() 852 853 resultVar0 := s.BranchStore.UpdateLastBranchIconUpdate(branchId, curTime) 854 855 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 856 if s.Root.Metrics != nil { 857 success := "false" 858 if resultVar0 == nil { 859 success = "true" 860 } 861 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.UpdateLastBranchIconUpdate", success, elapsed) 862 } 863 return resultVar0 864 } 865 866 func (s *TimerLayerBranchStore) UpdateMember(member *model.BranchMember) (*model.BranchMember, *model.AppError) { 867 start := timemodule.Now() 868 869 resultVar0, resultVar1 := s.BranchStore.UpdateMember(member) 870 871 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 872 if s.Root.Metrics != nil { 873 success := "false" 874 if resultVar1 == nil { 875 success = "true" 876 } 877 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.UpdateMember", success, elapsed) 878 } 879 return resultVar0, resultVar1 880 } 881 882 func (s *TimerLayerBranchStore) UpdateMembersRole(branchID string, userIDs []string) *model.AppError { 883 start := timemodule.Now() 884 885 resultVar0 := s.BranchStore.UpdateMembersRole(branchID, userIDs) 886 887 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 888 if s.Root.Metrics != nil { 889 success := "false" 890 if resultVar0 == nil { 891 success = "true" 892 } 893 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.UpdateMembersRole", success, elapsed) 894 } 895 return resultVar0 896 } 897 898 func (s *TimerLayerBranchStore) UserBelongsToBranches(userId string, branchIds []string) (bool, *model.AppError) { 899 start := timemodule.Now() 900 901 resultVar0, resultVar1 := s.BranchStore.UserBelongsToBranches(userId, branchIds) 902 903 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 904 if s.Root.Metrics != nil { 905 success := "false" 906 if resultVar1 == nil { 907 success = "true" 908 } 909 s.Root.Metrics.ObserveStoreMethodDuration("BranchStore.UserBelongsToBranches", success, elapsed) 910 } 911 return resultVar0, resultVar1 912 } 913 914 func (s *TimerLayerClassStore) ClearAllCustomRoleAssignments() *model.AppError { 915 start := timemodule.Now() 916 917 resultVar0 := s.ClassStore.ClearAllCustomRoleAssignments() 918 919 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 920 if s.Root.Metrics != nil { 921 success := "false" 922 if resultVar0 == nil { 923 success = "true" 924 } 925 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.ClearAllCustomRoleAssignments", success, elapsed) 926 } 927 return resultVar0 928 } 929 930 func (s *TimerLayerClassStore) ClearCaches() { 931 start := timemodule.Now() 932 933 s.ClassStore.ClearCaches() 934 935 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 936 if s.Root.Metrics != nil { 937 success := "false" 938 if true { 939 success = "true" 940 } 941 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.ClearCaches", success, elapsed) 942 } 943 } 944 945 func (s *TimerLayerClassStore) CreateDirectClass(userId *model.User, otherUserId *model.User) (*model.Class, *model.AppError) { 946 start := timemodule.Now() 947 948 resultVar0, resultVar1 := s.ClassStore.CreateDirectClass(userId, otherUserId) 949 950 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 951 if s.Root.Metrics != nil { 952 success := "false" 953 if resultVar1 == nil { 954 success = "true" 955 } 956 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.CreateDirectClass", success, elapsed) 957 } 958 return resultVar0, resultVar1 959 } 960 961 func (s *TimerLayerClassStore) Delete(classId string, time int64) *model.AppError { 962 start := timemodule.Now() 963 964 resultVar0 := s.ClassStore.Delete(classId, time) 965 966 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 967 if s.Root.Metrics != nil { 968 success := "false" 969 if resultVar0 == nil { 970 success = "true" 971 } 972 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.Delete", success, elapsed) 973 } 974 return resultVar0 975 } 976 977 func (s *TimerLayerClassStore) Get(id string, allowFromCache bool) (*model.Class, *model.AppError) { 978 start := timemodule.Now() 979 980 resultVar0, resultVar1 := s.ClassStore.Get(id, allowFromCache) 981 982 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 983 if s.Root.Metrics != nil { 984 success := "false" 985 if resultVar1 == nil { 986 success = "true" 987 } 988 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.Get", success, elapsed) 989 } 990 return resultVar0, resultVar1 991 } 992 993 func (s *TimerLayerClassStore) GetAll(branchId string) ([]*model.Class, *model.AppError) { 994 start := timemodule.Now() 995 996 resultVar0, resultVar1 := s.ClassStore.GetAll(branchId) 997 998 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 999 if s.Root.Metrics != nil { 1000 success := "false" 1001 if resultVar1 == nil { 1002 success = "true" 1003 } 1004 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetAll", success, elapsed) 1005 } 1006 return resultVar0, resultVar1 1007 } 1008 1009 func (s *TimerLayerClassStore) GetAllClassMembersForUser(userId string, allowFromCache bool, includeDeleted bool) (map[string]string, *model.AppError) { 1010 start := timemodule.Now() 1011 1012 resultVar0, resultVar1 := s.ClassStore.GetAllClassMembersForUser(userId, allowFromCache, includeDeleted) 1013 1014 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1015 if s.Root.Metrics != nil { 1016 success := "false" 1017 if resultVar1 == nil { 1018 success = "true" 1019 } 1020 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetAllClassMembersForUser", success, elapsed) 1021 } 1022 return resultVar0, resultVar1 1023 } 1024 1025 func (s *TimerLayerClassStore) GetAllClassMembersNotifyPropsForClass(classId string, allowFromCache bool) (map[string]model.StringMap, *model.AppError) { 1026 start := timemodule.Now() 1027 1028 resultVar0, resultVar1 := s.ClassStore.GetAllClassMembersNotifyPropsForClass(classId, allowFromCache) 1029 1030 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1031 if s.Root.Metrics != nil { 1032 success := "false" 1033 if resultVar1 == nil { 1034 success = "true" 1035 } 1036 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetAllClassMembersNotifyPropsForClass", success, elapsed) 1037 } 1038 return resultVar0, resultVar1 1039 } 1040 1041 func (s *TimerLayerClassStore) GetAllClasses(page int, perPage int, opts ClassSearchOpts) (*model.ClassListWithBranchData, *model.AppError) { 1042 start := timemodule.Now() 1043 1044 resultVar0, resultVar1 := s.ClassStore.GetAllClasses(page, perPage, opts) 1045 1046 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1047 if s.Root.Metrics != nil { 1048 success := "false" 1049 if resultVar1 == nil { 1050 success = "true" 1051 } 1052 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetAllClasses", success, elapsed) 1053 } 1054 return resultVar0, resultVar1 1055 } 1056 1057 func (s *TimerLayerClassStore) GetAllClassesCount(opts ClassSearchOpts) (int64, *model.AppError) { 1058 start := timemodule.Now() 1059 1060 resultVar0, resultVar1 := s.ClassStore.GetAllClassesCount(opts) 1061 1062 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1063 if s.Root.Metrics != nil { 1064 success := "false" 1065 if resultVar1 == nil { 1066 success = "true" 1067 } 1068 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetAllClassesCount", success, elapsed) 1069 } 1070 return resultVar0, resultVar1 1071 } 1072 1073 func (s *TimerLayerClassStore) GetAllClassesForExportAfter(limit int, afterId string) ([]*model.ClassForExport, *model.AppError) { 1074 start := timemodule.Now() 1075 1076 resultVar0, resultVar1 := s.ClassStore.GetAllClassesForExportAfter(limit, afterId) 1077 1078 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1079 if s.Root.Metrics != nil { 1080 success := "false" 1081 if resultVar1 == nil { 1082 success = "true" 1083 } 1084 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetAllClassesForExportAfter", success, elapsed) 1085 } 1086 return resultVar0, resultVar1 1087 } 1088 1089 func (s *TimerLayerClassStore) GetBranchClasses(branchId string) (*model.ClassList, *model.AppError) { 1090 start := timemodule.Now() 1091 1092 resultVar0, resultVar1 := s.ClassStore.GetBranchClasses(branchId) 1093 1094 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1095 if s.Root.Metrics != nil { 1096 success := "false" 1097 if resultVar1 == nil { 1098 success = "true" 1099 } 1100 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetBranchClasses", success, elapsed) 1101 } 1102 return resultVar0, resultVar1 1103 } 1104 1105 func (s *TimerLayerClassStore) GetByName(branch_id string, name string, allowFromCache bool) (*model.Class, *model.AppError) { 1106 start := timemodule.Now() 1107 1108 resultVar0, resultVar1 := s.ClassStore.GetByName(branch_id, name, allowFromCache) 1109 1110 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1111 if s.Root.Metrics != nil { 1112 success := "false" 1113 if resultVar1 == nil { 1114 success = "true" 1115 } 1116 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetByName", success, elapsed) 1117 } 1118 return resultVar0, resultVar1 1119 } 1120 1121 func (s *TimerLayerClassStore) GetByNameIncludeDeleted(branch_id string, name string, allowFromCache bool) (*model.Class, *model.AppError) { 1122 start := timemodule.Now() 1123 1124 resultVar0, resultVar1 := s.ClassStore.GetByNameIncludeDeleted(branch_id, name, allowFromCache) 1125 1126 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1127 if s.Root.Metrics != nil { 1128 success := "false" 1129 if resultVar1 == nil { 1130 success = "true" 1131 } 1132 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetByNameIncludeDeleted", success, elapsed) 1133 } 1134 return resultVar0, resultVar1 1135 } 1136 1137 func (s *TimerLayerClassStore) GetByNames(branch_id string, names []string, allowFromCache bool) ([]*model.Class, *model.AppError) { 1138 start := timemodule.Now() 1139 1140 resultVar0, resultVar1 := s.ClassStore.GetByNames(branch_id, names, allowFromCache) 1141 1142 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1143 if s.Root.Metrics != nil { 1144 success := "false" 1145 if resultVar1 == nil { 1146 success = "true" 1147 } 1148 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetByNames", success, elapsed) 1149 } 1150 return resultVar0, resultVar1 1151 } 1152 1153 func (s *TimerLayerClassStore) GetClassMembersForExport(userId string, branchId string) ([]*model.ClassMemberForExport, *model.AppError) { 1154 start := timemodule.Now() 1155 1156 resultVar0, resultVar1 := s.ClassStore.GetClassMembersForExport(userId, branchId) 1157 1158 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1159 if s.Root.Metrics != nil { 1160 success := "false" 1161 if resultVar1 == nil { 1162 success = "true" 1163 } 1164 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetClassMembersForExport", success, elapsed) 1165 } 1166 return resultVar0, resultVar1 1167 } 1168 1169 func (s *TimerLayerClassStore) GetClassMembersTimezones(classId string) ([]model.StringMap, *model.AppError) { 1170 start := timemodule.Now() 1171 1172 resultVar0, resultVar1 := s.ClassStore.GetClassMembersTimezones(classId) 1173 1174 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1175 if s.Root.Metrics != nil { 1176 success := "false" 1177 if resultVar1 == nil { 1178 success = "true" 1179 } 1180 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetClassMembersTimezones", success, elapsed) 1181 } 1182 return resultVar0, resultVar1 1183 } 1184 1185 func (s *TimerLayerClassStore) GetClasses(branchId string, userId string, includeDeleted bool) (*model.ClassList, *model.AppError) { 1186 start := timemodule.Now() 1187 1188 resultVar0, resultVar1 := s.ClassStore.GetClasses(branchId, userId, includeDeleted) 1189 1190 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1191 if s.Root.Metrics != nil { 1192 success := "false" 1193 if resultVar1 == nil { 1194 success = "true" 1195 } 1196 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetClasses", success, elapsed) 1197 } 1198 return resultVar0, resultVar1 1199 } 1200 1201 func (s *TimerLayerClassStore) GetClassesBatchForIndexing(startTime int64, endTime int64, limit int) ([]*model.Class, *model.AppError) { 1202 start := timemodule.Now() 1203 1204 resultVar0, resultVar1 := s.ClassStore.GetClassesBatchForIndexing(startTime, endTime, limit) 1205 1206 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1207 if s.Root.Metrics != nil { 1208 success := "false" 1209 if resultVar1 == nil { 1210 success = "true" 1211 } 1212 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetClassesBatchForIndexing", success, elapsed) 1213 } 1214 return resultVar0, resultVar1 1215 } 1216 1217 func (s *TimerLayerClassStore) GetClassesByIds(classIds []string, includeDeleted bool) ([]*model.Class, *model.AppError) { 1218 start := timemodule.Now() 1219 1220 resultVar0, resultVar1 := s.ClassStore.GetClassesByIds(classIds, includeDeleted) 1221 1222 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1223 if s.Root.Metrics != nil { 1224 success := "false" 1225 if resultVar1 == nil { 1226 success = "true" 1227 } 1228 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetClassesByIds", success, elapsed) 1229 } 1230 return resultVar0, resultVar1 1231 } 1232 1233 func (s *TimerLayerClassStore) GetClassesByScheme(schemeId string, offset int, limit int) (model.ClassList, *model.AppError) { 1234 start := timemodule.Now() 1235 1236 resultVar0, resultVar1 := s.ClassStore.GetClassesByScheme(schemeId, offset, limit) 1237 1238 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1239 if s.Root.Metrics != nil { 1240 success := "false" 1241 if resultVar1 == nil { 1242 success = "true" 1243 } 1244 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetClassesByScheme", success, elapsed) 1245 } 1246 return resultVar0, resultVar1 1247 } 1248 1249 func (s *TimerLayerClassStore) GetDeleted(branch_id string, offset int, limit int, userId string) (*model.ClassList, *model.AppError) { 1250 start := timemodule.Now() 1251 1252 resultVar0, resultVar1 := s.ClassStore.GetDeleted(branch_id, offset, limit, userId) 1253 1254 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1255 if s.Root.Metrics != nil { 1256 success := "false" 1257 if resultVar1 == nil { 1258 success = "true" 1259 } 1260 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetDeleted", success, elapsed) 1261 } 1262 return resultVar0, resultVar1 1263 } 1264 1265 func (s *TimerLayerClassStore) GetDeletedByName(branch_id string, name string) (*model.Class, *model.AppError) { 1266 start := timemodule.Now() 1267 1268 resultVar0, resultVar1 := s.ClassStore.GetDeletedByName(branch_id, name) 1269 1270 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1271 if s.Root.Metrics != nil { 1272 success := "false" 1273 if resultVar1 == nil { 1274 success = "true" 1275 } 1276 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetDeletedByName", success, elapsed) 1277 } 1278 return resultVar0, resultVar1 1279 } 1280 1281 func (s *TimerLayerClassStore) GetForPost(postId string) (*model.Class, *model.AppError) { 1282 start := timemodule.Now() 1283 1284 resultVar0, resultVar1 := s.ClassStore.GetForPost(postId) 1285 1286 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1287 if s.Root.Metrics != nil { 1288 success := "false" 1289 if resultVar1 == nil { 1290 success = "true" 1291 } 1292 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetForPost", success, elapsed) 1293 } 1294 return resultVar0, resultVar1 1295 } 1296 1297 func (s *TimerLayerClassStore) GetFromMaster(id string) (*model.Class, *model.AppError) { 1298 start := timemodule.Now() 1299 1300 resultVar0, resultVar1 := s.ClassStore.GetFromMaster(id) 1301 1302 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1303 if s.Root.Metrics != nil { 1304 success := "false" 1305 if resultVar1 == nil { 1306 success = "true" 1307 } 1308 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetFromMaster", success, elapsed) 1309 } 1310 return resultVar0, resultVar1 1311 } 1312 1313 func (s *TimerLayerClassStore) GetMember(classId string, userId string) (*model.ClassMember, *model.AppError) { 1314 start := timemodule.Now() 1315 1316 resultVar0, resultVar1 := s.ClassStore.GetMember(classId, userId) 1317 1318 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1319 if s.Root.Metrics != nil { 1320 success := "false" 1321 if resultVar1 == nil { 1322 success = "true" 1323 } 1324 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetMember", success, elapsed) 1325 } 1326 return resultVar0, resultVar1 1327 } 1328 1329 func (s *TimerLayerClassStore) GetMemberCount(classId string, allowFromCache bool) (int64, *model.AppError) { 1330 start := timemodule.Now() 1331 1332 resultVar0, resultVar1 := s.ClassStore.GetMemberCount(classId, allowFromCache) 1333 1334 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1335 if s.Root.Metrics != nil { 1336 success := "false" 1337 if resultVar1 == nil { 1338 success = "true" 1339 } 1340 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetMemberCount", success, elapsed) 1341 } 1342 return resultVar0, resultVar1 1343 } 1344 1345 func (s *TimerLayerClassStore) GetMemberCountFromCache(classId string) int64 { 1346 start := timemodule.Now() 1347 1348 resultVar0 := s.ClassStore.GetMemberCountFromCache(classId) 1349 1350 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1351 if s.Root.Metrics != nil { 1352 success := "false" 1353 if true { 1354 success = "true" 1355 } 1356 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetMemberCountFromCache", success, elapsed) 1357 } 1358 return resultVar0 1359 } 1360 1361 func (s *TimerLayerClassStore) GetMemberForPost(postId string, userId string) (*model.ClassMember, *model.AppError) { 1362 start := timemodule.Now() 1363 1364 resultVar0, resultVar1 := s.ClassStore.GetMemberForPost(postId, userId) 1365 1366 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1367 if s.Root.Metrics != nil { 1368 success := "false" 1369 if resultVar1 == nil { 1370 success = "true" 1371 } 1372 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetMemberForPost", success, elapsed) 1373 } 1374 return resultVar0, resultVar1 1375 } 1376 1377 func (s *TimerLayerClassStore) GetMembers(classId string, offset int, limit int) (*model.ClassMembers, *model.AppError) { 1378 start := timemodule.Now() 1379 1380 resultVar0, resultVar1 := s.ClassStore.GetMembers(classId, offset, limit) 1381 1382 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1383 if s.Root.Metrics != nil { 1384 success := "false" 1385 if resultVar1 == nil { 1386 success = "true" 1387 } 1388 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetMembers", success, elapsed) 1389 } 1390 return resultVar0, resultVar1 1391 } 1392 1393 func (s *TimerLayerClassStore) GetMembersByIds(classId string, userIds []string) (*model.ClassMembers, *model.AppError) { 1394 start := timemodule.Now() 1395 1396 resultVar0, resultVar1 := s.ClassStore.GetMembersByIds(classId, userIds) 1397 1398 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1399 if s.Root.Metrics != nil { 1400 success := "false" 1401 if resultVar1 == nil { 1402 success = "true" 1403 } 1404 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetMembersByIds", success, elapsed) 1405 } 1406 return resultVar0, resultVar1 1407 } 1408 1409 func (s *TimerLayerClassStore) GetMembersForUser(branchId string, userId string) (*model.ClassMembers, *model.AppError) { 1410 start := timemodule.Now() 1411 1412 resultVar0, resultVar1 := s.ClassStore.GetMembersForUser(branchId, userId) 1413 1414 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1415 if s.Root.Metrics != nil { 1416 success := "false" 1417 if resultVar1 == nil { 1418 success = "true" 1419 } 1420 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetMembersForUser", success, elapsed) 1421 } 1422 return resultVar0, resultVar1 1423 } 1424 1425 func (s *TimerLayerClassStore) GetMembersForUserWithPagination(branchId string, userId string, page int, perPage int) (*model.ClassMembers, *model.AppError) { 1426 start := timemodule.Now() 1427 1428 resultVar0, resultVar1 := s.ClassStore.GetMembersForUserWithPagination(branchId, userId, page, perPage) 1429 1430 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1431 if s.Root.Metrics != nil { 1432 success := "false" 1433 if resultVar1 == nil { 1434 success = "true" 1435 } 1436 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetMembersForUserWithPagination", success, elapsed) 1437 } 1438 return resultVar0, resultVar1 1439 } 1440 1441 func (s *TimerLayerClassStore) GetMoreClasses(branchId string, userId string, offset int, limit int) (*model.ClassList, *model.AppError) { 1442 start := timemodule.Now() 1443 1444 resultVar0, resultVar1 := s.ClassStore.GetMoreClasses(branchId, userId, offset, limit) 1445 1446 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1447 if s.Root.Metrics != nil { 1448 success := "false" 1449 if resultVar1 == nil { 1450 success = "true" 1451 } 1452 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.GetMoreClasses", success, elapsed) 1453 } 1454 return resultVar0, resultVar1 1455 } 1456 1457 func (s *TimerLayerClassStore) InvalidateAllClassMembersForUser(userId string) { 1458 start := timemodule.Now() 1459 1460 s.ClassStore.InvalidateAllClassMembersForUser(userId) 1461 1462 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1463 if s.Root.Metrics != nil { 1464 success := "false" 1465 if true { 1466 success = "true" 1467 } 1468 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.InvalidateAllClassMembersForUser", success, elapsed) 1469 } 1470 } 1471 1472 func (s *TimerLayerClassStore) InvalidateCacheForClassMembersNotifyProps(classId string) { 1473 start := timemodule.Now() 1474 1475 s.ClassStore.InvalidateCacheForClassMembersNotifyProps(classId) 1476 1477 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1478 if s.Root.Metrics != nil { 1479 success := "false" 1480 if true { 1481 success = "true" 1482 } 1483 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.InvalidateCacheForClassMembersNotifyProps", success, elapsed) 1484 } 1485 } 1486 1487 func (s *TimerLayerClassStore) InvalidateClass(id string) { 1488 start := timemodule.Now() 1489 1490 s.ClassStore.InvalidateClass(id) 1491 1492 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1493 if s.Root.Metrics != nil { 1494 success := "false" 1495 if true { 1496 success = "true" 1497 } 1498 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.InvalidateClass", success, elapsed) 1499 } 1500 } 1501 1502 func (s *TimerLayerClassStore) InvalidateClassByName(branchId string, name string) { 1503 start := timemodule.Now() 1504 1505 s.ClassStore.InvalidateClassByName(branchId, name) 1506 1507 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1508 if s.Root.Metrics != nil { 1509 success := "false" 1510 if true { 1511 success = "true" 1512 } 1513 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.InvalidateClassByName", success, elapsed) 1514 } 1515 } 1516 1517 func (s *TimerLayerClassStore) InvalidateMemberCount(classId string) { 1518 start := timemodule.Now() 1519 1520 s.ClassStore.InvalidateMemberCount(classId) 1521 1522 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1523 if s.Root.Metrics != nil { 1524 success := "false" 1525 if true { 1526 success = "true" 1527 } 1528 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.InvalidateMemberCount", success, elapsed) 1529 } 1530 } 1531 1532 func (s *TimerLayerClassStore) IsUserInClassUseCache(userId string, classId string) bool { 1533 start := timemodule.Now() 1534 1535 resultVar0 := s.ClassStore.IsUserInClassUseCache(userId, classId) 1536 1537 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1538 if s.Root.Metrics != nil { 1539 success := "false" 1540 if true { 1541 success = "true" 1542 } 1543 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.IsUserInClassUseCache", success, elapsed) 1544 } 1545 return resultVar0 1546 } 1547 1548 func (s *TimerLayerClassStore) MigrateClassMembers(fromClassId string, fromUserId string) (map[string]string, *model.AppError) { 1549 start := timemodule.Now() 1550 1551 resultVar0, resultVar1 := s.ClassStore.MigrateClassMembers(fromClassId, fromUserId) 1552 1553 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1554 if s.Root.Metrics != nil { 1555 success := "false" 1556 if resultVar1 == nil { 1557 success = "true" 1558 } 1559 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.MigrateClassMembers", success, elapsed) 1560 } 1561 return resultVar0, resultVar1 1562 } 1563 1564 func (s *TimerLayerClassStore) PermanentDelete(classId string) *model.AppError { 1565 start := timemodule.Now() 1566 1567 resultVar0 := s.ClassStore.PermanentDelete(classId) 1568 1569 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1570 if s.Root.Metrics != nil { 1571 success := "false" 1572 if resultVar0 == nil { 1573 success = "true" 1574 } 1575 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.PermanentDelete", success, elapsed) 1576 } 1577 return resultVar0 1578 } 1579 1580 func (s *TimerLayerClassStore) PermanentDeleteByBranch(branchId string) *model.AppError { 1581 start := timemodule.Now() 1582 1583 resultVar0 := s.ClassStore.PermanentDeleteByBranch(branchId) 1584 1585 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1586 if s.Root.Metrics != nil { 1587 success := "false" 1588 if resultVar0 == nil { 1589 success = "true" 1590 } 1591 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.PermanentDeleteByBranch", success, elapsed) 1592 } 1593 return resultVar0 1594 } 1595 1596 func (s *TimerLayerClassStore) PermanentDeleteMembersByClass(classId string) *model.AppError { 1597 start := timemodule.Now() 1598 1599 resultVar0 := s.ClassStore.PermanentDeleteMembersByClass(classId) 1600 1601 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1602 if s.Root.Metrics != nil { 1603 success := "false" 1604 if resultVar0 == nil { 1605 success = "true" 1606 } 1607 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.PermanentDeleteMembersByClass", success, elapsed) 1608 } 1609 return resultVar0 1610 } 1611 1612 func (s *TimerLayerClassStore) PermanentDeleteMembersByUser(userId string) *model.AppError { 1613 start := timemodule.Now() 1614 1615 resultVar0 := s.ClassStore.PermanentDeleteMembersByUser(userId) 1616 1617 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1618 if s.Root.Metrics != nil { 1619 success := "false" 1620 if resultVar0 == nil { 1621 success = "true" 1622 } 1623 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.PermanentDeleteMembersByUser", success, elapsed) 1624 } 1625 return resultVar0 1626 } 1627 1628 func (s *TimerLayerClassStore) RemoveAllDeactivatedMembers(classId string) *model.AppError { 1629 start := timemodule.Now() 1630 1631 resultVar0 := s.ClassStore.RemoveAllDeactivatedMembers(classId) 1632 1633 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1634 if s.Root.Metrics != nil { 1635 success := "false" 1636 if resultVar0 == nil { 1637 success = "true" 1638 } 1639 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.RemoveAllDeactivatedMembers", success, elapsed) 1640 } 1641 return resultVar0 1642 } 1643 1644 func (s *TimerLayerClassStore) RemoveMember(classId string, userId string) *model.AppError { 1645 start := timemodule.Now() 1646 1647 resultVar0 := s.ClassStore.RemoveMember(classId, userId) 1648 1649 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1650 if s.Root.Metrics != nil { 1651 success := "false" 1652 if resultVar0 == nil { 1653 success = "true" 1654 } 1655 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.RemoveMember", success, elapsed) 1656 } 1657 return resultVar0 1658 } 1659 1660 func (s *TimerLayerClassStore) ResetAllClassSchemes() *model.AppError { 1661 start := timemodule.Now() 1662 1663 resultVar0 := s.ClassStore.ResetAllClassSchemes() 1664 1665 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1666 if s.Root.Metrics != nil { 1667 success := "false" 1668 if resultVar0 == nil { 1669 success = "true" 1670 } 1671 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.ResetAllClassSchemes", success, elapsed) 1672 } 1673 return resultVar0 1674 } 1675 1676 func (s *TimerLayerClassStore) Restore(classId string, time int64) *model.AppError { 1677 start := timemodule.Now() 1678 1679 resultVar0 := s.ClassStore.Restore(classId, time) 1680 1681 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1682 if s.Root.Metrics != nil { 1683 success := "false" 1684 if resultVar0 == nil { 1685 success = "true" 1686 } 1687 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.Restore", success, elapsed) 1688 } 1689 return resultVar0 1690 } 1691 1692 func (s *TimerLayerClassStore) Save(class *model.Class, maxClassesPerBranch int64) (*model.Class, *model.AppError) { 1693 start := timemodule.Now() 1694 1695 resultVar0, resultVar1 := s.ClassStore.Save(class, maxClassesPerBranch) 1696 1697 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1698 if s.Root.Metrics != nil { 1699 success := "false" 1700 if resultVar1 == nil { 1701 success = "true" 1702 } 1703 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.Save", success, elapsed) 1704 } 1705 return resultVar0, resultVar1 1706 } 1707 1708 func (s *TimerLayerClassStore) SaveDirectClass(class *model.Class, member1 *model.ClassMember, member2 *model.ClassMember) (*model.Class, *model.AppError) { 1709 start := timemodule.Now() 1710 1711 resultVar0, resultVar1 := s.ClassStore.SaveDirectClass(class, member1, member2) 1712 1713 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1714 if s.Root.Metrics != nil { 1715 success := "false" 1716 if resultVar1 == nil { 1717 success = "true" 1718 } 1719 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.SaveDirectClass", success, elapsed) 1720 } 1721 return resultVar0, resultVar1 1722 } 1723 1724 func (s *TimerLayerClassStore) SaveMember(member *model.ClassMember) (*model.ClassMember, *model.AppError) { 1725 start := timemodule.Now() 1726 1727 resultVar0, resultVar1 := s.ClassStore.SaveMember(member) 1728 1729 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1730 if s.Root.Metrics != nil { 1731 success := "false" 1732 if resultVar1 == nil { 1733 success = "true" 1734 } 1735 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.SaveMember", success, elapsed) 1736 } 1737 return resultVar0, resultVar1 1738 } 1739 1740 func (s *TimerLayerClassStore) SetDeleteAt(classId string, deleteAt int64, updateAt int64) *model.AppError { 1741 start := timemodule.Now() 1742 1743 resultVar0 := s.ClassStore.SetDeleteAt(classId, deleteAt, updateAt) 1744 1745 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1746 if s.Root.Metrics != nil { 1747 success := "false" 1748 if resultVar0 == nil { 1749 success = "true" 1750 } 1751 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.SetDeleteAt", success, elapsed) 1752 } 1753 return resultVar0 1754 } 1755 1756 func (s *TimerLayerClassStore) Update(class *model.Class) (*model.Class, *model.AppError) { 1757 start := timemodule.Now() 1758 1759 resultVar0, resultVar1 := s.ClassStore.Update(class) 1760 1761 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1762 if s.Root.Metrics != nil { 1763 success := "false" 1764 if resultVar1 == nil { 1765 success = "true" 1766 } 1767 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.Update", success, elapsed) 1768 } 1769 return resultVar0, resultVar1 1770 } 1771 1772 func (s *TimerLayerClassStore) UpdateMember(member *model.ClassMember) (*model.ClassMember, *model.AppError) { 1773 start := timemodule.Now() 1774 1775 resultVar0, resultVar1 := s.ClassStore.UpdateMember(member) 1776 1777 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1778 if s.Root.Metrics != nil { 1779 success := "false" 1780 if resultVar1 == nil { 1781 success = "true" 1782 } 1783 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.UpdateMember", success, elapsed) 1784 } 1785 return resultVar0, resultVar1 1786 } 1787 1788 func (s *TimerLayerClassStore) UpdateMembersRole(classID string, userIDs []string) *model.AppError { 1789 start := timemodule.Now() 1790 1791 resultVar0 := s.ClassStore.UpdateMembersRole(classID, userIDs) 1792 1793 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1794 if s.Root.Metrics != nil { 1795 success := "false" 1796 if resultVar0 == nil { 1797 success = "true" 1798 } 1799 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.UpdateMembersRole", success, elapsed) 1800 } 1801 return resultVar0 1802 } 1803 1804 func (s *TimerLayerClassStore) UserBelongsToClasses(userId string, classIds []string) (bool, *model.AppError) { 1805 start := timemodule.Now() 1806 1807 resultVar0, resultVar1 := s.ClassStore.UserBelongsToClasses(userId, classIds) 1808 1809 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1810 if s.Root.Metrics != nil { 1811 success := "false" 1812 if resultVar1 == nil { 1813 success = "true" 1814 } 1815 s.Root.Metrics.ObserveStoreMethodDuration("ClassStore.UserBelongsToClasses", success, elapsed) 1816 } 1817 return resultVar0, resultVar1 1818 } 1819 1820 func (s *TimerLayerClusterDiscoveryStore) Cleanup() *model.AppError { 1821 start := timemodule.Now() 1822 1823 resultVar0 := s.ClusterDiscoveryStore.Cleanup() 1824 1825 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1826 if s.Root.Metrics != nil { 1827 success := "false" 1828 if resultVar0 == nil { 1829 success = "true" 1830 } 1831 s.Root.Metrics.ObserveStoreMethodDuration("ClusterDiscoveryStore.Cleanup", success, elapsed) 1832 } 1833 return resultVar0 1834 } 1835 1836 func (s *TimerLayerClusterDiscoveryStore) Delete(discovery *model.ClusterDiscovery) (bool, *model.AppError) { 1837 start := timemodule.Now() 1838 1839 resultVar0, resultVar1 := s.ClusterDiscoveryStore.Delete(discovery) 1840 1841 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1842 if s.Root.Metrics != nil { 1843 success := "false" 1844 if resultVar1 == nil { 1845 success = "true" 1846 } 1847 s.Root.Metrics.ObserveStoreMethodDuration("ClusterDiscoveryStore.Delete", success, elapsed) 1848 } 1849 return resultVar0, resultVar1 1850 } 1851 1852 func (s *TimerLayerClusterDiscoveryStore) Exists(discovery *model.ClusterDiscovery) (bool, *model.AppError) { 1853 start := timemodule.Now() 1854 1855 resultVar0, resultVar1 := s.ClusterDiscoveryStore.Exists(discovery) 1856 1857 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1858 if s.Root.Metrics != nil { 1859 success := "false" 1860 if resultVar1 == nil { 1861 success = "true" 1862 } 1863 s.Root.Metrics.ObserveStoreMethodDuration("ClusterDiscoveryStore.Exists", success, elapsed) 1864 } 1865 return resultVar0, resultVar1 1866 } 1867 1868 func (s *TimerLayerClusterDiscoveryStore) GetAll(discoveryType string, clusterName string) ([]*model.ClusterDiscovery, *model.AppError) { 1869 start := timemodule.Now() 1870 1871 resultVar0, resultVar1 := s.ClusterDiscoveryStore.GetAll(discoveryType, clusterName) 1872 1873 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1874 if s.Root.Metrics != nil { 1875 success := "false" 1876 if resultVar1 == nil { 1877 success = "true" 1878 } 1879 s.Root.Metrics.ObserveStoreMethodDuration("ClusterDiscoveryStore.GetAll", success, elapsed) 1880 } 1881 return resultVar0, resultVar1 1882 } 1883 1884 func (s *TimerLayerClusterDiscoveryStore) Save(discovery *model.ClusterDiscovery) *model.AppError { 1885 start := timemodule.Now() 1886 1887 resultVar0 := s.ClusterDiscoveryStore.Save(discovery) 1888 1889 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1890 if s.Root.Metrics != nil { 1891 success := "false" 1892 if resultVar0 == nil { 1893 success = "true" 1894 } 1895 s.Root.Metrics.ObserveStoreMethodDuration("ClusterDiscoveryStore.Save", success, elapsed) 1896 } 1897 return resultVar0 1898 } 1899 1900 func (s *TimerLayerClusterDiscoveryStore) SetLastPingAt(discovery *model.ClusterDiscovery) *model.AppError { 1901 start := timemodule.Now() 1902 1903 resultVar0 := s.ClusterDiscoveryStore.SetLastPingAt(discovery) 1904 1905 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1906 if s.Root.Metrics != nil { 1907 success := "false" 1908 if resultVar0 == nil { 1909 success = "true" 1910 } 1911 s.Root.Metrics.ObserveStoreMethodDuration("ClusterDiscoveryStore.SetLastPingAt", success, elapsed) 1912 } 1913 return resultVar0 1914 } 1915 1916 func (s *TimerLayerCommandStore) AnalyticsCommandCount(branchId string) (int64, *model.AppError) { 1917 start := timemodule.Now() 1918 1919 resultVar0, resultVar1 := s.CommandStore.AnalyticsCommandCount(branchId) 1920 1921 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1922 if s.Root.Metrics != nil { 1923 success := "false" 1924 if resultVar1 == nil { 1925 success = "true" 1926 } 1927 s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.AnalyticsCommandCount", success, elapsed) 1928 } 1929 return resultVar0, resultVar1 1930 } 1931 1932 func (s *TimerLayerCommandStore) Delete(commandId string, time int64) *model.AppError { 1933 start := timemodule.Now() 1934 1935 resultVar0 := s.CommandStore.Delete(commandId, time) 1936 1937 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1938 if s.Root.Metrics != nil { 1939 success := "false" 1940 if resultVar0 == nil { 1941 success = "true" 1942 } 1943 s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.Delete", success, elapsed) 1944 } 1945 return resultVar0 1946 } 1947 1948 func (s *TimerLayerCommandStore) Get(id string) (*model.Command, *model.AppError) { 1949 start := timemodule.Now() 1950 1951 resultVar0, resultVar1 := s.CommandStore.Get(id) 1952 1953 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1954 if s.Root.Metrics != nil { 1955 success := "false" 1956 if resultVar1 == nil { 1957 success = "true" 1958 } 1959 s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.Get", success, elapsed) 1960 } 1961 return resultVar0, resultVar1 1962 } 1963 1964 func (s *TimerLayerCommandStore) GetByBranch(branchId string) ([]*model.Command, *model.AppError) { 1965 start := timemodule.Now() 1966 1967 resultVar0, resultVar1 := s.CommandStore.GetByBranch(branchId) 1968 1969 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1970 if s.Root.Metrics != nil { 1971 success := "false" 1972 if resultVar1 == nil { 1973 success = "true" 1974 } 1975 s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.GetByBranch", success, elapsed) 1976 } 1977 return resultVar0, resultVar1 1978 } 1979 1980 func (s *TimerLayerCommandStore) GetByTrigger(branchId string, trigger string) (*model.Command, *model.AppError) { 1981 start := timemodule.Now() 1982 1983 resultVar0, resultVar1 := s.CommandStore.GetByTrigger(branchId, trigger) 1984 1985 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 1986 if s.Root.Metrics != nil { 1987 success := "false" 1988 if resultVar1 == nil { 1989 success = "true" 1990 } 1991 s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.GetByTrigger", success, elapsed) 1992 } 1993 return resultVar0, resultVar1 1994 } 1995 1996 func (s *TimerLayerCommandStore) PermanentDeleteByBranch(branchId string) *model.AppError { 1997 start := timemodule.Now() 1998 1999 resultVar0 := s.CommandStore.PermanentDeleteByBranch(branchId) 2000 2001 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2002 if s.Root.Metrics != nil { 2003 success := "false" 2004 if resultVar0 == nil { 2005 success = "true" 2006 } 2007 s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.PermanentDeleteByBranch", success, elapsed) 2008 } 2009 return resultVar0 2010 } 2011 2012 func (s *TimerLayerCommandStore) PermanentDeleteByUser(userId string) *model.AppError { 2013 start := timemodule.Now() 2014 2015 resultVar0 := s.CommandStore.PermanentDeleteByUser(userId) 2016 2017 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2018 if s.Root.Metrics != nil { 2019 success := "false" 2020 if resultVar0 == nil { 2021 success = "true" 2022 } 2023 s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.PermanentDeleteByUser", success, elapsed) 2024 } 2025 return resultVar0 2026 } 2027 2028 func (s *TimerLayerCommandStore) Save(webhook *model.Command) (*model.Command, *model.AppError) { 2029 start := timemodule.Now() 2030 2031 resultVar0, resultVar1 := s.CommandStore.Save(webhook) 2032 2033 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2034 if s.Root.Metrics != nil { 2035 success := "false" 2036 if resultVar1 == nil { 2037 success = "true" 2038 } 2039 s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.Save", success, elapsed) 2040 } 2041 return resultVar0, resultVar1 2042 } 2043 2044 func (s *TimerLayerCommandStore) Update(hook *model.Command) (*model.Command, *model.AppError) { 2045 start := timemodule.Now() 2046 2047 resultVar0, resultVar1 := s.CommandStore.Update(hook) 2048 2049 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2050 if s.Root.Metrics != nil { 2051 success := "false" 2052 if resultVar1 == nil { 2053 success = "true" 2054 } 2055 s.Root.Metrics.ObserveStoreMethodDuration("CommandStore.Update", success, elapsed) 2056 } 2057 return resultVar0, resultVar1 2058 } 2059 2060 func (s *TimerLayerCommandWebhookStore) Cleanup() { 2061 start := timemodule.Now() 2062 2063 s.CommandWebhookStore.Cleanup() 2064 2065 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2066 if s.Root.Metrics != nil { 2067 success := "false" 2068 if true { 2069 success = "true" 2070 } 2071 s.Root.Metrics.ObserveStoreMethodDuration("CommandWebhookStore.Cleanup", success, elapsed) 2072 } 2073 } 2074 2075 func (s *TimerLayerCommandWebhookStore) Get(id string) (*model.CommandWebhook, *model.AppError) { 2076 start := timemodule.Now() 2077 2078 resultVar0, resultVar1 := s.CommandWebhookStore.Get(id) 2079 2080 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2081 if s.Root.Metrics != nil { 2082 success := "false" 2083 if resultVar1 == nil { 2084 success = "true" 2085 } 2086 s.Root.Metrics.ObserveStoreMethodDuration("CommandWebhookStore.Get", success, elapsed) 2087 } 2088 return resultVar0, resultVar1 2089 } 2090 2091 func (s *TimerLayerCommandWebhookStore) Save(webhook *model.CommandWebhook) (*model.CommandWebhook, *model.AppError) { 2092 start := timemodule.Now() 2093 2094 resultVar0, resultVar1 := s.CommandWebhookStore.Save(webhook) 2095 2096 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2097 if s.Root.Metrics != nil { 2098 success := "false" 2099 if resultVar1 == nil { 2100 success = "true" 2101 } 2102 s.Root.Metrics.ObserveStoreMethodDuration("CommandWebhookStore.Save", success, elapsed) 2103 } 2104 return resultVar0, resultVar1 2105 } 2106 2107 func (s *TimerLayerCommandWebhookStore) TryUse(id string, limit int) *model.AppError { 2108 start := timemodule.Now() 2109 2110 resultVar0 := s.CommandWebhookStore.TryUse(id, limit) 2111 2112 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2113 if s.Root.Metrics != nil { 2114 success := "false" 2115 if resultVar0 == nil { 2116 success = "true" 2117 } 2118 s.Root.Metrics.ObserveStoreMethodDuration("CommandWebhookStore.TryUse", success, elapsed) 2119 } 2120 return resultVar0 2121 } 2122 2123 func (s *TimerLayerComplianceStore) ComplianceExport(compliance *model.Compliance) ([]*model.CompliancePost, *model.AppError) { 2124 start := timemodule.Now() 2125 2126 resultVar0, resultVar1 := s.ComplianceStore.ComplianceExport(compliance) 2127 2128 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2129 if s.Root.Metrics != nil { 2130 success := "false" 2131 if resultVar1 == nil { 2132 success = "true" 2133 } 2134 s.Root.Metrics.ObserveStoreMethodDuration("ComplianceStore.ComplianceExport", success, elapsed) 2135 } 2136 return resultVar0, resultVar1 2137 } 2138 2139 func (s *TimerLayerComplianceStore) Get(id string) (*model.Compliance, *model.AppError) { 2140 start := timemodule.Now() 2141 2142 resultVar0, resultVar1 := s.ComplianceStore.Get(id) 2143 2144 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2145 if s.Root.Metrics != nil { 2146 success := "false" 2147 if resultVar1 == nil { 2148 success = "true" 2149 } 2150 s.Root.Metrics.ObserveStoreMethodDuration("ComplianceStore.Get", success, elapsed) 2151 } 2152 return resultVar0, resultVar1 2153 } 2154 2155 func (s *TimerLayerComplianceStore) GetAll(offset int, limit int) (model.Compliances, *model.AppError) { 2156 start := timemodule.Now() 2157 2158 resultVar0, resultVar1 := s.ComplianceStore.GetAll(offset, limit) 2159 2160 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2161 if s.Root.Metrics != nil { 2162 success := "false" 2163 if resultVar1 == nil { 2164 success = "true" 2165 } 2166 s.Root.Metrics.ObserveStoreMethodDuration("ComplianceStore.GetAll", success, elapsed) 2167 } 2168 return resultVar0, resultVar1 2169 } 2170 2171 func (s *TimerLayerComplianceStore) MessageExport(after int64, limit int) ([]*model.MessageExport, *model.AppError) { 2172 start := timemodule.Now() 2173 2174 resultVar0, resultVar1 := s.ComplianceStore.MessageExport(after, limit) 2175 2176 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2177 if s.Root.Metrics != nil { 2178 success := "false" 2179 if resultVar1 == nil { 2180 success = "true" 2181 } 2182 s.Root.Metrics.ObserveStoreMethodDuration("ComplianceStore.MessageExport", success, elapsed) 2183 } 2184 return resultVar0, resultVar1 2185 } 2186 2187 func (s *TimerLayerComplianceStore) Save(compliance *model.Compliance) (*model.Compliance, *model.AppError) { 2188 start := timemodule.Now() 2189 2190 resultVar0, resultVar1 := s.ComplianceStore.Save(compliance) 2191 2192 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2193 if s.Root.Metrics != nil { 2194 success := "false" 2195 if resultVar1 == nil { 2196 success = "true" 2197 } 2198 s.Root.Metrics.ObserveStoreMethodDuration("ComplianceStore.Save", success, elapsed) 2199 } 2200 return resultVar0, resultVar1 2201 } 2202 2203 func (s *TimerLayerComplianceStore) Update(compliance *model.Compliance) (*model.Compliance, *model.AppError) { 2204 start := timemodule.Now() 2205 2206 resultVar0, resultVar1 := s.ComplianceStore.Update(compliance) 2207 2208 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2209 if s.Root.Metrics != nil { 2210 success := "false" 2211 if resultVar1 == nil { 2212 success = "true" 2213 } 2214 s.Root.Metrics.ObserveStoreMethodDuration("ComplianceStore.Update", success, elapsed) 2215 } 2216 return resultVar0, resultVar1 2217 } 2218 2219 func (s *TimerLayerEmojiStore) Delete(emoji *model.Emoji, time int64) *model.AppError { 2220 start := timemodule.Now() 2221 2222 resultVar0 := s.EmojiStore.Delete(emoji, time) 2223 2224 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2225 if s.Root.Metrics != nil { 2226 success := "false" 2227 if resultVar0 == nil { 2228 success = "true" 2229 } 2230 s.Root.Metrics.ObserveStoreMethodDuration("EmojiStore.Delete", success, elapsed) 2231 } 2232 return resultVar0 2233 } 2234 2235 func (s *TimerLayerEmojiStore) Get(id string, allowFromCache bool) (*model.Emoji, *model.AppError) { 2236 start := timemodule.Now() 2237 2238 resultVar0, resultVar1 := s.EmojiStore.Get(id, allowFromCache) 2239 2240 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2241 if s.Root.Metrics != nil { 2242 success := "false" 2243 if resultVar1 == nil { 2244 success = "true" 2245 } 2246 s.Root.Metrics.ObserveStoreMethodDuration("EmojiStore.Get", success, elapsed) 2247 } 2248 return resultVar0, resultVar1 2249 } 2250 2251 func (s *TimerLayerEmojiStore) GetByName(name string, allowFromCache bool) (*model.Emoji, *model.AppError) { 2252 start := timemodule.Now() 2253 2254 resultVar0, resultVar1 := s.EmojiStore.GetByName(name, allowFromCache) 2255 2256 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2257 if s.Root.Metrics != nil { 2258 success := "false" 2259 if resultVar1 == nil { 2260 success = "true" 2261 } 2262 s.Root.Metrics.ObserveStoreMethodDuration("EmojiStore.GetByName", success, elapsed) 2263 } 2264 return resultVar0, resultVar1 2265 } 2266 2267 func (s *TimerLayerEmojiStore) GetList(offset int, limit int, sort string) ([]*model.Emoji, *model.AppError) { 2268 start := timemodule.Now() 2269 2270 resultVar0, resultVar1 := s.EmojiStore.GetList(offset, limit, sort) 2271 2272 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2273 if s.Root.Metrics != nil { 2274 success := "false" 2275 if resultVar1 == nil { 2276 success = "true" 2277 } 2278 s.Root.Metrics.ObserveStoreMethodDuration("EmojiStore.GetList", success, elapsed) 2279 } 2280 return resultVar0, resultVar1 2281 } 2282 2283 func (s *TimerLayerEmojiStore) GetMultipleByName(names []string) ([]*model.Emoji, *model.AppError) { 2284 start := timemodule.Now() 2285 2286 resultVar0, resultVar1 := s.EmojiStore.GetMultipleByName(names) 2287 2288 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2289 if s.Root.Metrics != nil { 2290 success := "false" 2291 if resultVar1 == nil { 2292 success = "true" 2293 } 2294 s.Root.Metrics.ObserveStoreMethodDuration("EmojiStore.GetMultipleByName", success, elapsed) 2295 } 2296 return resultVar0, resultVar1 2297 } 2298 2299 func (s *TimerLayerEmojiStore) Save(emoji *model.Emoji) (*model.Emoji, *model.AppError) { 2300 start := timemodule.Now() 2301 2302 resultVar0, resultVar1 := s.EmojiStore.Save(emoji) 2303 2304 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2305 if s.Root.Metrics != nil { 2306 success := "false" 2307 if resultVar1 == nil { 2308 success = "true" 2309 } 2310 s.Root.Metrics.ObserveStoreMethodDuration("EmojiStore.Save", success, elapsed) 2311 } 2312 return resultVar0, resultVar1 2313 } 2314 2315 func (s *TimerLayerEmojiStore) Search(name string, prefixOnly bool, limit int) ([]*model.Emoji, *model.AppError) { 2316 start := timemodule.Now() 2317 2318 resultVar0, resultVar1 := s.EmojiStore.Search(name, prefixOnly, limit) 2319 2320 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2321 if s.Root.Metrics != nil { 2322 success := "false" 2323 if resultVar1 == nil { 2324 success = "true" 2325 } 2326 s.Root.Metrics.ObserveStoreMethodDuration("EmojiStore.Search", success, elapsed) 2327 } 2328 return resultVar0, resultVar1 2329 } 2330 2331 func (s *TimerLayerFileInfoStore) AttachToPost(fileId string, postId string, creatorId string) *model.AppError { 2332 start := timemodule.Now() 2333 2334 resultVar0 := s.FileInfoStore.AttachToPost(fileId, postId, creatorId) 2335 2336 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2337 if s.Root.Metrics != nil { 2338 success := "false" 2339 if resultVar0 == nil { 2340 success = "true" 2341 } 2342 s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.AttachToPost", success, elapsed) 2343 } 2344 return resultVar0 2345 } 2346 2347 func (s *TimerLayerFileInfoStore) ClearCaches() { 2348 start := timemodule.Now() 2349 2350 s.FileInfoStore.ClearCaches() 2351 2352 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2353 if s.Root.Metrics != nil { 2354 success := "false" 2355 if true { 2356 success = "true" 2357 } 2358 s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.ClearCaches", success, elapsed) 2359 } 2360 } 2361 2362 func (s *TimerLayerFileInfoStore) DeleteForPost(postId string) (string, *model.AppError) { 2363 start := timemodule.Now() 2364 2365 resultVar0, resultVar1 := s.FileInfoStore.DeleteForPost(postId) 2366 2367 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2368 if s.Root.Metrics != nil { 2369 success := "false" 2370 if resultVar1 == nil { 2371 success = "true" 2372 } 2373 s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.DeleteForPost", success, elapsed) 2374 } 2375 return resultVar0, resultVar1 2376 } 2377 2378 func (s *TimerLayerFileInfoStore) Get(id string) (*model.FileInfo, *model.AppError) { 2379 start := timemodule.Now() 2380 2381 resultVar0, resultVar1 := s.FileInfoStore.Get(id) 2382 2383 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2384 if s.Root.Metrics != nil { 2385 success := "false" 2386 if resultVar1 == nil { 2387 success = "true" 2388 } 2389 s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.Get", success, elapsed) 2390 } 2391 return resultVar0, resultVar1 2392 } 2393 2394 func (s *TimerLayerFileInfoStore) GetByPath(path string) (*model.FileInfo, *model.AppError) { 2395 start := timemodule.Now() 2396 2397 resultVar0, resultVar1 := s.FileInfoStore.GetByPath(path) 2398 2399 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2400 if s.Root.Metrics != nil { 2401 success := "false" 2402 if resultVar1 == nil { 2403 success = "true" 2404 } 2405 s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.GetByPath", success, elapsed) 2406 } 2407 return resultVar0, resultVar1 2408 } 2409 2410 func (s *TimerLayerFileInfoStore) GetForPost(postId string, readFromMaster bool, includeDeleted bool, allowFromCache bool) ([]*model.FileInfo, *model.AppError) { 2411 start := timemodule.Now() 2412 2413 resultVar0, resultVar1 := s.FileInfoStore.GetForPost(postId, readFromMaster, includeDeleted, allowFromCache) 2414 2415 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2416 if s.Root.Metrics != nil { 2417 success := "false" 2418 if resultVar1 == nil { 2419 success = "true" 2420 } 2421 s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.GetForPost", success, elapsed) 2422 } 2423 return resultVar0, resultVar1 2424 } 2425 2426 func (s *TimerLayerFileInfoStore) GetForUser(userId string) ([]*model.FileInfo, *model.AppError) { 2427 start := timemodule.Now() 2428 2429 resultVar0, resultVar1 := s.FileInfoStore.GetForUser(userId) 2430 2431 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2432 if s.Root.Metrics != nil { 2433 success := "false" 2434 if resultVar1 == nil { 2435 success = "true" 2436 } 2437 s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.GetForUser", success, elapsed) 2438 } 2439 return resultVar0, resultVar1 2440 } 2441 2442 func (s *TimerLayerFileInfoStore) GetWithOptions(page int, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError) { 2443 start := timemodule.Now() 2444 2445 resultVar0, resultVar1 := s.FileInfoStore.GetWithOptions(page, perPage, opt) 2446 2447 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2448 if s.Root.Metrics != nil { 2449 success := "false" 2450 if resultVar1 == nil { 2451 success = "true" 2452 } 2453 s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.GetWithOptions", success, elapsed) 2454 } 2455 return resultVar0, resultVar1 2456 } 2457 2458 func (s *TimerLayerFileInfoStore) InvalidateFileInfosForPostCache(postId string, deleted bool) { 2459 start := timemodule.Now() 2460 2461 s.FileInfoStore.InvalidateFileInfosForPostCache(postId, deleted) 2462 2463 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2464 if s.Root.Metrics != nil { 2465 success := "false" 2466 if true { 2467 success = "true" 2468 } 2469 s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.InvalidateFileInfosForPostCache", success, elapsed) 2470 } 2471 } 2472 2473 func (s *TimerLayerFileInfoStore) PermanentDelete(fileId string) *model.AppError { 2474 start := timemodule.Now() 2475 2476 resultVar0 := s.FileInfoStore.PermanentDelete(fileId) 2477 2478 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2479 if s.Root.Metrics != nil { 2480 success := "false" 2481 if resultVar0 == nil { 2482 success = "true" 2483 } 2484 s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.PermanentDelete", success, elapsed) 2485 } 2486 return resultVar0 2487 } 2488 2489 func (s *TimerLayerFileInfoStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, *model.AppError) { 2490 start := timemodule.Now() 2491 2492 resultVar0, resultVar1 := s.FileInfoStore.PermanentDeleteBatch(endTime, limit) 2493 2494 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2495 if s.Root.Metrics != nil { 2496 success := "false" 2497 if resultVar1 == nil { 2498 success = "true" 2499 } 2500 s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.PermanentDeleteBatch", success, elapsed) 2501 } 2502 return resultVar0, resultVar1 2503 } 2504 2505 func (s *TimerLayerFileInfoStore) PermanentDeleteByUser(userId string) (int64, *model.AppError) { 2506 start := timemodule.Now() 2507 2508 resultVar0, resultVar1 := s.FileInfoStore.PermanentDeleteByUser(userId) 2509 2510 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2511 if s.Root.Metrics != nil { 2512 success := "false" 2513 if resultVar1 == nil { 2514 success = "true" 2515 } 2516 s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.PermanentDeleteByUser", success, elapsed) 2517 } 2518 return resultVar0, resultVar1 2519 } 2520 2521 func (s *TimerLayerFileInfoStore) Save(info *model.FileInfo) (*model.FileInfo, *model.AppError) { 2522 start := timemodule.Now() 2523 2524 resultVar0, resultVar1 := s.FileInfoStore.Save(info) 2525 2526 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2527 if s.Root.Metrics != nil { 2528 success := "false" 2529 if resultVar1 == nil { 2530 success = "true" 2531 } 2532 s.Root.Metrics.ObserveStoreMethodDuration("FileInfoStore.Save", success, elapsed) 2533 } 2534 return resultVar0, resultVar1 2535 } 2536 2537 func (s *TimerLayerJobStore) Delete(id string) (string, *model.AppError) { 2538 start := timemodule.Now() 2539 2540 resultVar0, resultVar1 := s.JobStore.Delete(id) 2541 2542 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2543 if s.Root.Metrics != nil { 2544 success := "false" 2545 if resultVar1 == nil { 2546 success = "true" 2547 } 2548 s.Root.Metrics.ObserveStoreMethodDuration("JobStore.Delete", success, elapsed) 2549 } 2550 return resultVar0, resultVar1 2551 } 2552 2553 func (s *TimerLayerJobStore) Get(id string) (*model.Job, *model.AppError) { 2554 start := timemodule.Now() 2555 2556 resultVar0, resultVar1 := s.JobStore.Get(id) 2557 2558 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2559 if s.Root.Metrics != nil { 2560 success := "false" 2561 if resultVar1 == nil { 2562 success = "true" 2563 } 2564 s.Root.Metrics.ObserveStoreMethodDuration("JobStore.Get", success, elapsed) 2565 } 2566 return resultVar0, resultVar1 2567 } 2568 2569 func (s *TimerLayerJobStore) GetAllByStatus(status string) ([]*model.Job, *model.AppError) { 2570 start := timemodule.Now() 2571 2572 resultVar0, resultVar1 := s.JobStore.GetAllByStatus(status) 2573 2574 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2575 if s.Root.Metrics != nil { 2576 success := "false" 2577 if resultVar1 == nil { 2578 success = "true" 2579 } 2580 s.Root.Metrics.ObserveStoreMethodDuration("JobStore.GetAllByStatus", success, elapsed) 2581 } 2582 return resultVar0, resultVar1 2583 } 2584 2585 func (s *TimerLayerJobStore) GetAllByType(jobType string) ([]*model.Job, *model.AppError) { 2586 start := timemodule.Now() 2587 2588 resultVar0, resultVar1 := s.JobStore.GetAllByType(jobType) 2589 2590 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2591 if s.Root.Metrics != nil { 2592 success := "false" 2593 if resultVar1 == nil { 2594 success = "true" 2595 } 2596 s.Root.Metrics.ObserveStoreMethodDuration("JobStore.GetAllByType", success, elapsed) 2597 } 2598 return resultVar0, resultVar1 2599 } 2600 2601 func (s *TimerLayerJobStore) GetAllByTypePage(jobType string, offset int, limit int) ([]*model.Job, *model.AppError) { 2602 start := timemodule.Now() 2603 2604 resultVar0, resultVar1 := s.JobStore.GetAllByTypePage(jobType, offset, limit) 2605 2606 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2607 if s.Root.Metrics != nil { 2608 success := "false" 2609 if resultVar1 == nil { 2610 success = "true" 2611 } 2612 s.Root.Metrics.ObserveStoreMethodDuration("JobStore.GetAllByTypePage", success, elapsed) 2613 } 2614 return resultVar0, resultVar1 2615 } 2616 2617 func (s *TimerLayerJobStore) GetAllPage(offset int, limit int) ([]*model.Job, *model.AppError) { 2618 start := timemodule.Now() 2619 2620 resultVar0, resultVar1 := s.JobStore.GetAllPage(offset, limit) 2621 2622 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2623 if s.Root.Metrics != nil { 2624 success := "false" 2625 if resultVar1 == nil { 2626 success = "true" 2627 } 2628 s.Root.Metrics.ObserveStoreMethodDuration("JobStore.GetAllPage", success, elapsed) 2629 } 2630 return resultVar0, resultVar1 2631 } 2632 2633 func (s *TimerLayerJobStore) GetCountByStatusAndType(status string, jobType string) (int64, *model.AppError) { 2634 start := timemodule.Now() 2635 2636 resultVar0, resultVar1 := s.JobStore.GetCountByStatusAndType(status, jobType) 2637 2638 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2639 if s.Root.Metrics != nil { 2640 success := "false" 2641 if resultVar1 == nil { 2642 success = "true" 2643 } 2644 s.Root.Metrics.ObserveStoreMethodDuration("JobStore.GetCountByStatusAndType", success, elapsed) 2645 } 2646 return resultVar0, resultVar1 2647 } 2648 2649 func (s *TimerLayerJobStore) GetNewestJobByStatusAndType(status string, jobType string) (*model.Job, *model.AppError) { 2650 start := timemodule.Now() 2651 2652 resultVar0, resultVar1 := s.JobStore.GetNewestJobByStatusAndType(status, jobType) 2653 2654 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2655 if s.Root.Metrics != nil { 2656 success := "false" 2657 if resultVar1 == nil { 2658 success = "true" 2659 } 2660 s.Root.Metrics.ObserveStoreMethodDuration("JobStore.GetNewestJobByStatusAndType", success, elapsed) 2661 } 2662 return resultVar0, resultVar1 2663 } 2664 2665 func (s *TimerLayerJobStore) Save(job *model.Job) (*model.Job, *model.AppError) { 2666 start := timemodule.Now() 2667 2668 resultVar0, resultVar1 := s.JobStore.Save(job) 2669 2670 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2671 if s.Root.Metrics != nil { 2672 success := "false" 2673 if resultVar1 == nil { 2674 success = "true" 2675 } 2676 s.Root.Metrics.ObserveStoreMethodDuration("JobStore.Save", success, elapsed) 2677 } 2678 return resultVar0, resultVar1 2679 } 2680 2681 func (s *TimerLayerJobStore) UpdateOptimistically(job *model.Job, currentStatus string) (bool, *model.AppError) { 2682 start := timemodule.Now() 2683 2684 resultVar0, resultVar1 := s.JobStore.UpdateOptimistically(job, currentStatus) 2685 2686 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2687 if s.Root.Metrics != nil { 2688 success := "false" 2689 if resultVar1 == nil { 2690 success = "true" 2691 } 2692 s.Root.Metrics.ObserveStoreMethodDuration("JobStore.UpdateOptimistically", success, elapsed) 2693 } 2694 return resultVar0, resultVar1 2695 } 2696 2697 func (s *TimerLayerJobStore) UpdateStatus(id string, status string) (*model.Job, *model.AppError) { 2698 start := timemodule.Now() 2699 2700 resultVar0, resultVar1 := s.JobStore.UpdateStatus(id, status) 2701 2702 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2703 if s.Root.Metrics != nil { 2704 success := "false" 2705 if resultVar1 == nil { 2706 success = "true" 2707 } 2708 s.Root.Metrics.ObserveStoreMethodDuration("JobStore.UpdateStatus", success, elapsed) 2709 } 2710 return resultVar0, resultVar1 2711 } 2712 2713 func (s *TimerLayerJobStore) UpdateStatusOptimistically(id string, currentStatus string, newStatus string) (bool, *model.AppError) { 2714 start := timemodule.Now() 2715 2716 resultVar0, resultVar1 := s.JobStore.UpdateStatusOptimistically(id, currentStatus, newStatus) 2717 2718 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2719 if s.Root.Metrics != nil { 2720 success := "false" 2721 if resultVar1 == nil { 2722 success = "true" 2723 } 2724 s.Root.Metrics.ObserveStoreMethodDuration("JobStore.UpdateStatusOptimistically", success, elapsed) 2725 } 2726 return resultVar0, resultVar1 2727 } 2728 2729 func (s *TimerLayerLicenseStore) Get(id string) (*model.LicenseRecord, *model.AppError) { 2730 start := timemodule.Now() 2731 2732 resultVar0, resultVar1 := s.LicenseStore.Get(id) 2733 2734 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2735 if s.Root.Metrics != nil { 2736 success := "false" 2737 if resultVar1 == nil { 2738 success = "true" 2739 } 2740 s.Root.Metrics.ObserveStoreMethodDuration("LicenseStore.Get", success, elapsed) 2741 } 2742 return resultVar0, resultVar1 2743 } 2744 2745 func (s *TimerLayerLicenseStore) Save(license *model.LicenseRecord) (*model.LicenseRecord, *model.AppError) { 2746 start := timemodule.Now() 2747 2748 resultVar0, resultVar1 := s.LicenseStore.Save(license) 2749 2750 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2751 if s.Root.Metrics != nil { 2752 success := "false" 2753 if resultVar1 == nil { 2754 success = "true" 2755 } 2756 s.Root.Metrics.ObserveStoreMethodDuration("LicenseStore.Save", success, elapsed) 2757 } 2758 return resultVar0, resultVar1 2759 } 2760 2761 func (s *TimerLayerLinkMetadataStore) Get(url string, timestamp int64) (*model.LinkMetadata, *model.AppError) { 2762 start := timemodule.Now() 2763 2764 resultVar0, resultVar1 := s.LinkMetadataStore.Get(url, timestamp) 2765 2766 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2767 if s.Root.Metrics != nil { 2768 success := "false" 2769 if resultVar1 == nil { 2770 success = "true" 2771 } 2772 s.Root.Metrics.ObserveStoreMethodDuration("LinkMetadataStore.Get", success, elapsed) 2773 } 2774 return resultVar0, resultVar1 2775 } 2776 2777 func (s *TimerLayerLinkMetadataStore) Save(linkMetadata *model.LinkMetadata) (*model.LinkMetadata, *model.AppError) { 2778 start := timemodule.Now() 2779 2780 resultVar0, resultVar1 := s.LinkMetadataStore.Save(linkMetadata) 2781 2782 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2783 if s.Root.Metrics != nil { 2784 success := "false" 2785 if resultVar1 == nil { 2786 success = "true" 2787 } 2788 s.Root.Metrics.ObserveStoreMethodDuration("LinkMetadataStore.Save", success, elapsed) 2789 } 2790 return resultVar0, resultVar1 2791 } 2792 2793 func (s *TimerLayerOAuthStore) DeleteApp(id string) *model.AppError { 2794 start := timemodule.Now() 2795 2796 resultVar0 := s.OAuthStore.DeleteApp(id) 2797 2798 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2799 if s.Root.Metrics != nil { 2800 success := "false" 2801 if resultVar0 == nil { 2802 success = "true" 2803 } 2804 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.DeleteApp", success, elapsed) 2805 } 2806 return resultVar0 2807 } 2808 2809 func (s *TimerLayerOAuthStore) GetAccessData(token string) (*model.AccessData, *model.AppError) { 2810 start := timemodule.Now() 2811 2812 resultVar0, resultVar1 := s.OAuthStore.GetAccessData(token) 2813 2814 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2815 if s.Root.Metrics != nil { 2816 success := "false" 2817 if resultVar1 == nil { 2818 success = "true" 2819 } 2820 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetAccessData", success, elapsed) 2821 } 2822 return resultVar0, resultVar1 2823 } 2824 2825 func (s *TimerLayerOAuthStore) GetAccessDataByRefreshToken(token string) (*model.AccessData, *model.AppError) { 2826 start := timemodule.Now() 2827 2828 resultVar0, resultVar1 := s.OAuthStore.GetAccessDataByRefreshToken(token) 2829 2830 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2831 if s.Root.Metrics != nil { 2832 success := "false" 2833 if resultVar1 == nil { 2834 success = "true" 2835 } 2836 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetAccessDataByRefreshToken", success, elapsed) 2837 } 2838 return resultVar0, resultVar1 2839 } 2840 2841 func (s *TimerLayerOAuthStore) GetAccessDataByUserForApp(userId string, clientId string) ([]*model.AccessData, *model.AppError) { 2842 start := timemodule.Now() 2843 2844 resultVar0, resultVar1 := s.OAuthStore.GetAccessDataByUserForApp(userId, clientId) 2845 2846 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2847 if s.Root.Metrics != nil { 2848 success := "false" 2849 if resultVar1 == nil { 2850 success = "true" 2851 } 2852 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetAccessDataByUserForApp", success, elapsed) 2853 } 2854 return resultVar0, resultVar1 2855 } 2856 2857 func (s *TimerLayerOAuthStore) GetApp(id string) (*model.OAuthApp, *model.AppError) { 2858 start := timemodule.Now() 2859 2860 resultVar0, resultVar1 := s.OAuthStore.GetApp(id) 2861 2862 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2863 if s.Root.Metrics != nil { 2864 success := "false" 2865 if resultVar1 == nil { 2866 success = "true" 2867 } 2868 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetApp", success, elapsed) 2869 } 2870 return resultVar0, resultVar1 2871 } 2872 2873 func (s *TimerLayerOAuthStore) GetAppByUser(userId string, offset int, limit int) ([]*model.OAuthApp, *model.AppError) { 2874 start := timemodule.Now() 2875 2876 resultVar0, resultVar1 := s.OAuthStore.GetAppByUser(userId, offset, limit) 2877 2878 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2879 if s.Root.Metrics != nil { 2880 success := "false" 2881 if resultVar1 == nil { 2882 success = "true" 2883 } 2884 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetAppByUser", success, elapsed) 2885 } 2886 return resultVar0, resultVar1 2887 } 2888 2889 func (s *TimerLayerOAuthStore) GetApps(offset int, limit int) ([]*model.OAuthApp, *model.AppError) { 2890 start := timemodule.Now() 2891 2892 resultVar0, resultVar1 := s.OAuthStore.GetApps(offset, limit) 2893 2894 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2895 if s.Root.Metrics != nil { 2896 success := "false" 2897 if resultVar1 == nil { 2898 success = "true" 2899 } 2900 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetApps", success, elapsed) 2901 } 2902 return resultVar0, resultVar1 2903 } 2904 2905 func (s *TimerLayerOAuthStore) GetAuthData(code string) (*model.AuthData, *model.AppError) { 2906 start := timemodule.Now() 2907 2908 resultVar0, resultVar1 := s.OAuthStore.GetAuthData(code) 2909 2910 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2911 if s.Root.Metrics != nil { 2912 success := "false" 2913 if resultVar1 == nil { 2914 success = "true" 2915 } 2916 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetAuthData", success, elapsed) 2917 } 2918 return resultVar0, resultVar1 2919 } 2920 2921 func (s *TimerLayerOAuthStore) GetAuthorizedApps(userId string, offset int, limit int) ([]*model.OAuthApp, *model.AppError) { 2922 start := timemodule.Now() 2923 2924 resultVar0, resultVar1 := s.OAuthStore.GetAuthorizedApps(userId, offset, limit) 2925 2926 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2927 if s.Root.Metrics != nil { 2928 success := "false" 2929 if resultVar1 == nil { 2930 success = "true" 2931 } 2932 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetAuthorizedApps", success, elapsed) 2933 } 2934 return resultVar0, resultVar1 2935 } 2936 2937 func (s *TimerLayerOAuthStore) GetPreviousAccessData(userId string, clientId string) (*model.AccessData, *model.AppError) { 2938 start := timemodule.Now() 2939 2940 resultVar0, resultVar1 := s.OAuthStore.GetPreviousAccessData(userId, clientId) 2941 2942 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2943 if s.Root.Metrics != nil { 2944 success := "false" 2945 if resultVar1 == nil { 2946 success = "true" 2947 } 2948 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.GetPreviousAccessData", success, elapsed) 2949 } 2950 return resultVar0, resultVar1 2951 } 2952 2953 func (s *TimerLayerOAuthStore) PermanentDeleteAuthDataByUser(userId string) *model.AppError { 2954 start := timemodule.Now() 2955 2956 resultVar0 := s.OAuthStore.PermanentDeleteAuthDataByUser(userId) 2957 2958 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2959 if s.Root.Metrics != nil { 2960 success := "false" 2961 if resultVar0 == nil { 2962 success = "true" 2963 } 2964 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.PermanentDeleteAuthDataByUser", success, elapsed) 2965 } 2966 return resultVar0 2967 } 2968 2969 func (s *TimerLayerOAuthStore) RemoveAccessData(token string) *model.AppError { 2970 start := timemodule.Now() 2971 2972 resultVar0 := s.OAuthStore.RemoveAccessData(token) 2973 2974 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2975 if s.Root.Metrics != nil { 2976 success := "false" 2977 if resultVar0 == nil { 2978 success = "true" 2979 } 2980 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.RemoveAccessData", success, elapsed) 2981 } 2982 return resultVar0 2983 } 2984 2985 func (s *TimerLayerOAuthStore) RemoveAllAccessData() *model.AppError { 2986 start := timemodule.Now() 2987 2988 resultVar0 := s.OAuthStore.RemoveAllAccessData() 2989 2990 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 2991 if s.Root.Metrics != nil { 2992 success := "false" 2993 if resultVar0 == nil { 2994 success = "true" 2995 } 2996 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.RemoveAllAccessData", success, elapsed) 2997 } 2998 return resultVar0 2999 } 3000 3001 func (s *TimerLayerOAuthStore) RemoveAuthData(code string) *model.AppError { 3002 start := timemodule.Now() 3003 3004 resultVar0 := s.OAuthStore.RemoveAuthData(code) 3005 3006 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3007 if s.Root.Metrics != nil { 3008 success := "false" 3009 if resultVar0 == nil { 3010 success = "true" 3011 } 3012 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.RemoveAuthData", success, elapsed) 3013 } 3014 return resultVar0 3015 } 3016 3017 func (s *TimerLayerOAuthStore) SaveAccessData(accessData *model.AccessData) (*model.AccessData, *model.AppError) { 3018 start := timemodule.Now() 3019 3020 resultVar0, resultVar1 := s.OAuthStore.SaveAccessData(accessData) 3021 3022 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3023 if s.Root.Metrics != nil { 3024 success := "false" 3025 if resultVar1 == nil { 3026 success = "true" 3027 } 3028 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.SaveAccessData", success, elapsed) 3029 } 3030 return resultVar0, resultVar1 3031 } 3032 3033 func (s *TimerLayerOAuthStore) SaveApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) { 3034 start := timemodule.Now() 3035 3036 resultVar0, resultVar1 := s.OAuthStore.SaveApp(app) 3037 3038 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3039 if s.Root.Metrics != nil { 3040 success := "false" 3041 if resultVar1 == nil { 3042 success = "true" 3043 } 3044 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.SaveApp", success, elapsed) 3045 } 3046 return resultVar0, resultVar1 3047 } 3048 3049 func (s *TimerLayerOAuthStore) SaveAuthData(authData *model.AuthData) (*model.AuthData, *model.AppError) { 3050 start := timemodule.Now() 3051 3052 resultVar0, resultVar1 := s.OAuthStore.SaveAuthData(authData) 3053 3054 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3055 if s.Root.Metrics != nil { 3056 success := "false" 3057 if resultVar1 == nil { 3058 success = "true" 3059 } 3060 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.SaveAuthData", success, elapsed) 3061 } 3062 return resultVar0, resultVar1 3063 } 3064 3065 func (s *TimerLayerOAuthStore) UpdateAccessData(accessData *model.AccessData) (*model.AccessData, *model.AppError) { 3066 start := timemodule.Now() 3067 3068 resultVar0, resultVar1 := s.OAuthStore.UpdateAccessData(accessData) 3069 3070 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3071 if s.Root.Metrics != nil { 3072 success := "false" 3073 if resultVar1 == nil { 3074 success = "true" 3075 } 3076 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.UpdateAccessData", success, elapsed) 3077 } 3078 return resultVar0, resultVar1 3079 } 3080 3081 func (s *TimerLayerOAuthStore) UpdateApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) { 3082 start := timemodule.Now() 3083 3084 resultVar0, resultVar1 := s.OAuthStore.UpdateApp(app) 3085 3086 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3087 if s.Root.Metrics != nil { 3088 success := "false" 3089 if resultVar1 == nil { 3090 success = "true" 3091 } 3092 s.Root.Metrics.ObserveStoreMethodDuration("OAuthStore.UpdateApp", success, elapsed) 3093 } 3094 return resultVar0, resultVar1 3095 } 3096 3097 func (s *TimerLayerPostStore) AnalyticsPostCount(branchId string, mustHaveFile bool, mustHaveHashtag bool) (int64, *model.AppError) { 3098 start := timemodule.Now() 3099 3100 resultVar0, resultVar1 := s.PostStore.AnalyticsPostCount(branchId, mustHaveFile, mustHaveHashtag) 3101 3102 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3103 if s.Root.Metrics != nil { 3104 success := "false" 3105 if resultVar1 == nil { 3106 success = "true" 3107 } 3108 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.AnalyticsPostCount", success, elapsed) 3109 } 3110 return resultVar0, resultVar1 3111 } 3112 3113 func (s *TimerLayerPostStore) AnalyticsPostCountsByDay(options *model.AnalyticsPostCountsOptions) (model.AnalyticsRows, *model.AppError) { 3114 start := timemodule.Now() 3115 3116 resultVar0, resultVar1 := s.PostStore.AnalyticsPostCountsByDay(options) 3117 3118 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3119 if s.Root.Metrics != nil { 3120 success := "false" 3121 if resultVar1 == nil { 3122 success = "true" 3123 } 3124 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.AnalyticsPostCountsByDay", success, elapsed) 3125 } 3126 return resultVar0, resultVar1 3127 } 3128 3129 func (s *TimerLayerPostStore) AnalyticsUserCountsWithPostsByDay(branchId string) (model.AnalyticsRows, *model.AppError) { 3130 start := timemodule.Now() 3131 3132 resultVar0, resultVar1 := s.PostStore.AnalyticsUserCountsWithPostsByDay(branchId) 3133 3134 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3135 if s.Root.Metrics != nil { 3136 success := "false" 3137 if resultVar1 == nil { 3138 success = "true" 3139 } 3140 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.AnalyticsUserCountsWithPostsByDay", success, elapsed) 3141 } 3142 return resultVar0, resultVar1 3143 } 3144 3145 func (s *TimerLayerPostStore) ClearCaches() { 3146 start := timemodule.Now() 3147 3148 s.PostStore.ClearCaches() 3149 3150 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3151 if s.Root.Metrics != nil { 3152 success := "false" 3153 if true { 3154 success = "true" 3155 } 3156 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.ClearCaches", success, elapsed) 3157 } 3158 } 3159 3160 func (s *TimerLayerPostStore) Delete(postId string, time int64, deleteByID string) *model.AppError { 3161 start := timemodule.Now() 3162 3163 resultVar0 := s.PostStore.Delete(postId, time, deleteByID) 3164 3165 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3166 if s.Root.Metrics != nil { 3167 success := "false" 3168 if resultVar0 == nil { 3169 success = "true" 3170 } 3171 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.Delete", success, elapsed) 3172 } 3173 return resultVar0 3174 } 3175 3176 func (s *TimerLayerPostStore) Get(id string, skipFetchThreads bool) (*model.PostList, *model.AppError) { 3177 start := timemodule.Now() 3178 3179 resultVar0, resultVar1 := s.PostStore.Get(id, skipFetchThreads) 3180 3181 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3182 if s.Root.Metrics != nil { 3183 success := "false" 3184 if resultVar1 == nil { 3185 success = "true" 3186 } 3187 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.Get", success, elapsed) 3188 } 3189 return resultVar0, resultVar1 3190 } 3191 3192 func (s *TimerLayerPostStore) GetEtag(classId string, allowFromCache bool) string { 3193 start := timemodule.Now() 3194 3195 resultVar0 := s.PostStore.GetEtag(classId, allowFromCache) 3196 3197 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3198 if s.Root.Metrics != nil { 3199 success := "false" 3200 if true { 3201 success = "true" 3202 } 3203 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetEtag", success, elapsed) 3204 } 3205 return resultVar0 3206 } 3207 3208 func (s *TimerLayerPostStore) GetFlaggedPosts(userId string, offset int, limit int) (*model.PostList, *model.AppError) { 3209 start := timemodule.Now() 3210 3211 resultVar0, resultVar1 := s.PostStore.GetFlaggedPosts(userId, offset, limit) 3212 3213 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3214 if s.Root.Metrics != nil { 3215 success := "false" 3216 if resultVar1 == nil { 3217 success = "true" 3218 } 3219 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetFlaggedPosts", success, elapsed) 3220 } 3221 return resultVar0, resultVar1 3222 } 3223 3224 func (s *TimerLayerPostStore) GetFlaggedPostsForBranch(userId string, branchId string, offset int, limit int) (*model.PostList, *model.AppError) { 3225 start := timemodule.Now() 3226 3227 resultVar0, resultVar1 := s.PostStore.GetFlaggedPostsForBranch(userId, branchId, offset, limit) 3228 3229 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3230 if s.Root.Metrics != nil { 3231 success := "false" 3232 if resultVar1 == nil { 3233 success = "true" 3234 } 3235 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetFlaggedPostsForBranch", success, elapsed) 3236 } 3237 return resultVar0, resultVar1 3238 } 3239 3240 func (s *TimerLayerPostStore) GetFlaggedPostsForClass(userId string, classId string, offset int, limit int) (*model.PostList, *model.AppError) { 3241 start := timemodule.Now() 3242 3243 resultVar0, resultVar1 := s.PostStore.GetFlaggedPostsForClass(userId, classId, offset, limit) 3244 3245 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3246 if s.Root.Metrics != nil { 3247 success := "false" 3248 if resultVar1 == nil { 3249 success = "true" 3250 } 3251 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetFlaggedPostsForClass", success, elapsed) 3252 } 3253 return resultVar0, resultVar1 3254 } 3255 3256 func (s *TimerLayerPostStore) GetMaxPostSize() int { 3257 start := timemodule.Now() 3258 3259 resultVar0 := s.PostStore.GetMaxPostSize() 3260 3261 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3262 if s.Root.Metrics != nil { 3263 success := "false" 3264 if true { 3265 success = "true" 3266 } 3267 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetMaxPostSize", success, elapsed) 3268 } 3269 return resultVar0 3270 } 3271 3272 func (s *TimerLayerPostStore) GetOldest() (*model.Post, *model.AppError) { 3273 start := timemodule.Now() 3274 3275 resultVar0, resultVar1 := s.PostStore.GetOldest() 3276 3277 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3278 if s.Root.Metrics != nil { 3279 success := "false" 3280 if resultVar1 == nil { 3281 success = "true" 3282 } 3283 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetOldest", success, elapsed) 3284 } 3285 return resultVar0, resultVar1 3286 } 3287 3288 func (s *TimerLayerPostStore) GetPostAfterTime(classId string, time int64) (*model.Post, *model.AppError) { 3289 start := timemodule.Now() 3290 3291 resultVar0, resultVar1 := s.PostStore.GetPostAfterTime(classId, time) 3292 3293 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3294 if s.Root.Metrics != nil { 3295 success := "false" 3296 if resultVar1 == nil { 3297 success = "true" 3298 } 3299 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostAfterTime", success, elapsed) 3300 } 3301 return resultVar0, resultVar1 3302 } 3303 3304 func (s *TimerLayerPostStore) GetPostIdAfterTime(classId string, time int64) (string, *model.AppError) { 3305 start := timemodule.Now() 3306 3307 resultVar0, resultVar1 := s.PostStore.GetPostIdAfterTime(classId, time) 3308 3309 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3310 if s.Root.Metrics != nil { 3311 success := "false" 3312 if resultVar1 == nil { 3313 success = "true" 3314 } 3315 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostIdAfterTime", success, elapsed) 3316 } 3317 return resultVar0, resultVar1 3318 } 3319 3320 func (s *TimerLayerPostStore) GetPostIdBeforeTime(classId string, time int64) (string, *model.AppError) { 3321 start := timemodule.Now() 3322 3323 resultVar0, resultVar1 := s.PostStore.GetPostIdBeforeTime(classId, time) 3324 3325 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3326 if s.Root.Metrics != nil { 3327 success := "false" 3328 if resultVar1 == nil { 3329 success = "true" 3330 } 3331 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostIdBeforeTime", success, elapsed) 3332 } 3333 return resultVar0, resultVar1 3334 } 3335 3336 func (s *TimerLayerPostStore) GetPosts(options model.GetPostsOptions, allowFromCache bool) (*model.PostList, *model.AppError) { 3337 start := timemodule.Now() 3338 3339 resultVar0, resultVar1 := s.PostStore.GetPosts(options, allowFromCache) 3340 3341 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3342 if s.Root.Metrics != nil { 3343 success := "false" 3344 if resultVar1 == nil { 3345 success = "true" 3346 } 3347 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPosts", success, elapsed) 3348 } 3349 return resultVar0, resultVar1 3350 } 3351 3352 func (s *TimerLayerPostStore) GetPostsAfter(options model.GetPostsOptions) (*model.PostList, *model.AppError) { 3353 start := timemodule.Now() 3354 3355 resultVar0, resultVar1 := s.PostStore.GetPostsAfter(options) 3356 3357 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3358 if s.Root.Metrics != nil { 3359 success := "false" 3360 if resultVar1 == nil { 3361 success = "true" 3362 } 3363 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostsAfter", success, elapsed) 3364 } 3365 return resultVar0, resultVar1 3366 } 3367 3368 func (s *TimerLayerPostStore) GetPostsBatchForIndexing(startTime int64, endTime int64, limit int) ([]*model.PostForIndexing, *model.AppError) { 3369 start := timemodule.Now() 3370 3371 resultVar0, resultVar1 := s.PostStore.GetPostsBatchForIndexing(startTime, endTime, limit) 3372 3373 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3374 if s.Root.Metrics != nil { 3375 success := "false" 3376 if resultVar1 == nil { 3377 success = "true" 3378 } 3379 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostsBatchForIndexing", success, elapsed) 3380 } 3381 return resultVar0, resultVar1 3382 } 3383 3384 func (s *TimerLayerPostStore) GetPostsBefore(options model.GetPostsOptions) (*model.PostList, *model.AppError) { 3385 start := timemodule.Now() 3386 3387 resultVar0, resultVar1 := s.PostStore.GetPostsBefore(options) 3388 3389 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3390 if s.Root.Metrics != nil { 3391 success := "false" 3392 if resultVar1 == nil { 3393 success = "true" 3394 } 3395 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostsBefore", success, elapsed) 3396 } 3397 return resultVar0, resultVar1 3398 } 3399 3400 func (s *TimerLayerPostStore) GetPostsByIds(postIds []string) ([]*model.Post, *model.AppError) { 3401 start := timemodule.Now() 3402 3403 resultVar0, resultVar1 := s.PostStore.GetPostsByIds(postIds) 3404 3405 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3406 if s.Root.Metrics != nil { 3407 success := "false" 3408 if resultVar1 == nil { 3409 success = "true" 3410 } 3411 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostsByIds", success, elapsed) 3412 } 3413 return resultVar0, resultVar1 3414 } 3415 3416 func (s *TimerLayerPostStore) GetPostsCreatedAt(classId string, time int64) ([]*model.Post, *model.AppError) { 3417 start := timemodule.Now() 3418 3419 resultVar0, resultVar1 := s.PostStore.GetPostsCreatedAt(classId, time) 3420 3421 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3422 if s.Root.Metrics != nil { 3423 success := "false" 3424 if resultVar1 == nil { 3425 success = "true" 3426 } 3427 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostsCreatedAt", success, elapsed) 3428 } 3429 return resultVar0, resultVar1 3430 } 3431 3432 func (s *TimerLayerPostStore) GetPostsSince(options model.GetPostsSinceOptions, allowFromCache bool) (*model.PostList, *model.AppError) { 3433 start := timemodule.Now() 3434 3435 resultVar0, resultVar1 := s.PostStore.GetPostsSince(options, allowFromCache) 3436 3437 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3438 if s.Root.Metrics != nil { 3439 success := "false" 3440 if resultVar1 == nil { 3441 success = "true" 3442 } 3443 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetPostsSince", success, elapsed) 3444 } 3445 return resultVar0, resultVar1 3446 } 3447 3448 func (s *TimerLayerPostStore) GetSingle(id string) (*model.Post, *model.AppError) { 3449 start := timemodule.Now() 3450 3451 resultVar0, resultVar1 := s.PostStore.GetSingle(id) 3452 3453 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3454 if s.Root.Metrics != nil { 3455 success := "false" 3456 if resultVar1 == nil { 3457 success = "true" 3458 } 3459 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.GetSingle", success, elapsed) 3460 } 3461 return resultVar0, resultVar1 3462 } 3463 3464 func (s *TimerLayerPostStore) InvalidateLastPostTimeCache(classId string) { 3465 start := timemodule.Now() 3466 3467 s.PostStore.InvalidateLastPostTimeCache(classId) 3468 3469 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3470 if s.Root.Metrics != nil { 3471 success := "false" 3472 if true { 3473 success = "true" 3474 } 3475 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.InvalidateLastPostTimeCache", success, elapsed) 3476 } 3477 } 3478 3479 func (s *TimerLayerPostStore) Overwrite(post *model.Post) (*model.Post, *model.AppError) { 3480 start := timemodule.Now() 3481 3482 resultVar0, resultVar1 := s.PostStore.Overwrite(post) 3483 3484 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3485 if s.Root.Metrics != nil { 3486 success := "false" 3487 if resultVar1 == nil { 3488 success = "true" 3489 } 3490 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.Overwrite", success, elapsed) 3491 } 3492 return resultVar0, resultVar1 3493 } 3494 3495 func (s *TimerLayerPostStore) OverwriteMultiple(posts []*model.Post) ([]*model.Post, *model.AppError) { 3496 start := timemodule.Now() 3497 3498 resultVar0, resultVar1 := s.PostStore.OverwriteMultiple(posts) 3499 3500 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3501 if s.Root.Metrics != nil { 3502 success := "false" 3503 if resultVar1 == nil { 3504 success = "true" 3505 } 3506 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.OverwriteMultiple", success, elapsed) 3507 } 3508 return resultVar0, resultVar1 3509 } 3510 3511 func (s *TimerLayerPostStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, *model.AppError) { 3512 start := timemodule.Now() 3513 3514 resultVar0, resultVar1 := s.PostStore.PermanentDeleteBatch(endTime, limit) 3515 3516 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3517 if s.Root.Metrics != nil { 3518 success := "false" 3519 if resultVar1 == nil { 3520 success = "true" 3521 } 3522 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.PermanentDeleteBatch", success, elapsed) 3523 } 3524 return resultVar0, resultVar1 3525 } 3526 3527 func (s *TimerLayerPostStore) PermanentDeleteByClass(classId string) *model.AppError { 3528 start := timemodule.Now() 3529 3530 resultVar0 := s.PostStore.PermanentDeleteByClass(classId) 3531 3532 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3533 if s.Root.Metrics != nil { 3534 success := "false" 3535 if resultVar0 == nil { 3536 success = "true" 3537 } 3538 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.PermanentDeleteByClass", success, elapsed) 3539 } 3540 return resultVar0 3541 } 3542 3543 func (s *TimerLayerPostStore) PermanentDeleteByUser(userId string) *model.AppError { 3544 start := timemodule.Now() 3545 3546 resultVar0 := s.PostStore.PermanentDeleteByUser(userId) 3547 3548 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3549 if s.Root.Metrics != nil { 3550 success := "false" 3551 if resultVar0 == nil { 3552 success = "true" 3553 } 3554 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.PermanentDeleteByUser", success, elapsed) 3555 } 3556 return resultVar0 3557 } 3558 3559 func (s *TimerLayerPostStore) Save(post *model.Post) (*model.Post, *model.AppError) { 3560 start := timemodule.Now() 3561 3562 resultVar0, resultVar1 := s.PostStore.Save(post) 3563 3564 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3565 if s.Root.Metrics != nil { 3566 success := "false" 3567 if resultVar1 == nil { 3568 success = "true" 3569 } 3570 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.Save", success, elapsed) 3571 } 3572 return resultVar0, resultVar1 3573 } 3574 3575 func (s *TimerLayerPostStore) SaveMultiple(posts []*model.Post) ([]*model.Post, *model.AppError) { 3576 start := timemodule.Now() 3577 3578 resultVar0, resultVar1 := s.PostStore.SaveMultiple(posts) 3579 3580 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3581 if s.Root.Metrics != nil { 3582 success := "false" 3583 if resultVar1 == nil { 3584 success = "true" 3585 } 3586 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.SaveMultiple", success, elapsed) 3587 } 3588 return resultVar0, resultVar1 3589 } 3590 3591 func (s *TimerLayerPostStore) Search(branchId string, userId string, params *model.SearchParams) (*model.PostList, *model.AppError) { 3592 start := timemodule.Now() 3593 3594 resultVar0, resultVar1 := s.PostStore.Search(branchId, userId, params) 3595 3596 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3597 if s.Root.Metrics != nil { 3598 success := "false" 3599 if resultVar1 == nil { 3600 success = "true" 3601 } 3602 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.Search", success, elapsed) 3603 } 3604 return resultVar0, resultVar1 3605 } 3606 3607 func (s *TimerLayerPostStore) Update(newPost *model.Post, oldPost *model.Post) (*model.Post, *model.AppError) { 3608 start := timemodule.Now() 3609 3610 resultVar0, resultVar1 := s.PostStore.Update(newPost, oldPost) 3611 3612 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3613 if s.Root.Metrics != nil { 3614 success := "false" 3615 if resultVar1 == nil { 3616 success = "true" 3617 } 3618 s.Root.Metrics.ObserveStoreMethodDuration("PostStore.Update", success, elapsed) 3619 } 3620 return resultVar0, resultVar1 3621 } 3622 3623 func (s *TimerLayerPreferenceStore) CleanupFlagsBatch(limit int64) (int64, *model.AppError) { 3624 start := timemodule.Now() 3625 3626 resultVar0, resultVar1 := s.PreferenceStore.CleanupFlagsBatch(limit) 3627 3628 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3629 if s.Root.Metrics != nil { 3630 success := "false" 3631 if resultVar1 == nil { 3632 success = "true" 3633 } 3634 s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.CleanupFlagsBatch", success, elapsed) 3635 } 3636 return resultVar0, resultVar1 3637 } 3638 3639 func (s *TimerLayerPreferenceStore) Delete(userId string, category string, name string) *model.AppError { 3640 start := timemodule.Now() 3641 3642 resultVar0 := s.PreferenceStore.Delete(userId, category, name) 3643 3644 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3645 if s.Root.Metrics != nil { 3646 success := "false" 3647 if resultVar0 == nil { 3648 success = "true" 3649 } 3650 s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.Delete", success, elapsed) 3651 } 3652 return resultVar0 3653 } 3654 3655 func (s *TimerLayerPreferenceStore) DeleteCategory(userId string, category string) *model.AppError { 3656 start := timemodule.Now() 3657 3658 resultVar0 := s.PreferenceStore.DeleteCategory(userId, category) 3659 3660 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3661 if s.Root.Metrics != nil { 3662 success := "false" 3663 if resultVar0 == nil { 3664 success = "true" 3665 } 3666 s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.DeleteCategory", success, elapsed) 3667 } 3668 return resultVar0 3669 } 3670 3671 func (s *TimerLayerPreferenceStore) DeleteCategoryAndName(category string, name string) *model.AppError { 3672 start := timemodule.Now() 3673 3674 resultVar0 := s.PreferenceStore.DeleteCategoryAndName(category, name) 3675 3676 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3677 if s.Root.Metrics != nil { 3678 success := "false" 3679 if resultVar0 == nil { 3680 success = "true" 3681 } 3682 s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.DeleteCategoryAndName", success, elapsed) 3683 } 3684 return resultVar0 3685 } 3686 3687 func (s *TimerLayerPreferenceStore) Get(userId string, category string, name string) (*model.Preference, *model.AppError) { 3688 start := timemodule.Now() 3689 3690 resultVar0, resultVar1 := s.PreferenceStore.Get(userId, category, name) 3691 3692 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3693 if s.Root.Metrics != nil { 3694 success := "false" 3695 if resultVar1 == nil { 3696 success = "true" 3697 } 3698 s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.Get", success, elapsed) 3699 } 3700 return resultVar0, resultVar1 3701 } 3702 3703 func (s *TimerLayerPreferenceStore) GetAll(userId string) (model.Preferences, *model.AppError) { 3704 start := timemodule.Now() 3705 3706 resultVar0, resultVar1 := s.PreferenceStore.GetAll(userId) 3707 3708 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3709 if s.Root.Metrics != nil { 3710 success := "false" 3711 if resultVar1 == nil { 3712 success = "true" 3713 } 3714 s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.GetAll", success, elapsed) 3715 } 3716 return resultVar0, resultVar1 3717 } 3718 3719 func (s *TimerLayerPreferenceStore) GetCategory(userId string, category string) (model.Preferences, *model.AppError) { 3720 start := timemodule.Now() 3721 3722 resultVar0, resultVar1 := s.PreferenceStore.GetCategory(userId, category) 3723 3724 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3725 if s.Root.Metrics != nil { 3726 success := "false" 3727 if resultVar1 == nil { 3728 success = "true" 3729 } 3730 s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.GetCategory", success, elapsed) 3731 } 3732 return resultVar0, resultVar1 3733 } 3734 3735 func (s *TimerLayerPreferenceStore) PermanentDeleteByUser(userId string) *model.AppError { 3736 start := timemodule.Now() 3737 3738 resultVar0 := s.PreferenceStore.PermanentDeleteByUser(userId) 3739 3740 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3741 if s.Root.Metrics != nil { 3742 success := "false" 3743 if resultVar0 == nil { 3744 success = "true" 3745 } 3746 s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.PermanentDeleteByUser", success, elapsed) 3747 } 3748 return resultVar0 3749 } 3750 3751 func (s *TimerLayerPreferenceStore) Save(preferences *model.Preferences) *model.AppError { 3752 start := timemodule.Now() 3753 3754 resultVar0 := s.PreferenceStore.Save(preferences) 3755 3756 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3757 if s.Root.Metrics != nil { 3758 success := "false" 3759 if resultVar0 == nil { 3760 success = "true" 3761 } 3762 s.Root.Metrics.ObserveStoreMethodDuration("PreferenceStore.Save", success, elapsed) 3763 } 3764 return resultVar0 3765 } 3766 3767 func (s *TimerLayerReactionStore) BulkGetForPosts(postIds []string) ([]*model.Reaction, *model.AppError) { 3768 start := timemodule.Now() 3769 3770 resultVar0, resultVar1 := s.ReactionStore.BulkGetForPosts(postIds) 3771 3772 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3773 if s.Root.Metrics != nil { 3774 success := "false" 3775 if resultVar1 == nil { 3776 success = "true" 3777 } 3778 s.Root.Metrics.ObserveStoreMethodDuration("ReactionStore.BulkGetForPosts", success, elapsed) 3779 } 3780 return resultVar0, resultVar1 3781 } 3782 3783 func (s *TimerLayerReactionStore) Delete(reaction *model.Reaction) (*model.Reaction, *model.AppError) { 3784 start := timemodule.Now() 3785 3786 resultVar0, resultVar1 := s.ReactionStore.Delete(reaction) 3787 3788 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3789 if s.Root.Metrics != nil { 3790 success := "false" 3791 if resultVar1 == nil { 3792 success = "true" 3793 } 3794 s.Root.Metrics.ObserveStoreMethodDuration("ReactionStore.Delete", success, elapsed) 3795 } 3796 return resultVar0, resultVar1 3797 } 3798 3799 func (s *TimerLayerReactionStore) DeleteAllWithEmojiName(emojiName string) *model.AppError { 3800 start := timemodule.Now() 3801 3802 resultVar0 := s.ReactionStore.DeleteAllWithEmojiName(emojiName) 3803 3804 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3805 if s.Root.Metrics != nil { 3806 success := "false" 3807 if resultVar0 == nil { 3808 success = "true" 3809 } 3810 s.Root.Metrics.ObserveStoreMethodDuration("ReactionStore.DeleteAllWithEmojiName", success, elapsed) 3811 } 3812 return resultVar0 3813 } 3814 3815 func (s *TimerLayerReactionStore) GetForPost(postId string, allowFromCache bool) ([]*model.Reaction, *model.AppError) { 3816 start := timemodule.Now() 3817 3818 resultVar0, resultVar1 := s.ReactionStore.GetForPost(postId, allowFromCache) 3819 3820 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3821 if s.Root.Metrics != nil { 3822 success := "false" 3823 if resultVar1 == nil { 3824 success = "true" 3825 } 3826 s.Root.Metrics.ObserveStoreMethodDuration("ReactionStore.GetForPost", success, elapsed) 3827 } 3828 return resultVar0, resultVar1 3829 } 3830 3831 func (s *TimerLayerReactionStore) PermanentDeleteBatch(endTime int64, limit int64) (int64, *model.AppError) { 3832 start := timemodule.Now() 3833 3834 resultVar0, resultVar1 := s.ReactionStore.PermanentDeleteBatch(endTime, limit) 3835 3836 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3837 if s.Root.Metrics != nil { 3838 success := "false" 3839 if resultVar1 == nil { 3840 success = "true" 3841 } 3842 s.Root.Metrics.ObserveStoreMethodDuration("ReactionStore.PermanentDeleteBatch", success, elapsed) 3843 } 3844 return resultVar0, resultVar1 3845 } 3846 3847 func (s *TimerLayerReactionStore) Save(reaction *model.Reaction) (*model.Reaction, *model.AppError) { 3848 start := timemodule.Now() 3849 3850 resultVar0, resultVar1 := s.ReactionStore.Save(reaction) 3851 3852 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3853 if s.Root.Metrics != nil { 3854 success := "false" 3855 if resultVar1 == nil { 3856 success = "true" 3857 } 3858 s.Root.Metrics.ObserveStoreMethodDuration("ReactionStore.Save", success, elapsed) 3859 } 3860 return resultVar0, resultVar1 3861 } 3862 3863 func (s *TimerLayerRoleStore) AllClassSchemeRoles() ([]*model.Role, *model.AppError) { 3864 start := timemodule.Now() 3865 3866 resultVar0, resultVar1 := s.RoleStore.AllClassSchemeRoles() 3867 3868 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3869 if s.Root.Metrics != nil { 3870 success := "false" 3871 if resultVar1 == nil { 3872 success = "true" 3873 } 3874 s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.AllClassSchemeRoles", success, elapsed) 3875 } 3876 return resultVar0, resultVar1 3877 } 3878 3879 func (s *TimerLayerRoleStore) ClassHigherScopedPermissions(roleNames []string) (map[string]*model.RolePermissions, *model.AppError) { 3880 start := timemodule.Now() 3881 3882 resultVar0, resultVar1 := s.RoleStore.ClassHigherScopedPermissions(roleNames) 3883 3884 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3885 if s.Root.Metrics != nil { 3886 success := "false" 3887 if resultVar1 == nil { 3888 success = "true" 3889 } 3890 s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.ClassHigherScopedPermissions", success, elapsed) 3891 } 3892 return resultVar0, resultVar1 3893 } 3894 3895 func (s *TimerLayerRoleStore) ClassRolesUnderBranchRole(roleName string) ([]*model.Role, *model.AppError) { 3896 start := timemodule.Now() 3897 3898 resultVar0, resultVar1 := s.RoleStore.ClassRolesUnderBranchRole(roleName) 3899 3900 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3901 if s.Root.Metrics != nil { 3902 success := "false" 3903 if resultVar1 == nil { 3904 success = "true" 3905 } 3906 s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.ClassRolesUnderBranchRole", success, elapsed) 3907 } 3908 return resultVar0, resultVar1 3909 } 3910 3911 func (s *TimerLayerRoleStore) Delete(roleId string) (*model.Role, *model.AppError) { 3912 start := timemodule.Now() 3913 3914 resultVar0, resultVar1 := s.RoleStore.Delete(roleId) 3915 3916 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3917 if s.Root.Metrics != nil { 3918 success := "false" 3919 if resultVar1 == nil { 3920 success = "true" 3921 } 3922 s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.Delete", success, elapsed) 3923 } 3924 return resultVar0, resultVar1 3925 } 3926 3927 func (s *TimerLayerRoleStore) Get(roleId string) (*model.Role, *model.AppError) { 3928 start := timemodule.Now() 3929 3930 resultVar0, resultVar1 := s.RoleStore.Get(roleId) 3931 3932 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3933 if s.Root.Metrics != nil { 3934 success := "false" 3935 if resultVar1 == nil { 3936 success = "true" 3937 } 3938 s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.Get", success, elapsed) 3939 } 3940 return resultVar0, resultVar1 3941 } 3942 3943 func (s *TimerLayerRoleStore) GetAll() ([]*model.Role, *model.AppError) { 3944 start := timemodule.Now() 3945 3946 resultVar0, resultVar1 := s.RoleStore.GetAll() 3947 3948 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3949 if s.Root.Metrics != nil { 3950 success := "false" 3951 if resultVar1 == nil { 3952 success = "true" 3953 } 3954 s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.GetAll", success, elapsed) 3955 } 3956 return resultVar0, resultVar1 3957 } 3958 3959 func (s *TimerLayerRoleStore) GetByName(name string) (*model.Role, *model.AppError) { 3960 start := timemodule.Now() 3961 3962 resultVar0, resultVar1 := s.RoleStore.GetByName(name) 3963 3964 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3965 if s.Root.Metrics != nil { 3966 success := "false" 3967 if resultVar1 == nil { 3968 success = "true" 3969 } 3970 s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.GetByName", success, elapsed) 3971 } 3972 return resultVar0, resultVar1 3973 } 3974 3975 func (s *TimerLayerRoleStore) GetByNames(names []string) ([]*model.Role, *model.AppError) { 3976 start := timemodule.Now() 3977 3978 resultVar0, resultVar1 := s.RoleStore.GetByNames(names) 3979 3980 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3981 if s.Root.Metrics != nil { 3982 success := "false" 3983 if resultVar1 == nil { 3984 success = "true" 3985 } 3986 s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.GetByNames", success, elapsed) 3987 } 3988 return resultVar0, resultVar1 3989 } 3990 3991 func (s *TimerLayerRoleStore) PermanentDeleteAll() *model.AppError { 3992 start := timemodule.Now() 3993 3994 resultVar0 := s.RoleStore.PermanentDeleteAll() 3995 3996 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 3997 if s.Root.Metrics != nil { 3998 success := "false" 3999 if resultVar0 == nil { 4000 success = "true" 4001 } 4002 s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.PermanentDeleteAll", success, elapsed) 4003 } 4004 return resultVar0 4005 } 4006 4007 func (s *TimerLayerRoleStore) Save(role *model.Role) (*model.Role, *model.AppError) { 4008 start := timemodule.Now() 4009 4010 resultVar0, resultVar1 := s.RoleStore.Save(role) 4011 4012 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4013 if s.Root.Metrics != nil { 4014 success := "false" 4015 if resultVar1 == nil { 4016 success = "true" 4017 } 4018 s.Root.Metrics.ObserveStoreMethodDuration("RoleStore.Save", success, elapsed) 4019 } 4020 return resultVar0, resultVar1 4021 } 4022 4023 func (s *TimerLayerSchemeStore) CountByScope(scope string) (int64, *model.AppError) { 4024 start := timemodule.Now() 4025 4026 resultVar0, resultVar1 := s.SchemeStore.CountByScope(scope) 4027 4028 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4029 if s.Root.Metrics != nil { 4030 success := "false" 4031 if resultVar1 == nil { 4032 success = "true" 4033 } 4034 s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.CountByScope", success, elapsed) 4035 } 4036 return resultVar0, resultVar1 4037 } 4038 4039 func (s *TimerLayerSchemeStore) CountWithoutPermission(scope string, permissionID string, roleScope model.RoleScope, roleType model.RoleType) (int64, *model.AppError) { 4040 start := timemodule.Now() 4041 4042 resultVar0, resultVar1 := s.SchemeStore.CountWithoutPermission(scope, permissionID, roleScope, roleType) 4043 4044 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4045 if s.Root.Metrics != nil { 4046 success := "false" 4047 if resultVar1 == nil { 4048 success = "true" 4049 } 4050 s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.CountWithoutPermission", success, elapsed) 4051 } 4052 return resultVar0, resultVar1 4053 } 4054 4055 func (s *TimerLayerSchemeStore) Delete(schemeId string) (*model.Scheme, *model.AppError) { 4056 start := timemodule.Now() 4057 4058 resultVar0, resultVar1 := s.SchemeStore.Delete(schemeId) 4059 4060 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4061 if s.Root.Metrics != nil { 4062 success := "false" 4063 if resultVar1 == nil { 4064 success = "true" 4065 } 4066 s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.Delete", success, elapsed) 4067 } 4068 return resultVar0, resultVar1 4069 } 4070 4071 func (s *TimerLayerSchemeStore) Get(schemeId string) (*model.Scheme, *model.AppError) { 4072 start := timemodule.Now() 4073 4074 resultVar0, resultVar1 := s.SchemeStore.Get(schemeId) 4075 4076 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4077 if s.Root.Metrics != nil { 4078 success := "false" 4079 if resultVar1 == nil { 4080 success = "true" 4081 } 4082 s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.Get", success, elapsed) 4083 } 4084 return resultVar0, resultVar1 4085 } 4086 4087 func (s *TimerLayerSchemeStore) GetAllPage(scope string, offset int, limit int) ([]*model.Scheme, *model.AppError) { 4088 start := timemodule.Now() 4089 4090 resultVar0, resultVar1 := s.SchemeStore.GetAllPage(scope, offset, limit) 4091 4092 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4093 if s.Root.Metrics != nil { 4094 success := "false" 4095 if resultVar1 == nil { 4096 success = "true" 4097 } 4098 s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.GetAllPage", success, elapsed) 4099 } 4100 return resultVar0, resultVar1 4101 } 4102 4103 func (s *TimerLayerSchemeStore) GetByName(schemeName string) (*model.Scheme, *model.AppError) { 4104 start := timemodule.Now() 4105 4106 resultVar0, resultVar1 := s.SchemeStore.GetByName(schemeName) 4107 4108 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4109 if s.Root.Metrics != nil { 4110 success := "false" 4111 if resultVar1 == nil { 4112 success = "true" 4113 } 4114 s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.GetByName", success, elapsed) 4115 } 4116 return resultVar0, resultVar1 4117 } 4118 4119 func (s *TimerLayerSchemeStore) PermanentDeleteAll() *model.AppError { 4120 start := timemodule.Now() 4121 4122 resultVar0 := s.SchemeStore.PermanentDeleteAll() 4123 4124 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4125 if s.Root.Metrics != nil { 4126 success := "false" 4127 if resultVar0 == nil { 4128 success = "true" 4129 } 4130 s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.PermanentDeleteAll", success, elapsed) 4131 } 4132 return resultVar0 4133 } 4134 4135 func (s *TimerLayerSchemeStore) Save(scheme *model.Scheme) (*model.Scheme, *model.AppError) { 4136 start := timemodule.Now() 4137 4138 resultVar0, resultVar1 := s.SchemeStore.Save(scheme) 4139 4140 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4141 if s.Root.Metrics != nil { 4142 success := "false" 4143 if resultVar1 == nil { 4144 success = "true" 4145 } 4146 s.Root.Metrics.ObserveStoreMethodDuration("SchemeStore.Save", success, elapsed) 4147 } 4148 return resultVar0, resultVar1 4149 } 4150 4151 func (s *TimerLayerSessionStore) AnalyticsSessionCount() (int64, *model.AppError) { 4152 start := timemodule.Now() 4153 4154 resultVar0, resultVar1 := s.SessionStore.AnalyticsSessionCount() 4155 4156 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4157 if s.Root.Metrics != nil { 4158 success := "false" 4159 if resultVar1 == nil { 4160 success = "true" 4161 } 4162 s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.AnalyticsSessionCount", success, elapsed) 4163 } 4164 return resultVar0, resultVar1 4165 } 4166 4167 func (s *TimerLayerSessionStore) Cleanup(expiryTime int64, batchSize int64) { 4168 start := timemodule.Now() 4169 4170 s.SessionStore.Cleanup(expiryTime, batchSize) 4171 4172 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4173 if s.Root.Metrics != nil { 4174 success := "false" 4175 if true { 4176 success = "true" 4177 } 4178 s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.Cleanup", success, elapsed) 4179 } 4180 } 4181 4182 func (s *TimerLayerSessionStore) Get(sessionIdOrToken string) (*model.Session, *model.AppError) { 4183 start := timemodule.Now() 4184 4185 resultVar0, resultVar1 := s.SessionStore.Get(sessionIdOrToken) 4186 4187 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4188 if s.Root.Metrics != nil { 4189 success := "false" 4190 if resultVar1 == nil { 4191 success = "true" 4192 } 4193 s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.Get", success, elapsed) 4194 } 4195 return resultVar0, resultVar1 4196 } 4197 4198 func (s *TimerLayerSessionStore) GetSessions(userId string) ([]*model.Session, *model.AppError) { 4199 start := timemodule.Now() 4200 4201 resultVar0, resultVar1 := s.SessionStore.GetSessions(userId) 4202 4203 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4204 if s.Root.Metrics != nil { 4205 success := "false" 4206 if resultVar1 == nil { 4207 success = "true" 4208 } 4209 s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.GetSessions", success, elapsed) 4210 } 4211 return resultVar0, resultVar1 4212 } 4213 4214 func (s *TimerLayerSessionStore) GetSessionsWithActiveDeviceIds(userId string) ([]*model.Session, *model.AppError) { 4215 start := timemodule.Now() 4216 4217 resultVar0, resultVar1 := s.SessionStore.GetSessionsWithActiveDeviceIds(userId) 4218 4219 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4220 if s.Root.Metrics != nil { 4221 success := "false" 4222 if resultVar1 == nil { 4223 success = "true" 4224 } 4225 s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.GetSessionsWithActiveDeviceIds", success, elapsed) 4226 } 4227 return resultVar0, resultVar1 4228 } 4229 4230 func (s *TimerLayerSessionStore) PermanentDeleteSessionsByUser(branchId string) *model.AppError { 4231 start := timemodule.Now() 4232 4233 resultVar0 := s.SessionStore.PermanentDeleteSessionsByUser(branchId) 4234 4235 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4236 if s.Root.Metrics != nil { 4237 success := "false" 4238 if resultVar0 == nil { 4239 success = "true" 4240 } 4241 s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.PermanentDeleteSessionsByUser", success, elapsed) 4242 } 4243 return resultVar0 4244 } 4245 4246 func (s *TimerLayerSessionStore) Remove(sessionIdOrToken string) *model.AppError { 4247 start := timemodule.Now() 4248 4249 resultVar0 := s.SessionStore.Remove(sessionIdOrToken) 4250 4251 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4252 if s.Root.Metrics != nil { 4253 success := "false" 4254 if resultVar0 == nil { 4255 success = "true" 4256 } 4257 s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.Remove", success, elapsed) 4258 } 4259 return resultVar0 4260 } 4261 4262 func (s *TimerLayerSessionStore) RemoveAllSessions() *model.AppError { 4263 start := timemodule.Now() 4264 4265 resultVar0 := s.SessionStore.RemoveAllSessions() 4266 4267 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4268 if s.Root.Metrics != nil { 4269 success := "false" 4270 if resultVar0 == nil { 4271 success = "true" 4272 } 4273 s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.RemoveAllSessions", success, elapsed) 4274 } 4275 return resultVar0 4276 } 4277 4278 func (s *TimerLayerSessionStore) Save(session *model.Session) (*model.Session, *model.AppError) { 4279 start := timemodule.Now() 4280 4281 resultVar0, resultVar1 := s.SessionStore.Save(session) 4282 4283 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4284 if s.Root.Metrics != nil { 4285 success := "false" 4286 if resultVar1 == nil { 4287 success = "true" 4288 } 4289 s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.Save", success, elapsed) 4290 } 4291 return resultVar0, resultVar1 4292 } 4293 4294 func (s *TimerLayerSessionStore) UpdateDeviceId(id string, deviceId string, expiresAt int64) (string, *model.AppError) { 4295 start := timemodule.Now() 4296 4297 resultVar0, resultVar1 := s.SessionStore.UpdateDeviceId(id, deviceId, expiresAt) 4298 4299 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4300 if s.Root.Metrics != nil { 4301 success := "false" 4302 if resultVar1 == nil { 4303 success = "true" 4304 } 4305 s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.UpdateDeviceId", success, elapsed) 4306 } 4307 return resultVar0, resultVar1 4308 } 4309 4310 func (s *TimerLayerSessionStore) UpdateLastActivityAt(sessionId string, time int64) *model.AppError { 4311 start := timemodule.Now() 4312 4313 resultVar0 := s.SessionStore.UpdateLastActivityAt(sessionId, time) 4314 4315 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4316 if s.Root.Metrics != nil { 4317 success := "false" 4318 if resultVar0 == nil { 4319 success = "true" 4320 } 4321 s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.UpdateLastActivityAt", success, elapsed) 4322 } 4323 return resultVar0 4324 } 4325 4326 func (s *TimerLayerSessionStore) UpdateProps(session *model.Session) *model.AppError { 4327 start := timemodule.Now() 4328 4329 resultVar0 := s.SessionStore.UpdateProps(session) 4330 4331 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4332 if s.Root.Metrics != nil { 4333 success := "false" 4334 if resultVar0 == nil { 4335 success = "true" 4336 } 4337 s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.UpdateProps", success, elapsed) 4338 } 4339 return resultVar0 4340 } 4341 4342 func (s *TimerLayerSessionStore) UpdateRoles(userId string, roles string) (string, *model.AppError) { 4343 start := timemodule.Now() 4344 4345 resultVar0, resultVar1 := s.SessionStore.UpdateRoles(userId, roles) 4346 4347 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4348 if s.Root.Metrics != nil { 4349 success := "false" 4350 if resultVar1 == nil { 4351 success = "true" 4352 } 4353 s.Root.Metrics.ObserveStoreMethodDuration("SessionStore.UpdateRoles", success, elapsed) 4354 } 4355 return resultVar0, resultVar1 4356 } 4357 4358 func (s *TimerLayerStatusStore) Get(userId string) (*model.Status, *model.AppError) { 4359 start := timemodule.Now() 4360 4361 resultVar0, resultVar1 := s.StatusStore.Get(userId) 4362 4363 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4364 if s.Root.Metrics != nil { 4365 success := "false" 4366 if resultVar1 == nil { 4367 success = "true" 4368 } 4369 s.Root.Metrics.ObserveStoreMethodDuration("StatusStore.Get", success, elapsed) 4370 } 4371 return resultVar0, resultVar1 4372 } 4373 4374 func (s *TimerLayerStatusStore) GetByIds(userIds []string) ([]*model.Status, *model.AppError) { 4375 start := timemodule.Now() 4376 4377 resultVar0, resultVar1 := s.StatusStore.GetByIds(userIds) 4378 4379 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4380 if s.Root.Metrics != nil { 4381 success := "false" 4382 if resultVar1 == nil { 4383 success = "true" 4384 } 4385 s.Root.Metrics.ObserveStoreMethodDuration("StatusStore.GetByIds", success, elapsed) 4386 } 4387 return resultVar0, resultVar1 4388 } 4389 4390 func (s *TimerLayerStatusStore) GetTotalActiveUsersCount() (int64, *model.AppError) { 4391 start := timemodule.Now() 4392 4393 resultVar0, resultVar1 := s.StatusStore.GetTotalActiveUsersCount() 4394 4395 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4396 if s.Root.Metrics != nil { 4397 success := "false" 4398 if resultVar1 == nil { 4399 success = "true" 4400 } 4401 s.Root.Metrics.ObserveStoreMethodDuration("StatusStore.GetTotalActiveUsersCount", success, elapsed) 4402 } 4403 return resultVar0, resultVar1 4404 } 4405 4406 func (s *TimerLayerStatusStore) ResetAll() *model.AppError { 4407 start := timemodule.Now() 4408 4409 resultVar0 := s.StatusStore.ResetAll() 4410 4411 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4412 if s.Root.Metrics != nil { 4413 success := "false" 4414 if resultVar0 == nil { 4415 success = "true" 4416 } 4417 s.Root.Metrics.ObserveStoreMethodDuration("StatusStore.ResetAll", success, elapsed) 4418 } 4419 return resultVar0 4420 } 4421 4422 func (s *TimerLayerStatusStore) SaveOrUpdate(status *model.Status) *model.AppError { 4423 start := timemodule.Now() 4424 4425 resultVar0 := s.StatusStore.SaveOrUpdate(status) 4426 4427 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4428 if s.Root.Metrics != nil { 4429 success := "false" 4430 if resultVar0 == nil { 4431 success = "true" 4432 } 4433 s.Root.Metrics.ObserveStoreMethodDuration("StatusStore.SaveOrUpdate", success, elapsed) 4434 } 4435 return resultVar0 4436 } 4437 4438 func (s *TimerLayerStatusStore) UpdateLastActivityAt(userId string, lastActivityAt int64) *model.AppError { 4439 start := timemodule.Now() 4440 4441 resultVar0 := s.StatusStore.UpdateLastActivityAt(userId, lastActivityAt) 4442 4443 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4444 if s.Root.Metrics != nil { 4445 success := "false" 4446 if resultVar0 == nil { 4447 success = "true" 4448 } 4449 s.Root.Metrics.ObserveStoreMethodDuration("StatusStore.UpdateLastActivityAt", success, elapsed) 4450 } 4451 return resultVar0 4452 } 4453 4454 func (s *TimerLayerSystemStore) Get() (model.StringMap, *model.AppError) { 4455 start := timemodule.Now() 4456 4457 resultVar0, resultVar1 := s.SystemStore.Get() 4458 4459 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4460 if s.Root.Metrics != nil { 4461 success := "false" 4462 if resultVar1 == nil { 4463 success = "true" 4464 } 4465 s.Root.Metrics.ObserveStoreMethodDuration("SystemStore.Get", success, elapsed) 4466 } 4467 return resultVar0, resultVar1 4468 } 4469 4470 func (s *TimerLayerSystemStore) GetByName(name string) (*model.System, *model.AppError) { 4471 start := timemodule.Now() 4472 4473 resultVar0, resultVar1 := s.SystemStore.GetByName(name) 4474 4475 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4476 if s.Root.Metrics != nil { 4477 success := "false" 4478 if resultVar1 == nil { 4479 success = "true" 4480 } 4481 s.Root.Metrics.ObserveStoreMethodDuration("SystemStore.GetByName", success, elapsed) 4482 } 4483 return resultVar0, resultVar1 4484 } 4485 4486 func (s *TimerLayerSystemStore) PermanentDeleteByName(name string) (*model.System, *model.AppError) { 4487 start := timemodule.Now() 4488 4489 resultVar0, resultVar1 := s.SystemStore.PermanentDeleteByName(name) 4490 4491 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4492 if s.Root.Metrics != nil { 4493 success := "false" 4494 if resultVar1 == nil { 4495 success = "true" 4496 } 4497 s.Root.Metrics.ObserveStoreMethodDuration("SystemStore.PermanentDeleteByName", success, elapsed) 4498 } 4499 return resultVar0, resultVar1 4500 } 4501 4502 func (s *TimerLayerSystemStore) Save(system *model.System) *model.AppError { 4503 start := timemodule.Now() 4504 4505 resultVar0 := s.SystemStore.Save(system) 4506 4507 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4508 if s.Root.Metrics != nil { 4509 success := "false" 4510 if resultVar0 == nil { 4511 success = "true" 4512 } 4513 s.Root.Metrics.ObserveStoreMethodDuration("SystemStore.Save", success, elapsed) 4514 } 4515 return resultVar0 4516 } 4517 4518 func (s *TimerLayerSystemStore) SaveOrUpdate(system *model.System) *model.AppError { 4519 start := timemodule.Now() 4520 4521 resultVar0 := s.SystemStore.SaveOrUpdate(system) 4522 4523 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4524 if s.Root.Metrics != nil { 4525 success := "false" 4526 if resultVar0 == nil { 4527 success = "true" 4528 } 4529 s.Root.Metrics.ObserveStoreMethodDuration("SystemStore.SaveOrUpdate", success, elapsed) 4530 } 4531 return resultVar0 4532 } 4533 4534 func (s *TimerLayerSystemStore) Update(system *model.System) *model.AppError { 4535 start := timemodule.Now() 4536 4537 resultVar0 := s.SystemStore.Update(system) 4538 4539 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4540 if s.Root.Metrics != nil { 4541 success := "false" 4542 if resultVar0 == nil { 4543 success = "true" 4544 } 4545 s.Root.Metrics.ObserveStoreMethodDuration("SystemStore.Update", success, elapsed) 4546 } 4547 return resultVar0 4548 } 4549 4550 func (s *TimerLayerTermsOfServiceStore) Get(id string, allowFromCache bool) (*model.TermsOfService, *model.AppError) { 4551 start := timemodule.Now() 4552 4553 resultVar0, resultVar1 := s.TermsOfServiceStore.Get(id, allowFromCache) 4554 4555 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4556 if s.Root.Metrics != nil { 4557 success := "false" 4558 if resultVar1 == nil { 4559 success = "true" 4560 } 4561 s.Root.Metrics.ObserveStoreMethodDuration("TermsOfServiceStore.Get", success, elapsed) 4562 } 4563 return resultVar0, resultVar1 4564 } 4565 4566 func (s *TimerLayerTermsOfServiceStore) GetLatest(allowFromCache bool) (*model.TermsOfService, *model.AppError) { 4567 start := timemodule.Now() 4568 4569 resultVar0, resultVar1 := s.TermsOfServiceStore.GetLatest(allowFromCache) 4570 4571 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4572 if s.Root.Metrics != nil { 4573 success := "false" 4574 if resultVar1 == nil { 4575 success = "true" 4576 } 4577 s.Root.Metrics.ObserveStoreMethodDuration("TermsOfServiceStore.GetLatest", success, elapsed) 4578 } 4579 return resultVar0, resultVar1 4580 } 4581 4582 func (s *TimerLayerTermsOfServiceStore) Save(termsOfService *model.TermsOfService) (*model.TermsOfService, *model.AppError) { 4583 start := timemodule.Now() 4584 4585 resultVar0, resultVar1 := s.TermsOfServiceStore.Save(termsOfService) 4586 4587 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4588 if s.Root.Metrics != nil { 4589 success := "false" 4590 if resultVar1 == nil { 4591 success = "true" 4592 } 4593 s.Root.Metrics.ObserveStoreMethodDuration("TermsOfServiceStore.Save", success, elapsed) 4594 } 4595 return resultVar0, resultVar1 4596 } 4597 4598 func (s *TimerLayerTokenStore) Cleanup() { 4599 start := timemodule.Now() 4600 4601 s.TokenStore.Cleanup() 4602 4603 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4604 if s.Root.Metrics != nil { 4605 success := "false" 4606 if true { 4607 success = "true" 4608 } 4609 s.Root.Metrics.ObserveStoreMethodDuration("TokenStore.Cleanup", success, elapsed) 4610 } 4611 } 4612 4613 func (s *TimerLayerTokenStore) Delete(token string) *model.AppError { 4614 start := timemodule.Now() 4615 4616 resultVar0 := s.TokenStore.Delete(token) 4617 4618 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4619 if s.Root.Metrics != nil { 4620 success := "false" 4621 if resultVar0 == nil { 4622 success = "true" 4623 } 4624 s.Root.Metrics.ObserveStoreMethodDuration("TokenStore.Delete", success, elapsed) 4625 } 4626 return resultVar0 4627 } 4628 4629 func (s *TimerLayerTokenStore) GetByToken(token string) (*model.Token, *model.AppError) { 4630 start := timemodule.Now() 4631 4632 resultVar0, resultVar1 := s.TokenStore.GetByToken(token) 4633 4634 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4635 if s.Root.Metrics != nil { 4636 success := "false" 4637 if resultVar1 == nil { 4638 success = "true" 4639 } 4640 s.Root.Metrics.ObserveStoreMethodDuration("TokenStore.GetByToken", success, elapsed) 4641 } 4642 return resultVar0, resultVar1 4643 } 4644 4645 func (s *TimerLayerTokenStore) RemoveAllTokensByType(tokenType string) *model.AppError { 4646 start := timemodule.Now() 4647 4648 resultVar0 := s.TokenStore.RemoveAllTokensByType(tokenType) 4649 4650 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4651 if s.Root.Metrics != nil { 4652 success := "false" 4653 if resultVar0 == nil { 4654 success = "true" 4655 } 4656 s.Root.Metrics.ObserveStoreMethodDuration("TokenStore.RemoveAllTokensByType", success, elapsed) 4657 } 4658 return resultVar0 4659 } 4660 4661 func (s *TimerLayerTokenStore) Save(recovery *model.Token) *model.AppError { 4662 start := timemodule.Now() 4663 4664 resultVar0 := s.TokenStore.Save(recovery) 4665 4666 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4667 if s.Root.Metrics != nil { 4668 success := "false" 4669 if resultVar0 == nil { 4670 success = "true" 4671 } 4672 s.Root.Metrics.ObserveStoreMethodDuration("TokenStore.Save", success, elapsed) 4673 } 4674 return resultVar0 4675 } 4676 4677 func (s *TimerLayerUserStore) AnalyticsActiveCount(time int64, options model.UserCountOptions) (int64, *model.AppError) { 4678 start := timemodule.Now() 4679 4680 resultVar0, resultVar1 := s.UserStore.AnalyticsActiveCount(time, options) 4681 4682 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4683 if s.Root.Metrics != nil { 4684 success := "false" 4685 if resultVar1 == nil { 4686 success = "true" 4687 } 4688 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.AnalyticsActiveCount", success, elapsed) 4689 } 4690 return resultVar0, resultVar1 4691 } 4692 4693 func (s *TimerLayerUserStore) AnalyticsGetInactiveUsersCount() (int64, *model.AppError) { 4694 start := timemodule.Now() 4695 4696 resultVar0, resultVar1 := s.UserStore.AnalyticsGetInactiveUsersCount() 4697 4698 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4699 if s.Root.Metrics != nil { 4700 success := "false" 4701 if resultVar1 == nil { 4702 success = "true" 4703 } 4704 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.AnalyticsGetInactiveUsersCount", success, elapsed) 4705 } 4706 return resultVar0, resultVar1 4707 } 4708 4709 func (s *TimerLayerUserStore) AnalyticsGetSystemAdminCount() (int64, *model.AppError) { 4710 start := timemodule.Now() 4711 4712 resultVar0, resultVar1 := s.UserStore.AnalyticsGetSystemAdminCount() 4713 4714 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4715 if s.Root.Metrics != nil { 4716 success := "false" 4717 if resultVar1 == nil { 4718 success = "true" 4719 } 4720 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.AnalyticsGetSystemAdminCount", success, elapsed) 4721 } 4722 return resultVar0, resultVar1 4723 } 4724 4725 func (s *TimerLayerUserStore) ClearAllCustomRoleAssignments() *model.AppError { 4726 start := timemodule.Now() 4727 4728 resultVar0 := s.UserStore.ClearAllCustomRoleAssignments() 4729 4730 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4731 if s.Root.Metrics != nil { 4732 success := "false" 4733 if resultVar0 == nil { 4734 success = "true" 4735 } 4736 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.ClearAllCustomRoleAssignments", success, elapsed) 4737 } 4738 return resultVar0 4739 } 4740 4741 func (s *TimerLayerUserStore) ClearCaches() { 4742 start := timemodule.Now() 4743 4744 s.UserStore.ClearCaches() 4745 4746 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4747 if s.Root.Metrics != nil { 4748 success := "false" 4749 if true { 4750 success = "true" 4751 } 4752 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.ClearCaches", success, elapsed) 4753 } 4754 } 4755 4756 func (s *TimerLayerUserStore) Count(options model.UserCountOptions) (int64, *model.AppError) { 4757 start := timemodule.Now() 4758 4759 resultVar0, resultVar1 := s.UserStore.Count(options) 4760 4761 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4762 if s.Root.Metrics != nil { 4763 success := "false" 4764 if resultVar1 == nil { 4765 success = "true" 4766 } 4767 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.Count", success, elapsed) 4768 } 4769 return resultVar0, resultVar1 4770 } 4771 4772 func (s *TimerLayerUserStore) Get(id string) (*model.User, *model.AppError) { 4773 start := timemodule.Now() 4774 4775 resultVar0, resultVar1 := s.UserStore.Get(id) 4776 4777 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4778 if s.Root.Metrics != nil { 4779 success := "false" 4780 if resultVar1 == nil { 4781 success = "true" 4782 } 4783 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.Get", success, elapsed) 4784 } 4785 return resultVar0, resultVar1 4786 } 4787 4788 func (s *TimerLayerUserStore) GetAll() ([]*model.User, *model.AppError) { 4789 start := timemodule.Now() 4790 4791 resultVar0, resultVar1 := s.UserStore.GetAll() 4792 4793 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4794 if s.Root.Metrics != nil { 4795 success := "false" 4796 if resultVar1 == nil { 4797 success = "true" 4798 } 4799 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetAll", success, elapsed) 4800 } 4801 return resultVar0, resultVar1 4802 } 4803 4804 func (s *TimerLayerUserStore) GetAllAfter(limit int, afterId string) ([]*model.User, *model.AppError) { 4805 start := timemodule.Now() 4806 4807 resultVar0, resultVar1 := s.UserStore.GetAllAfter(limit, afterId) 4808 4809 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4810 if s.Root.Metrics != nil { 4811 success := "false" 4812 if resultVar1 == nil { 4813 success = "true" 4814 } 4815 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetAllAfter", success, elapsed) 4816 } 4817 return resultVar0, resultVar1 4818 } 4819 4820 func (s *TimerLayerUserStore) GetAllProfiles(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 4821 start := timemodule.Now() 4822 4823 resultVar0, resultVar1 := s.UserStore.GetAllProfiles(options) 4824 4825 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4826 if s.Root.Metrics != nil { 4827 success := "false" 4828 if resultVar1 == nil { 4829 success = "true" 4830 } 4831 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetAllProfiles", success, elapsed) 4832 } 4833 return resultVar0, resultVar1 4834 } 4835 4836 func (s *TimerLayerUserStore) GetAllProfilesInClass(classId string, allowFromCache bool) (map[string]*model.User, *model.AppError) { 4837 start := timemodule.Now() 4838 4839 resultVar0, resultVar1 := s.UserStore.GetAllProfilesInClass(classId, allowFromCache) 4840 4841 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4842 if s.Root.Metrics != nil { 4843 success := "false" 4844 if resultVar1 == nil { 4845 success = "true" 4846 } 4847 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetAllProfilesInClass", success, elapsed) 4848 } 4849 return resultVar0, resultVar1 4850 } 4851 4852 func (s *TimerLayerUserStore) GetAllUsingAuthService(authService string) ([]*model.User, *model.AppError) { 4853 start := timemodule.Now() 4854 4855 resultVar0, resultVar1 := s.UserStore.GetAllUsingAuthService(authService) 4856 4857 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4858 if s.Root.Metrics != nil { 4859 success := "false" 4860 if resultVar1 == nil { 4861 success = "true" 4862 } 4863 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetAllUsingAuthService", success, elapsed) 4864 } 4865 return resultVar0, resultVar1 4866 } 4867 4868 func (s *TimerLayerUserStore) GetByAuth(authData *string, authService string) (*model.User, *model.AppError) { 4869 start := timemodule.Now() 4870 4871 resultVar0, resultVar1 := s.UserStore.GetByAuth(authData, authService) 4872 4873 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4874 if s.Root.Metrics != nil { 4875 success := "false" 4876 if resultVar1 == nil { 4877 success = "true" 4878 } 4879 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetByAuth", success, elapsed) 4880 } 4881 return resultVar0, resultVar1 4882 } 4883 4884 func (s *TimerLayerUserStore) GetByEmail(email string) (*model.User, *model.AppError) { 4885 start := timemodule.Now() 4886 4887 resultVar0, resultVar1 := s.UserStore.GetByEmail(email) 4888 4889 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4890 if s.Root.Metrics != nil { 4891 success := "false" 4892 if resultVar1 == nil { 4893 success = "true" 4894 } 4895 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetByEmail", success, elapsed) 4896 } 4897 return resultVar0, resultVar1 4898 } 4899 4900 func (s *TimerLayerUserStore) GetByUsername(username string) (*model.User, *model.AppError) { 4901 start := timemodule.Now() 4902 4903 resultVar0, resultVar1 := s.UserStore.GetByUsername(username) 4904 4905 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4906 if s.Root.Metrics != nil { 4907 success := "false" 4908 if resultVar1 == nil { 4909 success = "true" 4910 } 4911 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetByUsername", success, elapsed) 4912 } 4913 return resultVar0, resultVar1 4914 } 4915 4916 func (s *TimerLayerUserStore) GetEtagForAllProfiles() string { 4917 start := timemodule.Now() 4918 4919 resultVar0 := s.UserStore.GetEtagForAllProfiles() 4920 4921 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4922 if s.Root.Metrics != nil { 4923 success := "false" 4924 if true { 4925 success = "true" 4926 } 4927 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetEtagForAllProfiles", success, elapsed) 4928 } 4929 return resultVar0 4930 } 4931 4932 func (s *TimerLayerUserStore) GetEtagForProfiles(branchId string) string { 4933 start := timemodule.Now() 4934 4935 resultVar0 := s.UserStore.GetEtagForProfiles(branchId) 4936 4937 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4938 if s.Root.Metrics != nil { 4939 success := "false" 4940 if true { 4941 success = "true" 4942 } 4943 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetEtagForProfiles", success, elapsed) 4944 } 4945 return resultVar0 4946 } 4947 4948 func (s *TimerLayerUserStore) GetForLogin(loginId string, allowSignInWithUsername bool, allowSignInWithEmail bool) (*model.User, *model.AppError) { 4949 start := timemodule.Now() 4950 4951 resultVar0, resultVar1 := s.UserStore.GetForLogin(loginId, allowSignInWithUsername, allowSignInWithEmail) 4952 4953 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4954 if s.Root.Metrics != nil { 4955 success := "false" 4956 if resultVar1 == nil { 4957 success = "true" 4958 } 4959 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetForLogin", success, elapsed) 4960 } 4961 return resultVar0, resultVar1 4962 } 4963 4964 func (s *TimerLayerUserStore) GetNewUsersForBranch(branchId string, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 4965 start := timemodule.Now() 4966 4967 resultVar0, resultVar1 := s.UserStore.GetNewUsersForBranch(branchId, offset, limit, viewRestrictions) 4968 4969 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4970 if s.Root.Metrics != nil { 4971 success := "false" 4972 if resultVar1 == nil { 4973 success = "true" 4974 } 4975 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetNewUsersForBranch", success, elapsed) 4976 } 4977 return resultVar0, resultVar1 4978 } 4979 4980 func (s *TimerLayerUserStore) GetProfileByIds(userIds []string, options *UserGetByIdsOpts, allowFromCache bool) ([]*model.User, *model.AppError) { 4981 start := timemodule.Now() 4982 4983 resultVar0, resultVar1 := s.UserStore.GetProfileByIds(userIds, options, allowFromCache) 4984 4985 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 4986 if s.Root.Metrics != nil { 4987 success := "false" 4988 if resultVar1 == nil { 4989 success = "true" 4990 } 4991 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfileByIds", success, elapsed) 4992 } 4993 return resultVar0, resultVar1 4994 } 4995 4996 func (s *TimerLayerUserStore) GetProfiles(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 4997 start := timemodule.Now() 4998 4999 resultVar0, resultVar1 := s.UserStore.GetProfiles(options) 5000 5001 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5002 if s.Root.Metrics != nil { 5003 success := "false" 5004 if resultVar1 == nil { 5005 success = "true" 5006 } 5007 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfiles", success, elapsed) 5008 } 5009 return resultVar0, resultVar1 5010 } 5011 5012 func (s *TimerLayerUserStore) GetProfilesByUsernames(usernames []string, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 5013 start := timemodule.Now() 5014 5015 resultVar0, resultVar1 := s.UserStore.GetProfilesByUsernames(usernames, viewRestrictions) 5016 5017 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5018 if s.Root.Metrics != nil { 5019 success := "false" 5020 if resultVar1 == nil { 5021 success = "true" 5022 } 5023 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfilesByUsernames", success, elapsed) 5024 } 5025 return resultVar0, resultVar1 5026 } 5027 5028 func (s *TimerLayerUserStore) GetProfilesInClass(classId string, offset int, limit int) ([]*model.User, *model.AppError) { 5029 start := timemodule.Now() 5030 5031 resultVar0, resultVar1 := s.UserStore.GetProfilesInClass(classId, offset, limit) 5032 5033 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5034 if s.Root.Metrics != nil { 5035 success := "false" 5036 if resultVar1 == nil { 5037 success = "true" 5038 } 5039 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfilesInClass", success, elapsed) 5040 } 5041 return resultVar0, resultVar1 5042 } 5043 5044 func (s *TimerLayerUserStore) GetProfilesInClassByStatus(classId string, offset int, limit int) ([]*model.User, *model.AppError) { 5045 start := timemodule.Now() 5046 5047 resultVar0, resultVar1 := s.UserStore.GetProfilesInClassByStatus(classId, offset, limit) 5048 5049 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5050 if s.Root.Metrics != nil { 5051 success := "false" 5052 if resultVar1 == nil { 5053 success = "true" 5054 } 5055 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfilesInClassByStatus", success, elapsed) 5056 } 5057 return resultVar0, resultVar1 5058 } 5059 5060 func (s *TimerLayerUserStore) GetProfilesNotInClass(branchId string, classId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 5061 start := timemodule.Now() 5062 5063 resultVar0, resultVar1 := s.UserStore.GetProfilesNotInClass(branchId, classId, groupConstrained, offset, limit, viewRestrictions) 5064 5065 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5066 if s.Root.Metrics != nil { 5067 success := "false" 5068 if resultVar1 == nil { 5069 success = "true" 5070 } 5071 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfilesNotInClass", success, elapsed) 5072 } 5073 return resultVar0, resultVar1 5074 } 5075 5076 func (s *TimerLayerUserStore) GetProfilesWithoutBranch(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 5077 start := timemodule.Now() 5078 5079 resultVar0, resultVar1 := s.UserStore.GetProfilesWithoutBranch(options) 5080 5081 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5082 if s.Root.Metrics != nil { 5083 success := "false" 5084 if resultVar1 == nil { 5085 success = "true" 5086 } 5087 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetProfilesWithoutBranch", success, elapsed) 5088 } 5089 return resultVar0, resultVar1 5090 } 5091 5092 func (s *TimerLayerUserStore) GetRecentlyActiveUsersForBranch(branchId string, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 5093 start := timemodule.Now() 5094 5095 resultVar0, resultVar1 := s.UserStore.GetRecentlyActiveUsersForBranch(branchId, offset, limit, viewRestrictions) 5096 5097 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5098 if s.Root.Metrics != nil { 5099 success := "false" 5100 if resultVar1 == nil { 5101 success = "true" 5102 } 5103 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetRecentlyActiveUsersForBranch", success, elapsed) 5104 } 5105 return resultVar0, resultVar1 5106 } 5107 5108 func (s *TimerLayerUserStore) GetSystemAdminProfiles() (map[string]*model.User, *model.AppError) { 5109 start := timemodule.Now() 5110 5111 resultVar0, resultVar1 := s.UserStore.GetSystemAdminProfiles() 5112 5113 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5114 if s.Root.Metrics != nil { 5115 success := "false" 5116 if resultVar1 == nil { 5117 success = "true" 5118 } 5119 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetSystemAdminProfiles", success, elapsed) 5120 } 5121 return resultVar0, resultVar1 5122 } 5123 5124 func (s *TimerLayerUserStore) GetUnreadCount(userId string) (int64, *model.AppError) { 5125 start := timemodule.Now() 5126 5127 resultVar0, resultVar1 := s.UserStore.GetUnreadCount(userId) 5128 5129 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5130 if s.Root.Metrics != nil { 5131 success := "false" 5132 if resultVar1 == nil { 5133 success = "true" 5134 } 5135 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetUnreadCount", success, elapsed) 5136 } 5137 return resultVar0, resultVar1 5138 } 5139 5140 func (s *TimerLayerUserStore) GetUsersBatchForIndexing(startTime int64, endTime int64, limit int) ([]*model.UserForIndexing, *model.AppError) { 5141 start := timemodule.Now() 5142 5143 resultVar0, resultVar1 := s.UserStore.GetUsersBatchForIndexing(startTime, endTime, limit) 5144 5145 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5146 if s.Root.Metrics != nil { 5147 success := "false" 5148 if resultVar1 == nil { 5149 success = "true" 5150 } 5151 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.GetUsersBatchForIndexing", success, elapsed) 5152 } 5153 return resultVar0, resultVar1 5154 } 5155 5156 func (s *TimerLayerUserStore) InferSystemInstallDate() (int64, *model.AppError) { 5157 start := timemodule.Now() 5158 5159 resultVar0, resultVar1 := s.UserStore.InferSystemInstallDate() 5160 5161 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5162 if s.Root.Metrics != nil { 5163 success := "false" 5164 if resultVar1 == nil { 5165 success = "true" 5166 } 5167 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.InferSystemInstallDate", success, elapsed) 5168 } 5169 return resultVar0, resultVar1 5170 } 5171 5172 func (s *TimerLayerUserStore) InvalidateProfileCacheForUser(userId string) { 5173 start := timemodule.Now() 5174 5175 s.UserStore.InvalidateProfileCacheForUser(userId) 5176 5177 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5178 if s.Root.Metrics != nil { 5179 success := "false" 5180 if true { 5181 success = "true" 5182 } 5183 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.InvalidateProfileCacheForUser", success, elapsed) 5184 } 5185 } 5186 5187 func (s *TimerLayerUserStore) InvalidateProfilesInClassCache(classId string) { 5188 start := timemodule.Now() 5189 5190 s.UserStore.InvalidateProfilesInClassCache(classId) 5191 5192 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5193 if s.Root.Metrics != nil { 5194 success := "false" 5195 if true { 5196 success = "true" 5197 } 5198 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.InvalidateProfilesInClassCache", success, elapsed) 5199 } 5200 } 5201 5202 func (s *TimerLayerUserStore) InvalidateProfilesInClassCacheByUser(userId string) { 5203 start := timemodule.Now() 5204 5205 s.UserStore.InvalidateProfilesInClassCacheByUser(userId) 5206 5207 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5208 if s.Root.Metrics != nil { 5209 success := "false" 5210 if true { 5211 success = "true" 5212 } 5213 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.InvalidateProfilesInClassCacheByUser", success, elapsed) 5214 } 5215 } 5216 5217 func (s *TimerLayerUserStore) PermanentDelete(userId string) *model.AppError { 5218 start := timemodule.Now() 5219 5220 resultVar0 := s.UserStore.PermanentDelete(userId) 5221 5222 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5223 if s.Root.Metrics != nil { 5224 success := "false" 5225 if resultVar0 == nil { 5226 success = "true" 5227 } 5228 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.PermanentDelete", success, elapsed) 5229 } 5230 return resultVar0 5231 } 5232 5233 func (s *TimerLayerUserStore) ResetLastPictureUpdate(userId string) *model.AppError { 5234 start := timemodule.Now() 5235 5236 resultVar0 := s.UserStore.ResetLastPictureUpdate(userId) 5237 5238 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5239 if s.Root.Metrics != nil { 5240 success := "false" 5241 if resultVar0 == nil { 5242 success = "true" 5243 } 5244 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.ResetLastPictureUpdate", success, elapsed) 5245 } 5246 return resultVar0 5247 } 5248 5249 func (s *TimerLayerUserStore) Save(user *model.User) (*model.User, *model.AppError) { 5250 start := timemodule.Now() 5251 5252 resultVar0, resultVar1 := s.UserStore.Save(user) 5253 5254 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5255 if s.Root.Metrics != nil { 5256 success := "false" 5257 if resultVar1 == nil { 5258 success = "true" 5259 } 5260 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.Save", success, elapsed) 5261 } 5262 return resultVar0, resultVar1 5263 } 5264 5265 func (s *TimerLayerUserStore) Update(user *model.User, allowRoleUpdate bool) (*model.UserUpdate, *model.AppError) { 5266 start := timemodule.Now() 5267 5268 resultVar0, resultVar1 := s.UserStore.Update(user, allowRoleUpdate) 5269 5270 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5271 if s.Root.Metrics != nil { 5272 success := "false" 5273 if resultVar1 == nil { 5274 success = "true" 5275 } 5276 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.Update", success, elapsed) 5277 } 5278 return resultVar0, resultVar1 5279 } 5280 5281 func (s *TimerLayerUserStore) UpdateAuthData(userId string, service string, authData *string, email string, resetMfa bool) (string, *model.AppError) { 5282 start := timemodule.Now() 5283 5284 resultVar0, resultVar1 := s.UserStore.UpdateAuthData(userId, service, authData, email, resetMfa) 5285 5286 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5287 if s.Root.Metrics != nil { 5288 success := "false" 5289 if resultVar1 == nil { 5290 success = "true" 5291 } 5292 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdateAuthData", success, elapsed) 5293 } 5294 return resultVar0, resultVar1 5295 } 5296 5297 func (s *TimerLayerUserStore) UpdateFailedPasswordAttempts(userId string, attempts int) *model.AppError { 5298 start := timemodule.Now() 5299 5300 resultVar0 := s.UserStore.UpdateFailedPasswordAttempts(userId, attempts) 5301 5302 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5303 if s.Root.Metrics != nil { 5304 success := "false" 5305 if resultVar0 == nil { 5306 success = "true" 5307 } 5308 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdateFailedPasswordAttempts", success, elapsed) 5309 } 5310 return resultVar0 5311 } 5312 5313 func (s *TimerLayerUserStore) UpdateLastPictureUpdate(userId string) *model.AppError { 5314 start := timemodule.Now() 5315 5316 resultVar0 := s.UserStore.UpdateLastPictureUpdate(userId) 5317 5318 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5319 if s.Root.Metrics != nil { 5320 success := "false" 5321 if resultVar0 == nil { 5322 success = "true" 5323 } 5324 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdateLastPictureUpdate", success, elapsed) 5325 } 5326 return resultVar0 5327 } 5328 5329 func (s *TimerLayerUserStore) UpdateMfaActive(userId string, active bool) *model.AppError { 5330 start := timemodule.Now() 5331 5332 resultVar0 := s.UserStore.UpdateMfaActive(userId, active) 5333 5334 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5335 if s.Root.Metrics != nil { 5336 success := "false" 5337 if resultVar0 == nil { 5338 success = "true" 5339 } 5340 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdateMfaActive", success, elapsed) 5341 } 5342 return resultVar0 5343 } 5344 5345 func (s *TimerLayerUserStore) UpdateMfaSecret(userId string, secret string) *model.AppError { 5346 start := timemodule.Now() 5347 5348 resultVar0 := s.UserStore.UpdateMfaSecret(userId, secret) 5349 5350 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5351 if s.Root.Metrics != nil { 5352 success := "false" 5353 if resultVar0 == nil { 5354 success = "true" 5355 } 5356 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdateMfaSecret", success, elapsed) 5357 } 5358 return resultVar0 5359 } 5360 5361 func (s *TimerLayerUserStore) UpdatePassword(userId string, newPassword string) *model.AppError { 5362 start := timemodule.Now() 5363 5364 resultVar0 := s.UserStore.UpdatePassword(userId, newPassword) 5365 5366 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5367 if s.Root.Metrics != nil { 5368 success := "false" 5369 if resultVar0 == nil { 5370 success = "true" 5371 } 5372 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdatePassword", success, elapsed) 5373 } 5374 return resultVar0 5375 } 5376 5377 func (s *TimerLayerUserStore) UpdateUpdateAt(userId string) (int64, *model.AppError) { 5378 start := timemodule.Now() 5379 5380 resultVar0, resultVar1 := s.UserStore.UpdateUpdateAt(userId) 5381 5382 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5383 if s.Root.Metrics != nil { 5384 success := "false" 5385 if resultVar1 == nil { 5386 success = "true" 5387 } 5388 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.UpdateUpdateAt", success, elapsed) 5389 } 5390 return resultVar0, resultVar1 5391 } 5392 5393 func (s *TimerLayerUserStore) VerifyEmail(userId string, email string) (string, *model.AppError) { 5394 start := timemodule.Now() 5395 5396 resultVar0, resultVar1 := s.UserStore.VerifyEmail(userId, email) 5397 5398 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5399 if s.Root.Metrics != nil { 5400 success := "false" 5401 if resultVar1 == nil { 5402 success = "true" 5403 } 5404 s.Root.Metrics.ObserveStoreMethodDuration("UserStore.VerifyEmail", success, elapsed) 5405 } 5406 return resultVar0, resultVar1 5407 } 5408 5409 func (s *TimerLayerUserAccessTokenStore) Delete(tokenId string) *model.AppError { 5410 start := timemodule.Now() 5411 5412 resultVar0 := s.UserAccessTokenStore.Delete(tokenId) 5413 5414 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5415 if s.Root.Metrics != nil { 5416 success := "false" 5417 if resultVar0 == nil { 5418 success = "true" 5419 } 5420 s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.Delete", success, elapsed) 5421 } 5422 return resultVar0 5423 } 5424 5425 func (s *TimerLayerUserAccessTokenStore) DeleteAllForUser(userId string) *model.AppError { 5426 start := timemodule.Now() 5427 5428 resultVar0 := s.UserAccessTokenStore.DeleteAllForUser(userId) 5429 5430 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5431 if s.Root.Metrics != nil { 5432 success := "false" 5433 if resultVar0 == nil { 5434 success = "true" 5435 } 5436 s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.DeleteAllForUser", success, elapsed) 5437 } 5438 return resultVar0 5439 } 5440 5441 func (s *TimerLayerUserAccessTokenStore) Get(tokenId string) (*model.UserAccessToken, *model.AppError) { 5442 start := timemodule.Now() 5443 5444 resultVar0, resultVar1 := s.UserAccessTokenStore.Get(tokenId) 5445 5446 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5447 if s.Root.Metrics != nil { 5448 success := "false" 5449 if resultVar1 == nil { 5450 success = "true" 5451 } 5452 s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.Get", success, elapsed) 5453 } 5454 return resultVar0, resultVar1 5455 } 5456 5457 func (s *TimerLayerUserAccessTokenStore) GetAll(offset int, limit int) ([]*model.UserAccessToken, *model.AppError) { 5458 start := timemodule.Now() 5459 5460 resultVar0, resultVar1 := s.UserAccessTokenStore.GetAll(offset, limit) 5461 5462 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5463 if s.Root.Metrics != nil { 5464 success := "false" 5465 if resultVar1 == nil { 5466 success = "true" 5467 } 5468 s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.GetAll", success, elapsed) 5469 } 5470 return resultVar0, resultVar1 5471 } 5472 5473 func (s *TimerLayerUserAccessTokenStore) GetByToken(tokenString string) (*model.UserAccessToken, *model.AppError) { 5474 start := timemodule.Now() 5475 5476 resultVar0, resultVar1 := s.UserAccessTokenStore.GetByToken(tokenString) 5477 5478 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5479 if s.Root.Metrics != nil { 5480 success := "false" 5481 if resultVar1 == nil { 5482 success = "true" 5483 } 5484 s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.GetByToken", success, elapsed) 5485 } 5486 return resultVar0, resultVar1 5487 } 5488 5489 func (s *TimerLayerUserAccessTokenStore) GetByUser(userId string, page int, perPage int) ([]*model.UserAccessToken, *model.AppError) { 5490 start := timemodule.Now() 5491 5492 resultVar0, resultVar1 := s.UserAccessTokenStore.GetByUser(userId, page, perPage) 5493 5494 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5495 if s.Root.Metrics != nil { 5496 success := "false" 5497 if resultVar1 == nil { 5498 success = "true" 5499 } 5500 s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.GetByUser", success, elapsed) 5501 } 5502 return resultVar0, resultVar1 5503 } 5504 5505 func (s *TimerLayerUserAccessTokenStore) Save(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError) { 5506 start := timemodule.Now() 5507 5508 resultVar0, resultVar1 := s.UserAccessTokenStore.Save(token) 5509 5510 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5511 if s.Root.Metrics != nil { 5512 success := "false" 5513 if resultVar1 == nil { 5514 success = "true" 5515 } 5516 s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.Save", success, elapsed) 5517 } 5518 return resultVar0, resultVar1 5519 } 5520 5521 func (s *TimerLayerUserAccessTokenStore) Search(term string) ([]*model.UserAccessToken, *model.AppError) { 5522 start := timemodule.Now() 5523 5524 resultVar0, resultVar1 := s.UserAccessTokenStore.Search(term) 5525 5526 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5527 if s.Root.Metrics != nil { 5528 success := "false" 5529 if resultVar1 == nil { 5530 success = "true" 5531 } 5532 s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.Search", success, elapsed) 5533 } 5534 return resultVar0, resultVar1 5535 } 5536 5537 func (s *TimerLayerUserAccessTokenStore) UpdateTokenDisable(tokenId string) *model.AppError { 5538 start := timemodule.Now() 5539 5540 resultVar0 := s.UserAccessTokenStore.UpdateTokenDisable(tokenId) 5541 5542 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5543 if s.Root.Metrics != nil { 5544 success := "false" 5545 if resultVar0 == nil { 5546 success = "true" 5547 } 5548 s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.UpdateTokenDisable", success, elapsed) 5549 } 5550 return resultVar0 5551 } 5552 5553 func (s *TimerLayerUserAccessTokenStore) UpdateTokenEnable(tokenId string) *model.AppError { 5554 start := timemodule.Now() 5555 5556 resultVar0 := s.UserAccessTokenStore.UpdateTokenEnable(tokenId) 5557 5558 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5559 if s.Root.Metrics != nil { 5560 success := "false" 5561 if resultVar0 == nil { 5562 success = "true" 5563 } 5564 s.Root.Metrics.ObserveStoreMethodDuration("UserAccessTokenStore.UpdateTokenEnable", success, elapsed) 5565 } 5566 return resultVar0 5567 } 5568 5569 func (s *TimerLayerUserTermsOfServiceStore) Delete(userId string, termsOfServiceId string) *model.AppError { 5570 start := timemodule.Now() 5571 5572 resultVar0 := s.UserTermsOfServiceStore.Delete(userId, termsOfServiceId) 5573 5574 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5575 if s.Root.Metrics != nil { 5576 success := "false" 5577 if resultVar0 == nil { 5578 success = "true" 5579 } 5580 s.Root.Metrics.ObserveStoreMethodDuration("UserTermsOfServiceStore.Delete", success, elapsed) 5581 } 5582 return resultVar0 5583 } 5584 5585 func (s *TimerLayerUserTermsOfServiceStore) GetByUser(userId string) (*model.UserTermsOfService, *model.AppError) { 5586 start := timemodule.Now() 5587 5588 resultVar0, resultVar1 := s.UserTermsOfServiceStore.GetByUser(userId) 5589 5590 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5591 if s.Root.Metrics != nil { 5592 success := "false" 5593 if resultVar1 == nil { 5594 success = "true" 5595 } 5596 s.Root.Metrics.ObserveStoreMethodDuration("UserTermsOfServiceStore.GetByUser", success, elapsed) 5597 } 5598 return resultVar0, resultVar1 5599 } 5600 5601 func (s *TimerLayerUserTermsOfServiceStore) Save(userTermsOfService *model.UserTermsOfService) (*model.UserTermsOfService, *model.AppError) { 5602 start := timemodule.Now() 5603 5604 resultVar0, resultVar1 := s.UserTermsOfServiceStore.Save(userTermsOfService) 5605 5606 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5607 if s.Root.Metrics != nil { 5608 success := "false" 5609 if resultVar1 == nil { 5610 success = "true" 5611 } 5612 s.Root.Metrics.ObserveStoreMethodDuration("UserTermsOfServiceStore.Save", success, elapsed) 5613 } 5614 return resultVar0, resultVar1 5615 } 5616 5617 func (s *TimerLayerWebhookStore) AnalyticsIncomingCount(branchId string) (int64, *model.AppError) { 5618 start := timemodule.Now() 5619 5620 resultVar0, resultVar1 := s.WebhookStore.AnalyticsIncomingCount(branchId) 5621 5622 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5623 if s.Root.Metrics != nil { 5624 success := "false" 5625 if resultVar1 == nil { 5626 success = "true" 5627 } 5628 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.AnalyticsIncomingCount", success, elapsed) 5629 } 5630 return resultVar0, resultVar1 5631 } 5632 5633 func (s *TimerLayerWebhookStore) AnalyticsOutgoingCount(branchId string) (int64, *model.AppError) { 5634 start := timemodule.Now() 5635 5636 resultVar0, resultVar1 := s.WebhookStore.AnalyticsOutgoingCount(branchId) 5637 5638 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5639 if s.Root.Metrics != nil { 5640 success := "false" 5641 if resultVar1 == nil { 5642 success = "true" 5643 } 5644 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.AnalyticsOutgoingCount", success, elapsed) 5645 } 5646 return resultVar0, resultVar1 5647 } 5648 5649 func (s *TimerLayerWebhookStore) ClearCaches() { 5650 start := timemodule.Now() 5651 5652 s.WebhookStore.ClearCaches() 5653 5654 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5655 if s.Root.Metrics != nil { 5656 success := "false" 5657 if true { 5658 success = "true" 5659 } 5660 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.ClearCaches", success, elapsed) 5661 } 5662 } 5663 5664 func (s *TimerLayerWebhookStore) DeleteIncoming(webhookId string, time int64) *model.AppError { 5665 start := timemodule.Now() 5666 5667 resultVar0 := s.WebhookStore.DeleteIncoming(webhookId, time) 5668 5669 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5670 if s.Root.Metrics != nil { 5671 success := "false" 5672 if resultVar0 == nil { 5673 success = "true" 5674 } 5675 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.DeleteIncoming", success, elapsed) 5676 } 5677 return resultVar0 5678 } 5679 5680 func (s *TimerLayerWebhookStore) DeleteOutgoing(webhookId string, time int64) *model.AppError { 5681 start := timemodule.Now() 5682 5683 resultVar0 := s.WebhookStore.DeleteOutgoing(webhookId, time) 5684 5685 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5686 if s.Root.Metrics != nil { 5687 success := "false" 5688 if resultVar0 == nil { 5689 success = "true" 5690 } 5691 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.DeleteOutgoing", success, elapsed) 5692 } 5693 return resultVar0 5694 } 5695 5696 func (s *TimerLayerWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError) { 5697 start := timemodule.Now() 5698 5699 resultVar0, resultVar1 := s.WebhookStore.GetIncoming(id, allowFromCache) 5700 5701 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5702 if s.Root.Metrics != nil { 5703 success := "false" 5704 if resultVar1 == nil { 5705 success = "true" 5706 } 5707 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetIncoming", success, elapsed) 5708 } 5709 return resultVar0, resultVar1 5710 } 5711 5712 func (s *TimerLayerWebhookStore) GetIncomingByBranch(branchId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) { 5713 start := timemodule.Now() 5714 5715 resultVar0, resultVar1 := s.WebhookStore.GetIncomingByBranch(branchId, offset, limit) 5716 5717 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5718 if s.Root.Metrics != nil { 5719 success := "false" 5720 if resultVar1 == nil { 5721 success = "true" 5722 } 5723 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetIncomingByBranch", success, elapsed) 5724 } 5725 return resultVar0, resultVar1 5726 } 5727 5728 func (s *TimerLayerWebhookStore) GetIncomingByBranchByUser(branchId string, userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) { 5729 start := timemodule.Now() 5730 5731 resultVar0, resultVar1 := s.WebhookStore.GetIncomingByBranchByUser(branchId, userId, offset, limit) 5732 5733 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5734 if s.Root.Metrics != nil { 5735 success := "false" 5736 if resultVar1 == nil { 5737 success = "true" 5738 } 5739 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetIncomingByBranchByUser", success, elapsed) 5740 } 5741 return resultVar0, resultVar1 5742 } 5743 5744 func (s *TimerLayerWebhookStore) GetIncomingByClass(classId string) ([]*model.IncomingWebhook, *model.AppError) { 5745 start := timemodule.Now() 5746 5747 resultVar0, resultVar1 := s.WebhookStore.GetIncomingByClass(classId) 5748 5749 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5750 if s.Root.Metrics != nil { 5751 success := "false" 5752 if resultVar1 == nil { 5753 success = "true" 5754 } 5755 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetIncomingByClass", success, elapsed) 5756 } 5757 return resultVar0, resultVar1 5758 } 5759 5760 func (s *TimerLayerWebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) { 5761 start := timemodule.Now() 5762 5763 resultVar0, resultVar1 := s.WebhookStore.GetIncomingList(offset, limit) 5764 5765 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5766 if s.Root.Metrics != nil { 5767 success := "false" 5768 if resultVar1 == nil { 5769 success = "true" 5770 } 5771 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetIncomingList", success, elapsed) 5772 } 5773 return resultVar0, resultVar1 5774 } 5775 5776 func (s *TimerLayerWebhookStore) GetIncomingListByUser(userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) { 5777 start := timemodule.Now() 5778 5779 resultVar0, resultVar1 := s.WebhookStore.GetIncomingListByUser(userId, offset, limit) 5780 5781 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5782 if s.Root.Metrics != nil { 5783 success := "false" 5784 if resultVar1 == nil { 5785 success = "true" 5786 } 5787 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetIncomingListByUser", success, elapsed) 5788 } 5789 return resultVar0, resultVar1 5790 } 5791 5792 func (s *TimerLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, *model.AppError) { 5793 start := timemodule.Now() 5794 5795 resultVar0, resultVar1 := s.WebhookStore.GetOutgoing(id) 5796 5797 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5798 if s.Root.Metrics != nil { 5799 success := "false" 5800 if resultVar1 == nil { 5801 success = "true" 5802 } 5803 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoing", success, elapsed) 5804 } 5805 return resultVar0, resultVar1 5806 } 5807 5808 func (s *TimerLayerWebhookStore) GetOutgoingByBranch(branchId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) { 5809 start := timemodule.Now() 5810 5811 resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByBranch(branchId, offset, limit) 5812 5813 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5814 if s.Root.Metrics != nil { 5815 success := "false" 5816 if resultVar1 == nil { 5817 success = "true" 5818 } 5819 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoingByBranch", success, elapsed) 5820 } 5821 return resultVar0, resultVar1 5822 } 5823 5824 func (s *TimerLayerWebhookStore) GetOutgoingByBranchByUser(branchId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) { 5825 start := timemodule.Now() 5826 5827 resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByBranchByUser(branchId, userId, offset, limit) 5828 5829 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5830 if s.Root.Metrics != nil { 5831 success := "false" 5832 if resultVar1 == nil { 5833 success = "true" 5834 } 5835 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoingByBranchByUser", success, elapsed) 5836 } 5837 return resultVar0, resultVar1 5838 } 5839 5840 func (s *TimerLayerWebhookStore) GetOutgoingByClass(classId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) { 5841 start := timemodule.Now() 5842 5843 resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByClass(classId, offset, limit) 5844 5845 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5846 if s.Root.Metrics != nil { 5847 success := "false" 5848 if resultVar1 == nil { 5849 success = "true" 5850 } 5851 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoingByClass", success, elapsed) 5852 } 5853 return resultVar0, resultVar1 5854 } 5855 5856 func (s *TimerLayerWebhookStore) GetOutgoingByClassByUser(classId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) { 5857 start := timemodule.Now() 5858 5859 resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByClassByUser(classId, userId, offset, limit) 5860 5861 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5862 if s.Root.Metrics != nil { 5863 success := "false" 5864 if resultVar1 == nil { 5865 success = "true" 5866 } 5867 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoingByClassByUser", success, elapsed) 5868 } 5869 return resultVar0, resultVar1 5870 } 5871 5872 func (s *TimerLayerWebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) { 5873 start := timemodule.Now() 5874 5875 resultVar0, resultVar1 := s.WebhookStore.GetOutgoingList(offset, limit) 5876 5877 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5878 if s.Root.Metrics != nil { 5879 success := "false" 5880 if resultVar1 == nil { 5881 success = "true" 5882 } 5883 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoingList", success, elapsed) 5884 } 5885 return resultVar0, resultVar1 5886 } 5887 5888 func (s *TimerLayerWebhookStore) GetOutgoingListByUser(userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) { 5889 start := timemodule.Now() 5890 5891 resultVar0, resultVar1 := s.WebhookStore.GetOutgoingListByUser(userId, offset, limit) 5892 5893 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5894 if s.Root.Metrics != nil { 5895 success := "false" 5896 if resultVar1 == nil { 5897 success = "true" 5898 } 5899 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.GetOutgoingListByUser", success, elapsed) 5900 } 5901 return resultVar0, resultVar1 5902 } 5903 5904 func (s *TimerLayerWebhookStore) InvalidateWebhookCache(webhook string) { 5905 start := timemodule.Now() 5906 5907 s.WebhookStore.InvalidateWebhookCache(webhook) 5908 5909 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5910 if s.Root.Metrics != nil { 5911 success := "false" 5912 if true { 5913 success = "true" 5914 } 5915 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.InvalidateWebhookCache", success, elapsed) 5916 } 5917 } 5918 5919 func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByClass(classId string) *model.AppError { 5920 start := timemodule.Now() 5921 5922 resultVar0 := s.WebhookStore.PermanentDeleteIncomingByClass(classId) 5923 5924 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5925 if s.Root.Metrics != nil { 5926 success := "false" 5927 if resultVar0 == nil { 5928 success = "true" 5929 } 5930 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.PermanentDeleteIncomingByClass", success, elapsed) 5931 } 5932 return resultVar0 5933 } 5934 5935 func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByUser(userId string) *model.AppError { 5936 start := timemodule.Now() 5937 5938 resultVar0 := s.WebhookStore.PermanentDeleteIncomingByUser(userId) 5939 5940 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5941 if s.Root.Metrics != nil { 5942 success := "false" 5943 if resultVar0 == nil { 5944 success = "true" 5945 } 5946 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.PermanentDeleteIncomingByUser", success, elapsed) 5947 } 5948 return resultVar0 5949 } 5950 5951 func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByClass(classId string) *model.AppError { 5952 start := timemodule.Now() 5953 5954 resultVar0 := s.WebhookStore.PermanentDeleteOutgoingByClass(classId) 5955 5956 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5957 if s.Root.Metrics != nil { 5958 success := "false" 5959 if resultVar0 == nil { 5960 success = "true" 5961 } 5962 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.PermanentDeleteOutgoingByClass", success, elapsed) 5963 } 5964 return resultVar0 5965 } 5966 5967 func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByUser(userId string) *model.AppError { 5968 start := timemodule.Now() 5969 5970 resultVar0 := s.WebhookStore.PermanentDeleteOutgoingByUser(userId) 5971 5972 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5973 if s.Root.Metrics != nil { 5974 success := "false" 5975 if resultVar0 == nil { 5976 success = "true" 5977 } 5978 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.PermanentDeleteOutgoingByUser", success, elapsed) 5979 } 5980 return resultVar0 5981 } 5982 5983 func (s *TimerLayerWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) { 5984 start := timemodule.Now() 5985 5986 resultVar0, resultVar1 := s.WebhookStore.SaveIncoming(webhook) 5987 5988 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 5989 if s.Root.Metrics != nil { 5990 success := "false" 5991 if resultVar1 == nil { 5992 success = "true" 5993 } 5994 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.SaveIncoming", success, elapsed) 5995 } 5996 return resultVar0, resultVar1 5997 } 5998 5999 func (s *TimerLayerWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) { 6000 start := timemodule.Now() 6001 6002 resultVar0, resultVar1 := s.WebhookStore.SaveOutgoing(webhook) 6003 6004 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 6005 if s.Root.Metrics != nil { 6006 success := "false" 6007 if resultVar1 == nil { 6008 success = "true" 6009 } 6010 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.SaveOutgoing", success, elapsed) 6011 } 6012 return resultVar0, resultVar1 6013 } 6014 6015 func (s *TimerLayerWebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) { 6016 start := timemodule.Now() 6017 6018 resultVar0, resultVar1 := s.WebhookStore.UpdateIncoming(webhook) 6019 6020 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 6021 if s.Root.Metrics != nil { 6022 success := "false" 6023 if resultVar1 == nil { 6024 success = "true" 6025 } 6026 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.UpdateIncoming", success, elapsed) 6027 } 6028 return resultVar0, resultVar1 6029 } 6030 6031 func (s *TimerLayerWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) { 6032 start := timemodule.Now() 6033 6034 resultVar0, resultVar1 := s.WebhookStore.UpdateOutgoing(hook) 6035 6036 elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second) 6037 if s.Root.Metrics != nil { 6038 success := "false" 6039 if resultVar1 == nil { 6040 success = "true" 6041 } 6042 s.Root.Metrics.ObserveStoreMethodDuration("WebhookStore.UpdateOutgoing", success, elapsed) 6043 } 6044 return resultVar0, resultVar1 6045 } 6046 6047 func (s *TimerLayer) Close() { 6048 s.Store.Close() 6049 } 6050 6051 func (s *TimerLayer) DropAllTables() { 6052 s.Store.DropAllTables() 6053 } 6054 6055 func (s *TimerLayer) GetCurrentSchemaVersion() string { 6056 return s.Store.GetCurrentSchemaVersion() 6057 } 6058 6059 func (s *TimerLayer) LockToMaster() { 6060 s.Store.LockToMaster() 6061 } 6062 6063 func (s *TimerLayer) MarkSystemRanUnitTests() { 6064 s.Store.MarkSystemRanUnitTests() 6065 } 6066 6067 func (s *TimerLayer) SetContext(context context.Context) { 6068 s.Store.SetContext(context) 6069 } 6070 6071 func (s *TimerLayer) TotalMasterDbConnections() int { 6072 return s.Store.TotalMasterDbConnections() 6073 } 6074 6075 func (s *TimerLayer) TotalReadDbConnections() int { 6076 return s.Store.TotalReadDbConnections() 6077 } 6078 6079 func (s *TimerLayer) TotalSearchDbConnections() int { 6080 return s.Store.TotalSearchDbConnections() 6081 } 6082 6083 func (s *TimerLayer) UnlockFromMaster() { 6084 s.Store.UnlockFromMaster() 6085 } 6086 6087 func NewTimerLayer(childStore Store, metrics einterfaces.MetricsInterface) *TimerLayer { 6088 newStore := TimerLayer{ 6089 Store: childStore, 6090 Metrics: metrics, 6091 } 6092 6093 newStore.AuditStore = &TimerLayerAuditStore{AuditStore: childStore.Audit(), Root: &newStore} 6094 newStore.BranchStore = &TimerLayerBranchStore{BranchStore: childStore.Branch(), Root: &newStore} 6095 newStore.ClassStore = &TimerLayerClassStore{ClassStore: childStore.Class(), Root: &newStore} 6096 newStore.ClusterDiscoveryStore = &TimerLayerClusterDiscoveryStore{ClusterDiscoveryStore: childStore.ClusterDiscovery(), Root: &newStore} 6097 newStore.CommandStore = &TimerLayerCommandStore{CommandStore: childStore.Command(), Root: &newStore} 6098 newStore.CommandWebhookStore = &TimerLayerCommandWebhookStore{CommandWebhookStore: childStore.CommandWebhook(), Root: &newStore} 6099 newStore.ComplianceStore = &TimerLayerComplianceStore{ComplianceStore: childStore.Compliance(), Root: &newStore} 6100 newStore.EmojiStore = &TimerLayerEmojiStore{EmojiStore: childStore.Emoji(), Root: &newStore} 6101 newStore.FileInfoStore = &TimerLayerFileInfoStore{FileInfoStore: childStore.FileInfo(), Root: &newStore} 6102 newStore.JobStore = &TimerLayerJobStore{JobStore: childStore.Job(), Root: &newStore} 6103 newStore.LicenseStore = &TimerLayerLicenseStore{LicenseStore: childStore.License(), Root: &newStore} 6104 newStore.LinkMetadataStore = &TimerLayerLinkMetadataStore{LinkMetadataStore: childStore.LinkMetadata(), Root: &newStore} 6105 newStore.OAuthStore = &TimerLayerOAuthStore{OAuthStore: childStore.OAuth(), Root: &newStore} 6106 newStore.PostStore = &TimerLayerPostStore{PostStore: childStore.Post(), Root: &newStore} 6107 newStore.PreferenceStore = &TimerLayerPreferenceStore{PreferenceStore: childStore.Preference(), Root: &newStore} 6108 newStore.ReactionStore = &TimerLayerReactionStore{ReactionStore: childStore.Reaction(), Root: &newStore} 6109 newStore.RoleStore = &TimerLayerRoleStore{RoleStore: childStore.Role(), Root: &newStore} 6110 newStore.SchemeStore = &TimerLayerSchemeStore{SchemeStore: childStore.Scheme(), Root: &newStore} 6111 newStore.SessionStore = &TimerLayerSessionStore{SessionStore: childStore.Session(), Root: &newStore} 6112 newStore.StatusStore = &TimerLayerStatusStore{StatusStore: childStore.Status(), Root: &newStore} 6113 newStore.SystemStore = &TimerLayerSystemStore{SystemStore: childStore.System(), Root: &newStore} 6114 newStore.TermsOfServiceStore = &TimerLayerTermsOfServiceStore{TermsOfServiceStore: childStore.TermsOfService(), Root: &newStore} 6115 newStore.TokenStore = &TimerLayerTokenStore{TokenStore: childStore.Token(), Root: &newStore} 6116 newStore.UserStore = &TimerLayerUserStore{UserStore: childStore.User(), Root: &newStore} 6117 newStore.UserAccessTokenStore = &TimerLayerUserAccessTokenStore{UserAccessTokenStore: childStore.UserAccessToken(), Root: &newStore} 6118 newStore.UserTermsOfServiceStore = &TimerLayerUserTermsOfServiceStore{UserTermsOfServiceStore: childStore.UserTermsOfService(), Root: &newStore} 6119 newStore.WebhookStore = &TimerLayerWebhookStore{WebhookStore: childStore.Webhook(), Root: &newStore} 6120 return &newStore 6121 }