mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
28 lines
723 B
Go
28 lines
723 B
Go
package runner
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/Sirupsen/logrus"
|
|
titancommon "github.com/iron-io/titan/common"
|
|
"golang.org/x/net/context"
|
|
)
|
|
|
|
func LogMetricGauge(ctx context.Context, name string, value int) {
|
|
log := titancommon.Logger(ctx)
|
|
log.WithFields(logrus.Fields{
|
|
"metric": name, "type": "count", "value": value}).Info()
|
|
}
|
|
|
|
func LogMetricCount(ctx context.Context, name string, value int) {
|
|
log := titancommon.Logger(ctx)
|
|
log.WithFields(logrus.Fields{
|
|
"metric": name, "type": "count", "value": value}).Info()
|
|
}
|
|
|
|
func LogMetricTime(ctx context.Context, name string, time time.Duration) {
|
|
log := titancommon.Logger(ctx)
|
|
log.WithFields(logrus.Fields{
|
|
"metric": name, "type": "time", "value": time}).Info()
|
|
}
|