karma_messages 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -1
- data/Gemfile.lock +12 -12
- data/lib/karma_messages.rb +1 -1
- data/lib/karma_messages/base.rb +0 -1
- data/lib/karma_messages/process_config_update_message.rb +21 -12
- data/lib/karma_messages/process_register_message.rb +4 -1
- data/lib/karma_messages/process_status_update_message.rb +6 -2
- data/lib/karma_messages/version.rb +1 -1
- metadata +3 -5
- data/lib/karma_messages/thread_config_update_message.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 664f2770a35934c659b176ad68f757879b79545f
|
4
|
+
data.tar.gz: d0c25ed8a1bc347990d46c4026967803fcc10174
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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.
|
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.
|
13
|
-
rspec-core (~> 3.
|
14
|
-
rspec-expectations (~> 3.
|
15
|
-
rspec-mocks (~> 3.
|
16
|
-
rspec-core (3.
|
17
|
-
rspec-support (~> 3.
|
18
|
-
rspec-expectations (3.
|
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.
|
21
|
-
rspec-mocks (3.
|
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.
|
24
|
-
rspec-support (3.
|
23
|
+
rspec-support (~> 3.6.0)
|
24
|
+
rspec-support (3.6.0)
|
25
25
|
|
26
26
|
PLATFORMS
|
27
27
|
ruby
|
data/lib/karma_messages.rb
CHANGED
data/lib/karma_messages/base.rb
CHANGED
@@ -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
|
-
@
|
16
|
-
|
17
|
-
@
|
18
|
-
@
|
19
|
-
@
|
20
|
-
@
|
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!({
|
28
|
-
ret.merge!({
|
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!({
|
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
|
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.
|
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-
|
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.
|
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
|