diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-10-31 17:36:41 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-10-31 14:36:41 -0700 |
commit | 23e4b4a27d915191dc4f1164c86e26651b379a11 (patch) | |
tree | 3bf51e73047bae7666ff73e534ccad3140463d24 /app | |
parent | 709ef99eca0353585eb00c795cc36f39bac29a1f (diff) | |
download | chat-23e4b4a27d915191dc4f1164c86e26651b379a11.tar.gz chat-23e4b4a27d915191dc4f1164c86e26651b379a11.tar.bz2 chat-23e4b4a27d915191dc4f1164c86e26651b379a11.zip |
PLT-7810 Track if an APIv3 endpoint was used in the last day (#7744)
* Track if an APIv3 endpoint was used in the last day
* Make it atomic
Diffstat (limited to 'app')
-rw-r--r-- | app/diagnostics.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/diagnostics.go b/app/diagnostics.go index 4974d6444..bba95d241 100644 --- a/app/diagnostics.go +++ b/app/diagnostics.go @@ -8,6 +8,7 @@ import ( "log" "os" "runtime" + "sync/atomic" "github.com/mattermost/mattermost-server/model" "github.com/mattermost/mattermost-server/utils" @@ -171,7 +172,10 @@ func (a *App) trackActivity() { "public_channels_deleted": deletedPublicChannelCount, "private_channels_deleted": deletedPrivateChannelCount, "posts": postsCount, + "used_apiv3": atomic.LoadInt32(model.UsedApiV3) == 1, }) + + atomic.StoreInt32(model.UsedApiV3, 0) } func (a *App) trackConfig() { |