simple_stats_store 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/lib/simple_stats_store/server.rb +2 -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: 03e2164dbdf319c2849f0e069de9ee0cd874661a
|
4
|
+
data.tar.gz: 1ead7eb30a4435ccf37e954a7b9b33cea6244e64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 417d80a4426147b7602d87aec5ef390ec56469b11325a245cff949d394a50d00188ca177ea39642fc5f056c13f48ecf4c2392200da3c1847e211063ce085cedb
|
7
|
+
data.tar.gz: 8f28c0fccfaf8bc7034acb8ffd681bdac4c5c88063a091f31de69af37e61bd20dee13e2d85f6611353c6ba4b92a20bb1126776ff00d075b4680196e5e9e2eafb
|
data/README.md
CHANGED
@@ -34,11 +34,13 @@ Set up the database:
|
|
34
34
|
|
35
35
|
```ruby
|
36
36
|
require 'simple_stats_store/server'
|
37
|
+
require 'active_record'
|
37
38
|
|
38
39
|
db_file = '/path/to/database.sql'
|
39
40
|
ActiveRecord::Base.establish_connection(
|
40
41
|
adapter: :sqlite3,
|
41
|
-
database: db_file
|
42
|
+
database: db_file,
|
43
|
+
timeout: 200
|
42
44
|
)
|
43
45
|
ActiveRecord::Schema.define do
|
44
46
|
create_table :table do |table|
|
@@ -53,7 +55,8 @@ end
|
|
53
55
|
|
54
56
|
ssss = SimpleStatsStore::Server.new(
|
55
57
|
data_dump: data_dump,
|
56
|
-
models: { table_ref: Table }
|
58
|
+
models: { table_ref: Table },
|
59
|
+
name: 'process_name' # Optional
|
57
60
|
)
|
58
61
|
|
59
62
|
t_next = Time.new + 300
|
@@ -3,6 +3,7 @@ module SimpleStatsStore
|
|
3
3
|
def initialize(options)
|
4
4
|
@data_dump = options[:data_dump]
|
5
5
|
@models = options[:models]
|
6
|
+
@name = options[:name] || $0
|
6
7
|
end
|
7
8
|
|
8
9
|
def scan
|
@@ -26,6 +27,7 @@ module SimpleStatsStore
|
|
26
27
|
|
27
28
|
def run(&block)
|
28
29
|
Process.fork do
|
30
|
+
$0 = @name
|
29
31
|
loop do
|
30
32
|
self.scan
|
31
33
|
yield if block_given?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_stats_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Haig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Using SQLite3 to store statistics from a multithreaded application
|
14
14
|
email: joe.haig@bbc.co.uk
|