process_monitoring 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,8 +10,9 @@ require 'params'
10
10
  EventMachine.schedule do
11
11
  trap("INT") do
12
12
  puts "Caught SIGINT"
13
- EventMachine.exit # this is useless
14
- # exit # this stops the EventMachine
13
+ puts "EventMachine:#{EventMachine}"
14
+ # EventMachine.stop # this is useless
15
+ exit # exit # this stops the EventMachine
15
16
  end
16
17
  end
17
18
 
@@ -24,9 +25,11 @@ module MonitoringInfo
24
25
  class MonitoringInfo
25
26
  attr_reader :thread
26
27
 
27
- def initialize(process_variables)
28
- @process_variables = process_variables
29
- @web_interface = Sinatra.new { get('/') { MonitoringInfo.get_json(process_variables.clone) } }
28
+ def initialize()
29
+ @web_interface = Sinatra.new {
30
+ set :bind, '0.0.0.0'
31
+ get('/') { MonitoringInfo.get_json(Params['process_vars'].clone) }
32
+ }
30
33
  @web_interface.set(:port, Params['process_monitoring_web_port'])
31
34
  @thread = Thread.new do
32
35
  @web_interface.run!
@@ -38,14 +41,10 @@ module MonitoringInfo
38
41
 
39
42
  entries = []
40
43
  hash.each do |key, value|
41
- if value.is_a? String
42
- entries << "\"#{key}\": \"#{value}\""
43
- else
44
- entries << "\"#{key}\": #{value}"
45
- end
44
+ entries << "{#{key}:#{value}}"
46
45
  end
47
46
 
48
- return '{' + entries.join(',') + '}'
47
+ return entries.join(" , ")
49
48
  end
50
49
 
51
50
  def self.get_html (hash, opts = {})
@@ -1,3 +1,3 @@
1
1
  module ProcessMonitoring
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: process_monitoring
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-25 00:00:00.000000000 Z
12
+ date: 2013-06-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine