mettric 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mettric/client.rb +1 -0
- data/lib/mettric/errors.rb +1 -0
- data/lib/mettric/mettric.rb +2 -1
- data/lib/mettric/version.rb +1 -1
- data/lib/mettric/worker.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e90960d6ac1ea5b24dff5c10434738169fb53e11
|
4
|
+
data.tar.gz: 47550cc9c25e78f8b382ff31533c0b97fcd5c0c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 707d923b1083528530c289c438b9bdf0873f6b1edafa3b2eb5484f740546eca990b00129b13cc8a287980ac969e8290fecbf7ae10806ac74e542fdf64024bd7b
|
7
|
+
data.tar.gz: 638b91f7fad2d79a057d1e9fe2a238f310341cf8e3be00109c72d6348da3bf353df1275916aa2542f9f97420d18ec43b8d03855056bebf8ceda9f41a0ce4b651
|
data/lib/mettric/client.rb
CHANGED
data/lib/mettric/errors.rb
CHANGED
data/lib/mettric/mettric.rb
CHANGED
@@ -15,6 +15,7 @@ class Mettric
|
|
15
15
|
def self.track(payload)
|
16
16
|
ensure_worker_running
|
17
17
|
QUEUE << payload
|
18
|
+
QUEUE.size
|
18
19
|
end
|
19
20
|
|
20
21
|
def self.ensure_worker_running
|
@@ -26,7 +27,7 @@ class Mettric
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def self.worker_running?
|
29
|
-
@worker_thread
|
30
|
+
@worker_thread && @worker_thread.alive?
|
30
31
|
end
|
31
32
|
|
32
33
|
def self.start_worker
|
data/lib/mettric/version.rb
CHANGED
data/lib/mettric/worker.rb
CHANGED
@@ -8,25 +8,30 @@ class Mettric::Worker
|
|
8
8
|
|
9
9
|
def start
|
10
10
|
return false if @started
|
11
|
+
puts "Mettric::Worker#start" if @config[:debug]
|
11
12
|
@started = true
|
12
13
|
loop
|
13
14
|
end
|
14
15
|
|
15
16
|
def loop
|
16
17
|
Mettric::Client.new(@config) do |client|
|
18
|
+
deliver(client, service: 'Mettric Worker start') rescue nil
|
17
19
|
while payload = @queue.pop
|
18
20
|
deliver(client, payload)
|
19
21
|
end
|
20
22
|
end
|
23
|
+
binding.pry
|
21
24
|
end
|
22
25
|
|
23
26
|
def stop
|
27
|
+
puts "Mettric::Worker#stop" if @config[:debug]
|
24
28
|
@started = false
|
25
29
|
end
|
26
30
|
|
27
31
|
private
|
28
32
|
|
29
33
|
def deliver(client, payload)
|
34
|
+
puts "Mettric::Worker#deliver #{payload}" if @config[:debug]
|
30
35
|
client << payload
|
31
36
|
end
|
32
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mettric
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jannis Hermanns
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|