process_metrics 0.1.7 → 0.1.8

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: acb69e8140574fb9fb22047aa33a99d84906474c
4
- data.tar.gz: b0a1a95ddf0720eb8fd8fc8135ee4999b1f2801d
3
+ metadata.gz: b98e3b676d6ec67e9fe437eee8b8554ed18d81cf
4
+ data.tar.gz: 8c2fdab23c39e591a76ded44e87bc4a50612b3ca
5
5
  SHA512:
6
- metadata.gz: d86382d809a208c3cde308290c72cec88d34217c084113274b8d123ad3e9ee0f9b1c40ac2300770038ff9ceca00ccdfe6c4c4aa5781a74c330bfe87ed14ba39e
7
- data.tar.gz: 3fef137149674f5d6e3894fcc9d1f1c624d79e7d9b58fdd5861185c140d3505209b4d1a28ffb546d15bf5f74aff6ce3450a3b2688b111a4c7fc60f64a0feee02
6
+ metadata.gz: b1a87b8af87f87448adad2133b95a8ae52507cdc45edb1e04e37cf976047184e25b0cfb67ae44e52ad7d3587f7203bc8e1ec3fd5d0e1636eef50e7ed3e3a344f
7
+ data.tar.gz: 2341c0c80b57c40517bdd398a52c176ca45a3cef3da32bf986970733d75a9356b10ca79af8a843d9eed2f854b4f240160dc13a5d9a2c2b3b1cec5b3c3da3865b
@@ -49,7 +49,8 @@ module ProcessMetrics
49
49
  result = block.call metric
50
50
  metric.finish
51
51
  ensure
52
- Thread.new(metric) { |_metric| _metric.save }
52
+ Celluloid.internal_pool = Celluloid::InternalPool.new
53
+ SaveJob.new.async.perform metric
53
54
  end
54
55
  result
55
56
  end
@@ -0,0 +1,10 @@
1
+ require 'sucker_punch'
2
+
3
+ class SaveJob
4
+ include SuckerPunch::Job
5
+ workers 4
6
+
7
+ def perform(metric)
8
+ metric.save
9
+ end
10
+ end
@@ -1 +1,2 @@
1
1
  require 'process_metrics/persistence/logger'
2
+ require 'process_metrics/persistence/save_job'
@@ -1,3 +1,3 @@
1
1
  module ProcessMetrics
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: process_metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucas Uyezu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-24 00:00:00.000000000 Z
11
+ date: 2014-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -30,6 +30,26 @@ dependencies:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.0.5
33
+ - !ruby/object:Gem::Dependency
34
+ name: sucker_punch
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.0'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 1.0.2
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '1.0'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 1.0.2
33
53
  - !ruby/object:Gem::Dependency
34
54
  name: pry-debugger
35
55
  requirement: !ruby/object:Gem::Requirement
@@ -83,6 +103,7 @@ files:
83
103
  - lib/process_metrics/config.rb
84
104
  - lib/process_metrics/persistence.rb
85
105
  - lib/process_metrics/persistence/logger.rb
106
+ - lib/process_metrics/persistence/save_job.rb
86
107
  - lib/process_metrics/timer.rb
87
108
  - lib/process_metrics/version.rb
88
109
  - test/test_simple.rb