statscloud 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +7 -7
- data/lib/generators/stats_cloud/install_generator.rb +1 -1
- data/lib/statscloud/helpers/statscloud_client/statscloud_helper.rb +11 -3
- data/lib/statscloud/statsmeter_client.rb +4 -3
- data/lib/statscloud/version.rb +1 -1
- data/lib/templates/statscloud/{.statscloud_template.yml → statscloud_template.yml} +0 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 09e53f93e0256bdb1d7cca10342ca813c3f24ca2
|
4
|
+
data.tar.gz: 8908fbe41125fdd6360e67a1f14abc2118ae7a55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5bd4090110b99032c7994729bae102d56a53b1479ff8ca0dad5e94ab3e2512a5ca8fa29b48cf20678048d78f3891f5c777c4f5f87b7bcd42c27f31b60f63e8d
|
7
|
+
data.tar.gz: 8c56520587fb19179306cd19dd52d49b3ad9ab5f964ef53b42ce7f013f40565b15c6cccbab964796f76f3ed1c39b384cfceff52afaf4179b3e965fcd72e3eb96
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
statscloud (1.1.
|
4
|
+
statscloud (1.1.2)
|
5
5
|
crc32 (~> 1.0.1)
|
6
6
|
eventmachine (~> 1.2)
|
7
7
|
fileutils
|
@@ -32,9 +32,9 @@ GEM
|
|
32
32
|
httparty (0.16.3)
|
33
33
|
mime-types (~> 3.0)
|
34
34
|
multi_xml (>= 0.5.2)
|
35
|
-
i18n (1.2
|
35
|
+
i18n (1.5.2)
|
36
36
|
concurrent-ruby (~> 1.0)
|
37
|
-
jaro_winkler (1.5.
|
37
|
+
jaro_winkler (1.5.2)
|
38
38
|
json (2.1.0)
|
39
39
|
leon (1.1.2)
|
40
40
|
logger (1.3.0)
|
@@ -44,8 +44,8 @@ GEM
|
|
44
44
|
minitest (5.11.3)
|
45
45
|
multi_xml (0.6.0)
|
46
46
|
netrc (0.11.0)
|
47
|
-
parallel (1.
|
48
|
-
parser (2.
|
47
|
+
parallel (1.13.0)
|
48
|
+
parser (2.6.0.0)
|
49
49
|
ast (~> 2.4.0)
|
50
50
|
powerpack (0.1.2)
|
51
51
|
rainbow (3.0.0)
|
@@ -87,7 +87,7 @@ GEM
|
|
87
87
|
unf (0.1.4)
|
88
88
|
unf_ext
|
89
89
|
unf_ext (0.0.7.5)
|
90
|
-
unicode-display_width (1.4.
|
90
|
+
unicode-display_width (1.4.1)
|
91
91
|
websocket (1.2.8)
|
92
92
|
websocket-client-simple (0.3.0)
|
93
93
|
event_emitter
|
@@ -105,4 +105,4 @@ DEPENDENCIES
|
|
105
105
|
statscloud!
|
106
106
|
|
107
107
|
BUNDLED WITH
|
108
|
-
1.
|
108
|
+
1.16.0
|
@@ -12,7 +12,7 @@ module StatsCloud
|
|
12
12
|
def initialize_values
|
13
13
|
@config = {}
|
14
14
|
@source_mappings = { metrics: [], admins: [], dashboards: [], alerts: [] }
|
15
|
-
update_config_file("
|
15
|
+
update_config_file("statscloud.yml")
|
16
16
|
end
|
17
17
|
|
18
18
|
def generate_configuration(base_config)
|
@@ -49,7 +49,7 @@ module StatsCloud
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def update_config_file(file)
|
52
|
-
@config_file = file
|
52
|
+
@config_file = rails_environment ? config_dir_file(file) : file
|
53
53
|
end
|
54
54
|
|
55
55
|
def config_token
|
@@ -57,7 +57,7 @@ module StatsCloud
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def env
|
60
|
-
@env ||= @config["environment"] ||
|
60
|
+
@env ||= @config["environment"] || rails_environment || "default"
|
61
61
|
end
|
62
62
|
|
63
63
|
def tags
|
@@ -89,6 +89,14 @@ module StatsCloud
|
|
89
89
|
"statscloud.io support configured, dashboard URLs are \n#{(@cluster['grafanaDashboardsUrls'] || []).join("\n")}"
|
90
90
|
end
|
91
91
|
|
92
|
+
def config_dir_file(file)
|
93
|
+
File.join("config", file)
|
94
|
+
end
|
95
|
+
|
96
|
+
def rails_environment
|
97
|
+
ENV["RAILS_ENV"]
|
98
|
+
end
|
99
|
+
|
92
100
|
def statscloud_error(message)
|
93
101
|
StatsCloud::ClientError.new(message)
|
94
102
|
end
|
@@ -64,12 +64,13 @@ module StatsCloud
|
|
64
64
|
end
|
65
65
|
|
66
66
|
# Connects to the server and starts periodic sending events.
|
67
|
-
def connect(register_connection_job)
|
67
|
+
def connect(register_connection_job = nil)
|
68
|
+
@register_connection_job ||= register_connection_job
|
68
69
|
Thread.new do
|
69
70
|
connect_client
|
70
71
|
start_plugins
|
71
72
|
flush_events_loop
|
72
|
-
register_connection_job
|
73
|
+
@register_connection_job&.start
|
73
74
|
end
|
74
75
|
end
|
75
76
|
|
@@ -143,7 +144,7 @@ module StatsCloud
|
|
143
144
|
eventmachine.run do
|
144
145
|
eventmachine.add_periodic_timer(0.5) do
|
145
146
|
@mutex.synchronize do
|
146
|
-
flush_events
|
147
|
+
connected? ? flush_events : connect.join
|
147
148
|
end
|
148
149
|
end
|
149
150
|
end
|
data/lib/statscloud/version.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statscloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Ovcharov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: crc32
|
@@ -213,8 +213,8 @@ files:
|
|
213
213
|
- lib/statscloud/statscloud_client.rb
|
214
214
|
- lib/statscloud/statsmeter_client.rb
|
215
215
|
- lib/statscloud/version.rb
|
216
|
-
- lib/templates/statscloud/.statscloud_template.yml
|
217
216
|
- lib/templates/statscloud/statscloud_template.rb
|
217
|
+
- lib/templates/statscloud/statscloud_template.yml
|
218
218
|
- statscloud.gemspec
|
219
219
|
homepage: https://statscloud.io
|
220
220
|
licenses:
|
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
237
237
|
version: '0'
|
238
238
|
requirements: []
|
239
239
|
rubyforge_project:
|
240
|
-
rubygems_version: 2.
|
240
|
+
rubygems_version: 2.5.1
|
241
241
|
signing_key:
|
242
242
|
specification_version: 4
|
243
243
|
summary: StatsCloud service.
|