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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26438f1d4f0fd0add63205d0440faf5a36173ff3
4
- data.tar.gz: d8b86f52a70da2cc13a84a98236e9398caf26d50
3
+ metadata.gz: 03e2164dbdf319c2849f0e069de9ee0cd874661a
4
+ data.tar.gz: 1ead7eb30a4435ccf37e954a7b9b33cea6244e64
5
5
  SHA512:
6
- metadata.gz: e80dde2a78019b267c5bc1e00ded4474d5201ccbf8952c42b39b92457dcd5cb359be746c0f5c018d714ad9e78c3de5140054a9c1be27ddfe56030892150e6df6
7
- data.tar.gz: ac35a124375e3bdaca4f89626bda990cffe3d55bc5ee052f0d321a3e8bd669a94939f36cd8ae30cf4a6df4230025b8da95867a666c4be298dbce8bd4d315e96d
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.2
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-21 00:00:00.000000000 Z
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