datascope 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/datascope.gemspec +1 -1
  3. data/lib/datascope.rb +3 -4
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 281438ec6bf435cf98848920f227afb12fdb1c33
4
- data.tar.gz: cbbd126b40f5a5369c57408d4a748e615174ae52
3
+ metadata.gz: 6f762210df42da4e62c219e7478faa40aecd1ea5
4
+ data.tar.gz: 21a3aaaafc186304dba86599ad7e57d57c08aea2
5
5
  SHA512:
6
- metadata.gz: 351980c6f70437a437230e56b3031c5ea76b02a70f25a0041adcdffcf9cbed9ce426758968032235c2815b6f13da3a1823ec13fe4a5fddebf660f2d26751f861
7
- data.tar.gz: 16a1cfbc889058ea96054da02c36a378ccc692708f3b2de774a59dd6a967963435ddd822c0c75a9f0d85e629af9dc931da2be4e25b47e7c07317d1c92443d007
6
+ metadata.gz: 38083e856abaad22b67f38371f188b3d873c8a21a6005f3dee15ed0b89c6bb5c36dc4f8db7f09146073d61436acfd3206ef04a28a26de0f1208455c092f36e7f
7
+ data.tar.gz: abe43ace79a9edc5d093108405e8a67c690fe13fa02efba8571efc73773de784c7978aba59010c4430de7e6eb9752feac783f50522e74b1476f07124bd4d170d
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.4"
7
+ gem.version = "0.0.5"
8
8
  gem.authors = ["Will Leinweber"]
9
9
  gem.email = []
10
10
  gem.description = %q{postgres 9.2 visibility}
data/lib/datascope.rb CHANGED
@@ -56,10 +56,9 @@ class Datascope < Sinatra::Base
56
56
  end
57
57
 
58
58
  get '/queries' do
59
- data = JSON.parse DB[:stats]
60
- .select(:data)
61
- .order_by(:id.desc)
62
- .first[:data]
59
+ stats = DB[:stats].select(:data).reverse_order(:id)
60
+ return JSON.dump([]) unless stats.first
61
+ data = JSON.parse stats.first[:data]
63
62
  JSON.dump data['stat_statements'].map{|s| s['query'] = s['query'][0..50]; s}.sort{|s| s['total_time']}.reverse
64
63
  end
65
64
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datascope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Leinweber