mtr_monitor 0.9.10 → 0.9.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05f23785a12ac88db1f02e9aac37c3c519665547
4
- data.tar.gz: b9ecb4f35b22f1a5b353424829bce195626522bb
3
+ metadata.gz: 6061e45a1dd3d03aca90053d4f0040a6fefda1b2
4
+ data.tar.gz: 14339f8f4af27939c63e56b6fd7cf4645f76eef7
5
5
  SHA512:
6
- metadata.gz: d969268d86e33207233f21c4d5206a366b7c52687a0ce7d05f2254a1b7b9f449435aa0da30cd3042d07466e4dd2822438a41a66310b0ae804d258ff8497ba25d
7
- data.tar.gz: f879bde810ca205ae6c6d2e83935251a1e61872605f1369d2e3122a5c29ae3238447622214cbad53a6deb4d059cc28143075b5838141d0804650144dd2570d4c
6
+ metadata.gz: c1ee4c6cf4523e281bd39c420435596ad68aaa97cfb7be3dfd0ffbfac0bcc0b82689fb35f8c42fd5b2b9d94ed85a27a2b7f203c04e2422621913eb2121029452
7
+ data.tar.gz: a541bebf6c5802d3c98519d73055140b854094f5365f06efb5232cc4576ba5ac47292ab0e451dd3606886576a0109b2dcaa83067f8d8fec214252831a24be055
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mtr_monitor (0.9.10)
4
+ mtr_monitor (0.9.11)
5
5
  rt-watchman (~> 0.10.0)
6
6
 
7
7
  GEM
data/exe/mtr_report CHANGED
@@ -4,6 +4,9 @@
4
4
  $stdout.sync = true
5
5
 
6
6
  require "mtr_monitor"
7
+ require "logger"
8
+
9
+ logger = Logger.new(STDOUT)
7
10
 
8
11
  name = ENV.fetch("NAME")
9
12
  domain = ENV.fetch("DOMAIN")
@@ -23,14 +26,15 @@ loop do
23
26
  s3_bucket,
24
27
  mtr_options,
25
28
  aws_access_key_id,
26
- aws_secret_access_key)
29
+ aws_secret_access_key,
30
+ logger)
27
31
 
28
- puts "Generating report"
32
+ logger.info "Generating report"
29
33
  report.generate
30
34
 
31
- puts "Submiting metrics"
32
- # report.submit_metrics
35
+ logger.info "Submiting metrics"
36
+ report.submit_metrics
33
37
 
34
- puts "Sleeping for #{sleep_time} minutes"
38
+ logger.info "Sleeping for #{sleep_time} minutes"
35
39
  sleep(sleep_time * 60)
36
40
  end
@@ -1,3 +1,3 @@
1
1
  module MtrMonitor
2
- VERSION = "0.9.10"
2
+ VERSION = "0.9.11"
3
3
  end
data/lib/mtr_monitor.rb CHANGED
@@ -11,7 +11,7 @@ module MtrMonitor
11
11
  attr_reader :log_path
12
12
  attr_reader :logger
13
13
 
14
- def initialize(name, domain, s3_bucket, mtr_options, aws_access_key_id, aws_secret_access_key)
14
+ def initialize(name, domain, s3_bucket, mtr_options, aws_access_key_id, aws_secret_access_key, logger = nil)
15
15
  @name = name
16
16
  @domain = domain
17
17
  @s3_bucket = s3_bucket
@@ -20,7 +20,7 @@ module MtrMonitor
20
20
  @mtr_options = mtr_options
21
21
  @host_ip_address = `curl http://ifconfig.co`.strip.gsub(".", "-")
22
22
  @hostname = `hostname`.strip.gsub(".", "-")
23
- @logger = Logger.new(STDOUT)
23
+ @logger = logger || Logger.new(STDOUT)
24
24
 
25
25
  @log_name = "#{@name}/#{Time.now.strftime("%Y-%m-%d")}/#{@host_ip_address}/#{Time.now.strftime("%H-%M")}.log"
26
26
  @log_path = "/var/log/mtr/#{@log_name.gsub("/", "-")}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mtr_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.10
4
+ version: 0.9.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - RenderedText DevOps Team