datascope 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/datascope.gemspec +1 -1
- data/lib/datascope.rb +3 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f762210df42da4e62c219e7478faa40aecd1ea5
|
4
|
+
data.tar.gz: 21a3aaaafc186304dba86599ad7e57d57c08aea2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38083e856abaad22b67f38371f188b3d873c8a21a6005f3dee15ed0b89c6bb5c36dc4f8db7f09146073d61436acfd3206ef04a28a26de0f1208455c092f36e7f
|
7
|
+
data.tar.gz: abe43ace79a9edc5d093108405e8a67c690fe13fa02efba8571efc73773de784c7978aba59010c4430de7e6eb9752feac783f50522e74b1476f07124bd4d170d
|
data/datascope.gemspec
CHANGED
data/lib/datascope.rb
CHANGED
@@ -56,10 +56,9 @@ class Datascope < Sinatra::Base
|
|
56
56
|
end
|
57
57
|
|
58
58
|
get '/queries' do
|
59
|
-
|
60
|
-
|
61
|
-
|
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
|
|