Skip to content

Commit

Permalink
Merge 7f3ab2a into 432dc92
Browse files Browse the repository at this point in the history
  • Loading branch information
crspeller committed Feb 9, 2017
2 parents 432dc92 + 7f3ab2a commit 48ccf9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/webhook.go
Expand Up @@ -12,6 +12,7 @@ import (
"strings"

l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/einterfaces"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
)
Expand Down Expand Up @@ -126,6 +127,10 @@ func CreateWebhookPost(userId, teamId, channelId, text, overrideUsername, overri
post := &model.Post{UserId: userId, ChannelId: channelId, Message: text, Type: postType}
post.AddProp("from_webhook", "true")

if metrics := einterfaces.GetMetricsInterface(); metrics != nil {
metrics.IncrementWebhookPost()
}

if utils.Cfg.ServiceSettings.EnablePostUsernameOverride {
if len(overrideUsername) != 0 {
post.AddProp("override_username", overrideUsername)
Expand Down
1 change: 1 addition & 0 deletions einterfaces/metrics.go
Expand Up @@ -8,6 +8,7 @@ type MetricsInterface interface {
StopServer()

IncrementPostCreate()
IncrementWebhookPost()
IncrementPostSentEmail()
IncrementPostSentPush()
IncrementPostBroadcast()
Expand Down

0 comments on commit 48ccf9c

Please sign in to comment.