datascope 0.0.9 → 0.0.10

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: 9e90e57a3e62c65f6f8843fb4bec31184a270249
4
- data.tar.gz: c3974c631c66b96d8298370265c2a978e578f625
3
+ metadata.gz: 9bb6df7ac31e658a07b0daa8ef74c98e4817aa1d
4
+ data.tar.gz: a860a5cd025dc941daea7f83783123f0f04d3853
5
5
  SHA512:
6
- metadata.gz: a12b88ad428e32cc6bfb402783aa63440feae6626cbf56e3841b6eed393346f6054e185d501641319d46355b2fd2573641ad3b74b0708cd75c6eb0fb02a30202
7
- data.tar.gz: 7947b2fd17e3c4ce9492aea1886be52b88d13c2dbfc241402e1f0f60e2c809d7fd8b51a480e54abefa24fcd4c1abb78ef9d87059cf7193aa1d0b4f135b85c2d6
6
+ metadata.gz: 17a083db8668388d865458fe28338df6f1fa35ed14db13d042d63462284f8dbff4df021ae935373ae7901d3d2eefe1b2fe045f4185c7ebc12dfe3e0f8f8e50d0
7
+ data.tar.gz: e118a8d3d3b81d5208cbd64cba6504e0be30b51bf1acc3a0016215acba33a328c183ee82071831744f69ea276c192ee8869b6dbbfbf93133a083a642b275f4a1
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path(File.dirname(__FILE__) + "/../lib") + '/stat_collector'
3
+
4
+ puts "Pruned %d rows" % StatCollector.prune_stats!
data/datascope.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "datascope"
7
- gem.version = "0.0.9"
7
+ gem.version = "0.0.10"
8
8
  gem.authors = ["Will Leinweber"]
9
9
  gem.email = []
10
10
  gem.description = %q{postgres 9.2 visibility}
@@ -17,6 +17,10 @@ module StatCollector
17
17
  }
18
18
  end
19
19
 
20
+ def prune_stats!
21
+ DB[:stats].where('created_at < ?', Date.today - 1).delete
22
+ end
23
+
20
24
  def capture_stats!
21
25
  s = stats
22
26
  DB[:stats] << {data: s.to_json}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datascope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Leinweber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-12 00:00:00.000000000 Z
11
+ date: 2014-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -111,6 +111,7 @@ dependencies:
111
111
  description: postgres 9.2 visibility
112
112
  email: []
113
113
  executables:
114
+ - datascope_prune
114
115
  - datascope_worker
115
116
  extensions: []
116
117
  extra_rdoc_files: []
@@ -121,6 +122,7 @@ files:
121
122
  - Procfile
122
123
  - Rakefile
123
124
  - Readme.md
125
+ - bin/datascope_prune
124
126
  - bin/datascope_worker
125
127
  - config.ru
126
128
  - datascope.gemspec