norikra-client 0.1.4 → 0.1.5

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: 24adb827550656c05dbb3e1efd3b710bf96a4cbf
4
- data.tar.gz: 0d4afdba61731c59a78e3f834c157eaa3cce5a99
3
+ metadata.gz: 5a04f656f8c12e4e8d044d71784d6af42b5364ec
4
+ data.tar.gz: ddfa6233aadbea05e0606c0cc31f48867a89fc75
5
5
  SHA512:
6
- metadata.gz: 56563aa8ea48f6f9b4163b727b84bc245abc7941c6c51561fad99639335b49837bf4981561a41f83d89146dfd08152a2704a3a6e11c31c9e0d0511f51b7964e3
7
- data.tar.gz: a35f37af2777f643929a9e0688c6ce563075278777ce9062428a65f33f4a5928dd9fed520a08c13c69238769395274664ebe1703aa240621d33f55b30738fe89
6
+ metadata.gz: 68b7aeeea9a889e817a98cd0c6b91b3d50b4a97681936b22b4d2565eff5ec01759676b1944a2b373bcbae9ecaef3bde436548f763f72e659cafc81e5671fa517
7
+ data.tar.gz: b2a1b004cc2558103c4f8ef342c567cb106a7a5144127ac072b74868be35cb1fc80f2d97fc624cec41d84028ee700c04894f5fb384c99d98bcb37650bb333302
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Norikra
2
2
  class Client
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: norikra-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAGOMORI Satoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-07 00:00:00.000000000 Z
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