statscloud 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -15
- data/lib/statscloud/helpers/assets_helper.rb +1 -1
- data/lib/statscloud/helpers/logger_helper.rb +3 -4
- data/lib/statscloud/helpers/parsed_response_helper.rb +1 -2
- data/lib/statscloud/helpers/plugins_helper.rb +2 -2
- data/lib/statscloud/helpers/statscloud_helper.rb +2 -3
- data/lib/statscloud/statscloud_client.rb +3 -3
- data/lib/statscloud/version.rb +1 -1
- data/statscloud.gemspec +0 -1
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00ef058f3553e52eec23bd98630e643ab43a323f67684681994263010249d202
|
4
|
+
data.tar.gz: f56e77cd1509110497f847e69cb0180890325a567a09415c1b0a8fc3f6d052e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: debc25c241c6b738f9638c04ea2fedad7ea4c8948978ef830acb4c28d141c7b50fc41e8046d07277072110adc7c6c35e44acf078dcd3b203b1750871fe06de77
|
7
|
+
data.tar.gz: e531513f320a1785c27cbaabfc7847b2ae91562c6a2d12bb60b11f979b74e81fd00a90e2d6438d5fedd5d44924b0acbc2504175e89c451c3334688d23294df88
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
statscloud (1.0.
|
5
|
-
activesupport (~> 5.2)
|
4
|
+
statscloud (1.0.9)
|
6
5
|
crc32 (~> 1.0.1)
|
7
6
|
eventmachine (~> 1.2)
|
8
7
|
fileutils
|
@@ -14,12 +13,6 @@ PATH
|
|
14
13
|
GEM
|
15
14
|
remote: https://rubygems.org/
|
16
15
|
specs:
|
17
|
-
activesupport (5.2.1.1)
|
18
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
19
|
-
i18n (>= 0.7, < 2)
|
20
|
-
minitest (~> 5.1)
|
21
|
-
tzinfo (~> 1.1)
|
22
|
-
concurrent-ruby (1.1.3)
|
23
16
|
crc32 (1.0.1)
|
24
17
|
diff-lcs (1.3)
|
25
18
|
domain_name (0.5.20180417)
|
@@ -32,15 +25,12 @@ GEM
|
|
32
25
|
httparty (0.16.3)
|
33
26
|
mime-types (~> 3.0)
|
34
27
|
multi_xml (>= 0.5.2)
|
35
|
-
i18n (1.1.1)
|
36
|
-
concurrent-ruby (~> 1.0)
|
37
28
|
json (2.1.0)
|
38
29
|
leon (1.1.2)
|
39
|
-
logger (1.
|
30
|
+
logger (1.3.0)
|
40
31
|
mime-types (3.2.2)
|
41
32
|
mime-types-data (~> 3.2015)
|
42
33
|
mime-types-data (3.2018.0812)
|
43
|
-
minitest (5.11.3)
|
44
34
|
multi_xml (0.6.0)
|
45
35
|
netrc (0.11.0)
|
46
36
|
rake (10.5.0)
|
@@ -66,9 +56,6 @@ GEM
|
|
66
56
|
httparty
|
67
57
|
json
|
68
58
|
websocket-client-simple (~> 0.3.0)
|
69
|
-
thread_safe (0.3.6)
|
70
|
-
tzinfo (1.2.5)
|
71
|
-
thread_safe (~> 0.1)
|
72
59
|
unf (0.1.4)
|
73
60
|
unf_ext
|
74
61
|
unf_ext (0.0.7.5)
|
@@ -89,7 +89,7 @@ module StatsCloud
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def it_directory?(file_name, entry)
|
92
|
-
File.directory?(file_name) && not_required_directory.
|
92
|
+
File.directory?(file_name) && !not_required_directory.include?(entry)
|
93
93
|
end
|
94
94
|
|
95
95
|
def it_config_file?(file_name, asset_selector)
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "fileutils"
|
4
|
-
require "active_support/core_ext/numeric/time"
|
5
4
|
|
6
5
|
module StatsCloud
|
7
6
|
# This helper works to help log errors and info about StatsCloud service work.
|
@@ -37,7 +36,7 @@ module StatsCloud
|
|
37
36
|
end
|
38
37
|
|
39
38
|
def can_log?(last_log_at)
|
40
|
-
last_log_at.nil? || Time.now - last_log_at >
|
39
|
+
last_log_at.nil? || Time.now.to_i - last_log_at > 600
|
41
40
|
end
|
42
41
|
|
43
42
|
def log_stop_logging(message_type)
|
@@ -45,11 +44,11 @@ module StatsCloud
|
|
45
44
|
end
|
46
45
|
|
47
46
|
def update_last_info_at
|
48
|
-
@last_info_log_at = Time.now
|
47
|
+
@last_info_log_at = Time.now.to_i
|
49
48
|
end
|
50
49
|
|
51
50
|
def update_last_error_at
|
52
|
-
@last_error_log_at = Time.now
|
51
|
+
@last_error_log_at = Time.now.to_i
|
53
52
|
end
|
54
53
|
|
55
54
|
def info_type
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "json"
|
4
|
-
require "active_support/all"
|
5
4
|
|
6
5
|
module StatsCloud
|
7
6
|
# This helper works to parse response from the server to convenient object.
|
@@ -28,7 +27,7 @@ module StatsCloud
|
|
28
27
|
private
|
29
28
|
|
30
29
|
def parse_json(json, default = nil)
|
31
|
-
JSON.parse(json)
|
30
|
+
JSON.parse(json)
|
32
31
|
rescue JSON::ParserError
|
33
32
|
default
|
34
33
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "leon"
|
4
|
-
require "active_support/core_ext"
|
5
4
|
require_relative "../errors/client_error"
|
6
5
|
|
7
6
|
module StatsCloud
|
@@ -17,7 +16,7 @@ module StatsCloud
|
|
17
16
|
|
18
17
|
def validate_configuration
|
19
18
|
@app = @config["application"]
|
20
|
-
raise error(app_name_missing_error_message) if @app.
|
19
|
+
raise error(app_name_missing_error_message) if @app.nil? || @app.empty?
|
21
20
|
end
|
22
21
|
|
23
22
|
def config_environment(env)
|
@@ -62,7 +61,7 @@ module StatsCloud
|
|
62
61
|
end
|
63
62
|
|
64
63
|
def successful_message
|
65
|
-
"statscloud.io support configured, dashboard URLs are \n #{(@cluster[
|
64
|
+
"statscloud.io support configured, dashboard URLs are \n #{(@cluster['grafanaDashboardsUrls'] || []).join("\n")}"
|
66
65
|
end
|
67
66
|
|
68
67
|
def statscloud_error(message)
|
@@ -158,13 +158,13 @@ module StatsCloud
|
|
158
158
|
@cluster_client = create_cluster_client
|
159
159
|
@cluster_client.deploy_cluster(@token, @app, @config)
|
160
160
|
@cluster = @cluster_client.get_cluster(@token, @app).body
|
161
|
-
@graphite_url = @cluster[
|
161
|
+
@graphite_url = @cluster["graphiteUrl"]
|
162
162
|
check_cluster_status(@cluster)
|
163
163
|
log_info successful_message
|
164
164
|
end
|
165
165
|
|
166
166
|
def check_cluster_status(cluster)
|
167
|
-
raise error(cluster_error_message) if cluster.nil? || cluster[
|
167
|
+
raise error(cluster_error_message) if cluster.nil? || cluster["status"]["status"] == "ERROR"
|
168
168
|
end
|
169
169
|
|
170
170
|
def connect_to_cluster
|
@@ -181,7 +181,7 @@ module StatsCloud
|
|
181
181
|
end
|
182
182
|
|
183
183
|
def create_statsmeter_client(cluster, token, plugins, tags)
|
184
|
-
host = cluster[
|
184
|
+
host = cluster["statsmeterUrl"]
|
185
185
|
StatsCloud::StatsmeterClient.new(host, token, plugins, tags)
|
186
186
|
end
|
187
187
|
end
|
data/lib/statscloud/version.rb
CHANGED
data/statscloud.gemspec
CHANGED
@@ -33,7 +33,6 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
34
34
|
spec.require_paths = ["lib"]
|
35
35
|
|
36
|
-
spec.add_dependency "activesupport", "~> 5.2"
|
37
36
|
spec.add_dependency "crc32", "~> 1.0.1"
|
38
37
|
spec.add_dependency "eventmachine", "~> 1.2"
|
39
38
|
spec.add_dependency "fileutils"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statscloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Ovcharov
|
@@ -10,20 +10,6 @@ bindir: exe
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2018-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: activesupport
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '5.2'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '5.2'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: crc32
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|