norikra-client-jruby 0.1.4-java → 0.1.5-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/norikra/client/cli.rb +41 -0
- data/lib/norikra/client/version.rb +1 -1
- 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: 54c8ac9f3560f9a9a2424e94a6f9c95315c21e64
|
4
|
+
data.tar.gz: 0b0ef3d3c3aeb68b9afb2fe6dec82e9492ad404e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2490fc54acab73c0035ffeeb78753027a73d80f780dc40ff647a1a8c2502d2508ef49f2da628224ac6f33bdecf7a11d0b8276c28e6222a3d6b7ef2df7b0af24
|
7
|
+
data.tar.gz: 8be153f739468c12e9cc41a09574cb1bf4aa24f2f3096ba2cba2385a43ac57866a27293a07cbd3e7086d21c1ec861dc1fd7cfdeec382107507c0e163b14b26cb
|
data/lib/norikra/client/cli.rb
CHANGED
@@ -213,6 +213,44 @@ class Norikra::Client
|
|
213
213
|
end
|
214
214
|
end
|
215
215
|
|
216
|
+
class Admin < Thor
|
217
|
+
include Norikra::Client::CLIUtil
|
218
|
+
|
219
|
+
desc "stats", "dump stats json: same with norikra server's --stats option"
|
220
|
+
def stats
|
221
|
+
client = client(parent_options)
|
222
|
+
|
223
|
+
targets = []
|
224
|
+
queries = []
|
225
|
+
|
226
|
+
wrap do
|
227
|
+
queries = client.queries()
|
228
|
+
|
229
|
+
client.targets().each do |t|
|
230
|
+
fields = {}
|
231
|
+
client.fields(t['name']).each do |f|
|
232
|
+
next if f['type'] == 'hash' || f['type'] == 'array'
|
233
|
+
fields[f['name']] = f
|
234
|
+
end
|
235
|
+
targets.push( { "name" => t['name'], "fields" => fields, "auto_field" => t['auto_field'] } )
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
require 'json'
|
240
|
+
|
241
|
+
puts JSON.pretty_generate({
|
242
|
+
"threads" => {
|
243
|
+
"engine" => { "inbound" => {}, "outbound" => {}, "route_exec" => {}, "timer_exec" => {} },
|
244
|
+
"rpc" => {},
|
245
|
+
"web" => {},
|
246
|
+
},
|
247
|
+
"log" => {},
|
248
|
+
"targets" => targets,
|
249
|
+
"queries" => queries,
|
250
|
+
})
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
216
254
|
class CLI < Thor
|
217
255
|
include Norikra::Client::CLIUtil
|
218
256
|
|
@@ -230,5 +268,8 @@ class Norikra::Client
|
|
230
268
|
|
231
269
|
desc "event CMD ...ARGS", "send/fetch events"
|
232
270
|
subcommand "event", Event
|
271
|
+
|
272
|
+
desc "admin CMD ...ARGS", "norikra server administrations"
|
273
|
+
subcommand "admin", Admin
|
233
274
|
end
|
234
275
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: norikra-client-jruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- TAGOMORI Satoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack-rpc-over-http-jruby
|