Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

allow a global gauge not specific to a host #9

Merged
merged 1 commit into from
May 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions metrics.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name = "unknown"
hostname = require('os').hostname()

buildKey = (key)-> "#{name}.#{hostname}.#{key}"
buildGlobalKey = (key)-> "#{name}.global.#{key}"

destructors = []

Expand Down Expand Up @@ -42,6 +43,9 @@ module.exports = Metrics =
gauge : (key, value, sampleRate = 1)->
statsd.gauge buildKey(key), value, sampleRate

globalGauge: (key, value, sampleRate = 1)->
statsd.gauge buildGlobalKey(key), value, sampleRate

mongodb: require "./mongodb"
http: require "./http"
open_sockets: require "./open_sockets"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "metrics-sharelatex",
"version": "1.7.2",
"version": "1.8.0",
"description": "A drop-in metrics and monitoring module for node.js apps",
"repository": {
"type": "git",
Expand Down