karma_messages 0.1.1 → 0.1.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ab2bc4ab71e723d3d19fb93a3a60e7478e425d8
4
- data.tar.gz: c0c3933008d8fc32529f881d7de6f0c9c4f8a18f
3
+ metadata.gz: 664f2770a35934c659b176ad68f757879b79545f
4
+ data.tar.gz: d0c25ed8a1bc347990d46c4026967803fcc10174
5
5
  SHA512:
6
- metadata.gz: edfa09e8f3125baf49e63b72e88d6cf97e27a9e7661467c605024fd1c08e4b716b61702a5aff6cd74d1141a4db6c09230d9c6d8b171806bda951b1d1ec6c6109
7
- data.tar.gz: 3cd3d2e13d9f8e1b58081d254466c6a3b703fd307a5714cdd6b7fc0aa6996993fdd26ee37ee416610c8301dc81e8192e11295ce21dcdc88d38fccdd8ca479807
6
+ metadata.gz: 67e152598fcdced39015d6c2100dd7bd6d31751150b8b59b5b088d97e48106d5379102683d5459d9b6d057b95128d408bac5c83d0d7f3e32edac80fbbf078b9d
7
+ data.tar.gz: f4ebfb95dfc92ec120cc59b7f78bca1860aea2890da86f5c30356269d470e3aa1c925ef51d14e4b1e8ba6b55e141fb6ebbe333a8d6459abd520db53ebe237f0d
data/Gemfile CHANGED
@@ -1,6 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'byebug'
3
+ group :development, :test do
4
+ # Call 'byebug' anywhere in the code to stop execution and get a debugger console
5
+ gem 'byebug', platform: :mri
6
+ end
4
7
 
5
8
  # Specify your gem's dependencies in karma_messages.gemspec
6
9
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karma_messages (0.1.0)
4
+ karma_messages (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -9,19 +9,19 @@ GEM
9
9
  byebug (9.0.6)
10
10
  diff-lcs (1.3)
11
11
  rake (10.5.0)
12
- rspec (3.5.0)
13
- rspec-core (~> 3.5.0)
14
- rspec-expectations (~> 3.5.0)
15
- rspec-mocks (~> 3.5.0)
16
- rspec-core (3.5.4)
17
- rspec-support (~> 3.5.0)
18
- rspec-expectations (3.5.0)
12
+ rspec (3.6.0)
13
+ rspec-core (~> 3.6.0)
14
+ rspec-expectations (~> 3.6.0)
15
+ rspec-mocks (~> 3.6.0)
16
+ rspec-core (3.6.0)
17
+ rspec-support (~> 3.6.0)
18
+ rspec-expectations (3.6.0)
19
19
  diff-lcs (>= 1.2.0, < 2.0)
20
- rspec-support (~> 3.5.0)
21
- rspec-mocks (3.5.0)
20
+ rspec-support (~> 3.6.0)
21
+ rspec-mocks (3.6.0)
22
22
  diff-lcs (>= 1.2.0, < 2.0)
23
- rspec-support (~> 3.5.0)
24
- rspec-support (3.5.0)
23
+ rspec-support (~> 3.6.0)
24
+ rspec-support (3.6.0)
25
25
 
26
26
  PLATFORMS
27
27
  ruby
@@ -5,7 +5,7 @@ module Karma
5
5
  class << self
6
6
  attr_writer :logger
7
7
  def logger
8
- @logger ||= Logger.new($stdout, 2, 52428800).tap do |log|
8
+ @logger ||= Logger.new($stdout, 2, 50*1024*1024).tap do |log|
9
9
  log.level = Logger::INFO
10
10
  log.progname = self.name
11
11
  end
@@ -43,4 +43,3 @@ require "karma_messages/process_command_message"
43
43
  require "karma_messages/process_register_message"
44
44
  require "karma_messages/process_config_update_message"
45
45
  require "karma_messages/process_status_update_message"
46
- require "karma_messages/thread_config_update_message"
@@ -2,7 +2,7 @@ module Karma::Messages
2
2
 
3
3
  class ProcessConfigUpdateMessage < BaseKarmap
4
4
 
5
- attr_reader :memory_max, :cpu_quota, :min_running, :max_running, :auto_restart, :auto_start
5
+ attr_reader :memory_max, :cpu_quota, :min_running, :max_running, :auto_restart, :auto_start, :push_notifications, :log_level, :num_threads
6
6
 
7
7
  def parse(params)
8
8
  super(params)
@@ -11,21 +11,27 @@ module Karma::Messages
11
11
  @errors << { max_running: 'Required' } if params[:max_running].nil?
12
12
  @errors << { auto_restart: 'Required' } if params[:auto_restart].nil?
13
13
  @errors << { auto_start: 'Required' } if params[:auto_start].nil?
14
-
15
- @memory_max = params[:memory_max]
16
- @cpu_quota = params[:cpu_quota]
17
- @min_running = params[:min_running]
18
- @max_running = params[:max_running]
19
- @auto_restart = params[:auto_restart]
20
- @auto_start = params[:auto_start]
21
-
14
+ @errors << { log_level: 'Required' } if params[:log_level].nil?
15
+ @errors << { num_threads: 'Required' } if params[:num_threads].nil?
16
+
17
+ @memory_max = params[:memory_max]
18
+ @cpu_quota = params[:cpu_quota]
19
+ @min_running = params[:min_running]
20
+ @max_running = params[:max_running]
21
+ @auto_restart = params[:auto_restart]
22
+ @auto_start = params[:auto_start]
23
+ @push_notifications = params[:push_notifications]
24
+ @log_level = params[:log_level]
25
+ @num_threads = params[:num_threads]
22
26
  end
23
27
 
24
28
  def to_message
25
29
  ret = super
26
30
  ret.merge!({ min_running: @min_running, max_running: @max_running, auto_restart: @auto_restart, auto_start: @auto_start })
27
- ret.merge!({ memory_max: @memory_max} ) if !@memory_max.nil?
28
- ret.merge!({ cpu_quota: @cpu_quota} ) if !@cpu_quota.nil?
31
+ ret.merge!({ log_level: @log_level, num_threads: @num_threads })
32
+ ret.merge!({ memory_max: @memory_max} ) if @memory_max.present?
33
+ ret.merge!({ cpu_quota: @cpu_quota} ) if @cpu_quota.present?
34
+ ret.merge!({ push_notifications: @push_notifications} ) if @push_notifications.present?
29
35
  ret
30
36
  end
31
37
 
@@ -36,7 +42,10 @@ module Karma::Messages
36
42
  min_running: min_running,
37
43
  max_running: max_running,
38
44
  auto_restart: auto_restart,
39
- auto_start: auto_start
45
+ auto_start: auto_start,
46
+ push_notifications: push_notifications,
47
+ num_threads: num_threads,
48
+ log_level: log_level
40
49
  }
41
50
  end
42
51
 
@@ -2,7 +2,7 @@ module Karma::Messages
2
2
 
3
3
  class ProcessRegisterMessage < BaseKarma
4
4
 
5
- attr_reader :memory_max, :cpu_quota, :min_running, :max_running, :auto_restart, :auto_start, :log_level, :num_threads, :overwrite
5
+ attr_reader :memory_max, :cpu_quota, :min_running, :max_running, :auto_restart, :auto_start, :push_notifications, :log_level, :num_threads, :overwrite
6
6
 
7
7
  def parse(params)
8
8
  super(params)
@@ -10,6 +10,7 @@ module Karma::Messages
10
10
  @errors << {max_running: 'Required'} if params[:max_running].nil?
11
11
  @errors << {auto_restart: 'Required'} if params[:auto_restart].nil?
12
12
  @errors << {auto_start: 'Required'} if params[:auto_start].nil?
13
+ @errors << {push_notifications: 'Required'} if params[:push_notifications].nil?
13
14
  @errors << {log_level: 'Required'} if params[:log_level].nil?
14
15
  @errors << {num_threads: 'Required'} if params[:num_threads].nil?
15
16
 
@@ -19,6 +20,7 @@ module Karma::Messages
19
20
  @max_running = params[:max_running]
20
21
  @auto_restart = params[:auto_restart]
21
22
  @auto_start = params[:auto_start]
23
+ @push_notifications = params[:push_notifications]
22
24
  @log_level = params[:log_level]
23
25
  @num_threads = params[:num_threads]
24
26
  @overwrite = params[:overwrite] || false
@@ -28,6 +30,7 @@ module Karma::Messages
28
30
  ret = super
29
31
  ret.merge!({ min_running: @min_running, max_running: @max_running,
30
32
  auto_restart: @auto_restart, auto_start: @auto_start,
33
+ push_notifications: @push_notifications,
31
34
  memory_max: @memory_max, cpu_quota: @cpu_quota})
32
35
  ret.merge!({ log_level: @log_level, num_threads: @num_threads })
33
36
  ret.merge!({ overwrite: @overwrite })
@@ -4,7 +4,7 @@ module Karma::Messages
4
4
 
5
5
  STATUSES = {running: 'running', stopped: 'stopped', dead: 'dead'}.freeze
6
6
 
7
- attr_reader :pid, :status
7
+ attr_reader :pid, :status, :active_threads, :execution_time, :performance, :current_version
8
8
 
9
9
  def parse(params)
10
10
  super(params)
@@ -13,11 +13,15 @@ module Karma::Messages
13
13
 
14
14
  @pid = params[:pid]
15
15
  @status = params[:status]
16
+ @active_threads = params[:active_threads]
17
+ @execution_time = params[:execution_time]
18
+ @performance = params[:performance]
19
+ @current_version = params[:current_version]
16
20
  end
17
21
 
18
22
  def to_message
19
23
  ret = super
20
- ret.merge!({ pid: @pid, status: @status })
24
+ ret.merge!({pid: @pid, status: @status, active_threads: @active_threads, execution_time: @execution_time, performance: @performance, current_version: @current_version })
21
25
  end
22
26
 
23
27
  end
@@ -1,5 +1,5 @@
1
1
  module Karma
2
2
  module Messages
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karma_messages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - extendi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-11 00:00:00.000000000 Z
11
+ date: 2017-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -76,7 +76,6 @@ files:
76
76
  - lib/karma_messages/process_config_update_message.rb
77
77
  - lib/karma_messages/process_register_message.rb
78
78
  - lib/karma_messages/process_status_update_message.rb
79
- - lib/karma_messages/thread_config_update_message.rb
80
79
  - lib/karma_messages/version.rb
81
80
  homepage: http://extendi.it
82
81
  licenses: []
@@ -97,9 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
96
  version: '0'
98
97
  requirements: []
99
98
  rubyforge_project:
100
- rubygems_version: 2.4.5
99
+ rubygems_version: 2.5.1
101
100
  signing_key:
102
101
  specification_version: 4
103
102
  summary: summary
104
103
  test_files: []
105
- has_rdoc:
@@ -1,33 +0,0 @@
1
- module Karma::Messages
2
-
3
- class ThreadConfigUpdateMessage < BaseKarmap
4
-
5
- attr_reader :log_level, :num_threads
6
-
7
- def parse(params)
8
- super(params)
9
-
10
- @errors << { log_level: 'Required' } if params[:log_level].nil?
11
- @errors << { num_threads: 'Required' } if params[:num_threads].nil?
12
-
13
- @log_level = params[:log_level]
14
- @num_threads = params[:num_threads]
15
-
16
- end
17
-
18
- def to_message
19
- ret = super
20
- ret.merge!({ log_level: @log_level, num_threads: @num_threads })
21
- ret
22
- end
23
-
24
- def to_config
25
- {
26
- num_threads: num_threads,
27
- log_level: log_level
28
- }
29
- end
30
-
31
- end
32
-
33
- end