mtr_monitor 0.13.3 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/mtr_monitor.rb +9 -3
- data/lib/mtr_monitor/metrics.rb +2 -0
- data/lib/mtr_monitor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73a181cc6a8de48749185ba9754fac177d23a521
|
4
|
+
data.tar.gz: 69e889ab6f97437fd3af5dc41f04c08175477964
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cce3af5c5b57ed6788ad004cbdd1601960845c5ea0b3a7c852ea4b1548d2ef9bfe5715d1e03d4c725d078f0ed56c164f727af04b039b95fe935f1c20720e5a5c
|
7
|
+
data.tar.gz: b64090ba0a9b55b42dc4ca0c8a8e3179bd54e50e5c59c0148dab07ebc17d717bd6e3f98244a0bf36a95e1ac5b2a92184814e28909ad43981ae81a251d0f92760
|
data/Gemfile.lock
CHANGED
data/lib/mtr_monitor.rb
CHANGED
@@ -37,12 +37,18 @@ module MtrMonitor
|
|
37
37
|
@aws_access_key_id = aws_access_key_id
|
38
38
|
@aws_secret_access_key = aws_secret_access_key
|
39
39
|
@mtr_options = mtr_options
|
40
|
-
@host_ip_address = `dig +short myip.opendns.com @resolver1.opendns.com`.strip
|
41
|
-
@hostname = `hostname`.strip
|
40
|
+
@host_ip_address = `dig +short myip.opendns.com @resolver1.opendns.com`.strip
|
41
|
+
@hostname = `hostname`.strip
|
42
42
|
@dig_ip_address = dig_ip_address
|
43
43
|
@logger = logger || Logger.new(STDOUT)
|
44
44
|
|
45
|
-
path =
|
45
|
+
path = [
|
46
|
+
@name,
|
47
|
+
Time.now.strftime("%Y-%m-%d"),
|
48
|
+
@host_ip_address.gsub(".", "-"),
|
49
|
+
Time.now.strftime("%H-%M"),
|
50
|
+
".log"
|
51
|
+
].join("/")
|
46
52
|
|
47
53
|
@log_path = "#{MtrMonitor::REPORTS_PATH}/#{path.gsub("/", "-")}"
|
48
54
|
@s3_path = "s3://#{@s3_bucket}/#{path}"
|
data/lib/mtr_monitor/metrics.rb
CHANGED
@@ -2,6 +2,8 @@ module MtrMonitor
|
|
2
2
|
module Metrics
|
3
3
|
|
4
4
|
def self.submit(log_path, hostname, name, logger)
|
5
|
+
hostname = hostname.gsub(".", "-")
|
6
|
+
|
5
7
|
logger.info "Submitting pulse: network.mtr.pulse, tags: #{[hostname, name]}, prefix: #{Watchman.prefix} port: #{Watchman.port}"
|
6
8
|
|
7
9
|
Watchman.submit("network.mtr.pulse", 1, :gauge, :tags => [hostname, name])
|
data/lib/mtr_monitor/version.rb
CHANGED