From 7961599b2e41c71720a42b3bfde641f7529f05fe Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Tue, 22 Nov 2016 11:05:54 -0800 Subject: PLT-4357 adding performance monitoring (#4622) * WIP * WIP * Adding metrics collection * updating vendor packages * Adding metrics to config * Adding admin console page for perf monitoring * Updating glide * switching to tylerb/graceful --- einterfaces/metrics.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 einterfaces/metrics.go (limited to 'einterfaces') diff --git a/einterfaces/metrics.go b/einterfaces/metrics.go new file mode 100644 index 000000000..192639e02 --- /dev/null +++ b/einterfaces/metrics.go @@ -0,0 +1,32 @@ +// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +package einterfaces + +type MetricsInterface interface { + StartServer() + StopServer() + + IncrementPostCreate() + IncrementPostSentEmail() + IncrementPostSentPush() + IncrementPostBroadcast() + IncrementPostFileAttachment(count int) + + IncrementHttpRequest() + IncrementHttpError() + ObserveHttpRequestDuration(elapsed float64) + + IncrementLogin() + IncrementLoginFail() +} + +var theMetricsInterface MetricsInterface + +func RegisterMetricsInterface(newInterface MetricsInterface) { + theMetricsInterface = newInterface +} + +func GetMetricsInterface() MetricsInterface { + return theMetricsInterface +} -- cgit v1.2.3-1-g7c22