class Norikra::Client
Constants
- RPC_DEFAULT_PORT
- VERSION
Public Class Methods
new(host='localhost', port=RPC_DEFAULT_PORT, connect_timeout: nil, send_timeout: nil, receive_timeout: nil)
click to toggle source
# File lib/norikra/client.rb, line 15 def initialize(host='localhost', port=RPC_DEFAULT_PORT, connect_timeout: nil, send_timeout: nil, receive_timeout: nil) @client = MessagePack::RPCOverHTTP::Client.new("http://#{host}:#{port}/") @client.connect_timeout = connect_timeout if connect_timeout @client.send_timeout = send_timeout if send_timeout @client.receive_timeout = receive_timeout if receive_timeout end
Public Instance Methods
close(target)
click to toggle source
# File lib/norikra/client.rb, line 31 def close(target) @client.call(:close, target) end
deregister(query_name)
click to toggle source
# File lib/norikra/client.rb, line 47 def deregister(query_name) @client.call(:deregister, query_name) end
event(query_name)
click to toggle source
- [time, event], …
# File lib/norikra/client.rb, line 72 def event(query_name) @client.call(:event, query_name) end
fields(target)
click to toggle source
# File lib/norikra/client.rb, line 59 def fields(target) @client.call(:fields, target) end
logs()
click to toggle source
# File lib/norikra/client.rb, line 86 def logs @client.call(:logs) end
modify(target, auto_field)
click to toggle source
# File lib/norikra/client.rb, line 35 def modify(target, auto_field) @client.call(:modify, target, auto_field) end
open(target, fields=nil, auto_field=true)
click to toggle source
# File lib/norikra/client.rb, line 27 def open(target, fields=nil, auto_field=true) @client.call(:open, target, fields, auto_field) end
queries()
click to toggle source
# File lib/norikra/client.rb, line 39 def queries @client.call(:queries) end
register(query_name, query_group, query_expression)
click to toggle source
# File lib/norikra/client.rb, line 43 def register(query_name, query_group, query_expression) @client.call(:register, query_name, query_group, query_expression) end
reserve(target, field, type)
click to toggle source
# File lib/norikra/client.rb, line 63 def reserve(target, field, type) @client.call(:reserve, target, field, type) end
resume(query_name)
click to toggle source
# File lib/norikra/client.rb, line 55 def resume(query_name) @client.call(:resume, query_name) end
see(query_name)
click to toggle source
- [time, event], …
# File lib/norikra/client.rb, line 77 def see(query_name) @client.call(:see, query_name) end
send(target, events)
click to toggle source
# File lib/norikra/client.rb, line 67 def send(target, events) @client.call(:send, target, events) end
suspend(query_name)
click to toggle source
# File lib/norikra/client.rb, line 51 def suspend(query_name) @client.call(:suspend, query_name) end
sweep(query_group=nil)
click to toggle source
{'query_name' => [ [time, event], … ]}
# File lib/norikra/client.rb, line 82 def sweep(query_group=nil) @client.call(:sweep, query_group) end
targets()
click to toggle source
# File lib/norikra/client.rb, line 23 def targets @client.call(:targets) #=> {:name => "name", :auto_field => true} end