norikra 1.3.0.beta.1-java → 1.3.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +2 -0
- data/Changes.md +12 -0
- data/README.md +4 -0
- data/lib/norikra/cli.rb +3 -0
- data/lib/norikra/engine.rb +18 -0
- data/lib/norikra/logger.rb +1 -1
- data/lib/norikra/query.rb +3 -3
- data/lib/norikra/rpc.rb +1 -1
- data/lib/norikra/rpc/http.rb +2 -2
- data/lib/norikra/server.rb +4 -1
- data/lib/norikra/version.rb +1 -1
- data/lib/norikra/webui.rb +1 -0
- data/lib/norikra/webui/api.rb +6 -0
- data/lib/norikra/webui/handler.rb +8 -6
- data/lib/norikra/webui/helpers.rb +6 -0
- data/lib/norikra/webui/http.rb +6 -4
- data/norikra.gemspec +3 -3
- data/spec/issue64_spec.rb +133 -0
- data/spec/spec_helper.rb +1 -0
- data/views/base.erb +6 -7
- data/views/index.erb +10 -10
- metadata +21 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 433cc2c4627c7ffb89e53593554c0d753efed3fa
|
4
|
+
data.tar.gz: f84997f4d922a907e393ca4874d824fad15696a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8dc68faee3c58a89bbddd63f397c502a2d6b390dfa8b45b13ccb7f5b32a37e67f950a9fea03c7572b5e2d2db7b577f642508901aac4c81a618b3370cd880077
|
7
|
+
data.tar.gz: 3956670365f70aa0afde000dde7eba43414e81a646f5dfd00ae7ef22d532ca505101815056443203f41d13e9027e4ed832d258f8bcab5d6625e33697582e748b
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
jruby-1.7.
|
1
|
+
jruby-1.7.19
|
data/.travis.yml
CHANGED
data/Changes.md
CHANGED
@@ -3,6 +3,18 @@
|
|
3
3
|
Changes of norikra.
|
4
4
|
|
5
5
|
## v1
|
6
|
+
* v1.3.0
|
7
|
+
* Esper-5.2 bundle
|
8
|
+
* Dependency update for msgpack.gem
|
9
|
+
* Dynamic plugin reloading
|
10
|
+
* Add experimental `shutoff` mode to reject input data under high memory pressure
|
11
|
+
* Fix number of Jetty threads while running to reduce GC troubles under high memory pressure
|
12
|
+
* Add `/engine_statistics` API endpoint
|
13
|
+
* Add GC statistics in Engine statistics
|
14
|
+
* Add `--ui-context-path` option to mount Norikra WebUI atop of path user specified on reverse proxy servers
|
15
|
+
* Fix Bug:
|
16
|
+
* not to rewrite field names in subqueries (issue #64)
|
17
|
+
* not to load stats files containing multibyte characters
|
6
18
|
* v1.2.2
|
7
19
|
* Change API for custom listner plugins (incompatible with 1.2.0, 1.2.1)
|
8
20
|
* v1.2.1
|
data/README.md
CHANGED
data/lib/norikra/cli.rb
CHANGED
@@ -28,6 +28,8 @@ module Norikra
|
|
28
28
|
option :'shutoff-threshold', type: :numeric, default: 90, desc: 'threshold percent of heap memory usage to turn "shutoff mode" on'
|
29
29
|
option :'shutoff-check-interval', type: :numeric, default: 10, desc: 'interval seconds to turn "shutoff mode" on/off'
|
30
30
|
|
31
|
+
option :'ui-context-path', type: :string, default: nil, desc: 'Web UI context path'
|
32
|
+
|
31
33
|
### Daemonize options
|
32
34
|
option :daemonize, type: :boolean, default: false, aliases: "-d", \
|
33
35
|
desc: 'daemonize Norikra server [false (foreground)]'
|
@@ -251,6 +253,7 @@ module Norikra
|
|
251
253
|
host: options[:host],
|
252
254
|
port: options[:port],
|
253
255
|
ui_port: options[:'ui-port'],
|
256
|
+
ui_context_path: options[:'ui-context-path'],
|
254
257
|
}
|
255
258
|
|
256
259
|
server = Norikra::Server.new( server_options, conf )
|
data/lib/norikra/engine.rb
CHANGED
@@ -55,6 +55,7 @@ module Norikra
|
|
55
55
|
started: s[:started].rfc2822,
|
56
56
|
uptime: self.uptime,
|
57
57
|
memory: self.memory_statistics,
|
58
|
+
garbage_collector: self.gc_statistics,
|
58
59
|
input_events: s[:events][:input],
|
59
60
|
processed_events: s[:events][:processed],
|
60
61
|
output_events: s[:events][:output],
|
@@ -96,6 +97,21 @@ module Norikra
|
|
96
97
|
{ heap: heap, nonheap: non_heap }
|
97
98
|
end
|
98
99
|
|
100
|
+
def gc_statistics
|
101
|
+
gcBeans = Java::JavaLangManagement::ManagementFactory.getGarbageCollectorMXBeans()
|
102
|
+
|
103
|
+
gc = {}
|
104
|
+
gcBeans.each do |bean|
|
105
|
+
name = bean.getName()
|
106
|
+
gc[name] = {
|
107
|
+
total_count: bean.getCollectionCount(),
|
108
|
+
total_time: bean.getCollectionTime(),
|
109
|
+
}
|
110
|
+
end
|
111
|
+
|
112
|
+
gc
|
113
|
+
end
|
114
|
+
|
99
115
|
def camelize(sym)
|
100
116
|
sym.to_s.split(/_/).map(&:capitalize).join
|
101
117
|
end
|
@@ -556,7 +572,9 @@ module Norikra
|
|
556
572
|
administrator = @service.getEPAdministrator
|
557
573
|
|
558
574
|
statement_model = administrator.compileEPL(query.expression)
|
575
|
+
trace("rewriting query"){ { source: statement_model.toEPL, event_type_name_map: event_type_name_map } }
|
559
576
|
Norikra::Query.rewrite_query(statement_model, event_type_name_map)
|
577
|
+
trace("query rewrite result"){ { result: statement_model.toEPL } }
|
560
578
|
|
561
579
|
@running_listeners[query.name] = listener = create_listener(query)
|
562
580
|
|
data/lib/norikra/logger.rb
CHANGED
@@ -50,7 +50,7 @@ module Norikra
|
|
50
50
|
# http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html
|
51
51
|
|
52
52
|
if level.upcase == 'TEST' # with opts[:logger] as DummyLogger instance
|
53
|
-
level = LOG_LEVEL_DEFAULT
|
53
|
+
level = opts[:level] || LOG_LEVEL_DEFAULT
|
54
54
|
@@test_flag = true
|
55
55
|
end
|
56
56
|
|
data/lib/norikra/query.rb
CHANGED
@@ -303,7 +303,7 @@ module Norikra
|
|
303
303
|
traverse_fields(rewriter, recaller, statement_model)
|
304
304
|
end
|
305
305
|
|
306
|
-
def self.rewrite_event_field_name(statement_model, mapping)
|
306
|
+
def self.rewrite_event_field_name(statement_model, mapping, fqfs_prefixes=nil)
|
307
307
|
# mapping: {target_name => query_event_type_name}
|
308
308
|
# mapping is for target name rewriting of fully qualified field name access
|
309
309
|
|
@@ -318,7 +318,7 @@ module Norikra
|
|
318
318
|
|
319
319
|
query = Norikra::Query.new(name: 'dummy name by .rewrite_event_field_name', expression: statement_model.toEPL)
|
320
320
|
targets = query.targets
|
321
|
-
fqfs_prefixes
|
321
|
+
fqfs_prefixes ||= (targets + query.aliases)
|
322
322
|
|
323
323
|
default_target = (targets.size == 1 ? targets.first : nil)
|
324
324
|
|
@@ -371,7 +371,7 @@ module Norikra
|
|
371
371
|
end
|
372
372
|
}
|
373
373
|
recaller = lambda {|node|
|
374
|
-
Norikra::Query.rewrite_event_field_name(node.getModel, mapping)
|
374
|
+
Norikra::Query.rewrite_event_field_name(node.getModel, mapping, fqfs_prefixes)
|
375
375
|
}
|
376
376
|
|
377
377
|
traverse_fields(rewriter, recaller, statement_model)
|
data/lib/norikra/rpc.rb
CHANGED
data/lib/norikra/rpc/http.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'mizuno/server'
|
2
2
|
require 'rack/builder'
|
3
|
-
require 'msgpack-rpc-over-http
|
3
|
+
require 'msgpack-rpc-over-http'
|
4
4
|
|
5
5
|
require_relative 'handler'
|
6
6
|
require_relative 'gatekeeper'
|
@@ -35,7 +35,7 @@ module Norikra::RPC
|
|
35
35
|
info "RPC server #{@host}:#{@port}, #{@threads} threads"
|
36
36
|
@thread = Thread.new do
|
37
37
|
@mizuno = Mizuno::Server.new
|
38
|
-
@mizuno.run(@app, embedded: true, threads: @threads, port: @port, host: @host)
|
38
|
+
@mizuno.run(@app, embedded: true, threads: @threads, min_threads: @threads, port: @port, host: @host)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
data/lib/norikra/server.rb
CHANGED
@@ -101,6 +101,8 @@ module Norikra
|
|
101
101
|
@port = server_options[:port] || Norikra::RPC::HTTP::DEFAULT_LISTEN_PORT
|
102
102
|
@ui_port = server_options[:ui_port] || Norikra::WebUI::HTTP::DEFAULT_LISTEN_PORT
|
103
103
|
|
104
|
+
@ui_context_path = server_options[:ui_context_path] || "/"
|
105
|
+
|
104
106
|
@thread_conf = self.class.threading_configuration(conf[:thread])
|
105
107
|
@log_conf = self.class.log_configuration(conf[:log])
|
106
108
|
@log4j_properties_path = conf[:log4j_properties_path]
|
@@ -134,7 +136,8 @@ module Norikra
|
|
134
136
|
@webserver = Norikra::WebUI::HTTP.new(
|
135
137
|
engine: @engine,
|
136
138
|
host: @host, port: @ui_port,
|
137
|
-
threads: @thread_conf[:web][:threads]
|
139
|
+
threads: @thread_conf[:web][:threads],
|
140
|
+
context_path: @ui_context_path
|
138
141
|
)
|
139
142
|
end
|
140
143
|
|
data/lib/norikra/version.rb
CHANGED
data/lib/norikra/webui.rb
CHANGED
data/lib/norikra/webui/api.rb
CHANGED
@@ -186,5 +186,11 @@ class Norikra::WebUI::API < Sinatra::Base
|
|
186
186
|
}
|
187
187
|
end
|
188
188
|
|
189
|
+
get '/engine_statistics' do
|
190
|
+
logging(:show, :json_engine_statistics) do
|
191
|
+
json engine.statistics
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
189
195
|
# post('/listen') # get all events as stream, during connection keepaliving
|
190
196
|
end
|
@@ -15,6 +15,8 @@ class Norikra::WebUI::Handler < Sinatra::Base
|
|
15
15
|
set :views, File.absolute_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'views'))
|
16
16
|
set :erb, escape_html: true
|
17
17
|
|
18
|
+
helpers Norikra::WebUI::Helpers
|
19
|
+
|
18
20
|
enable :sessions
|
19
21
|
|
20
22
|
def norikra_version; Norikra::VERSION ; end
|
@@ -101,7 +103,7 @@ class Norikra::WebUI::Handler < Sinatra::Base
|
|
101
103
|
target_name = params[:target]
|
102
104
|
logging(:manage, :close, [target_name]) do
|
103
105
|
engine.close(target_name)
|
104
|
-
redirect '/'
|
106
|
+
redirect url_for('/')
|
105
107
|
end
|
106
108
|
end
|
107
109
|
|
@@ -115,7 +117,7 @@ class Norikra::WebUI::Handler < Sinatra::Base
|
|
115
117
|
error: error_message,
|
116
118
|
},
|
117
119
|
}
|
118
|
-
redirect
|
120
|
+
redirect url_for("/#query_add")
|
119
121
|
}
|
120
122
|
|
121
123
|
logging(:manage, :register, [query_name, query_group, expression], on_error_hook: error_hook) do
|
@@ -126,7 +128,7 @@ class Norikra::WebUI::Handler < Sinatra::Base
|
|
126
128
|
query_group = nil
|
127
129
|
end
|
128
130
|
engine.register(Norikra::Query.new(name: query_name, group: query_group, expression: expression))
|
129
|
-
redirect
|
131
|
+
redirect url_for("/#queries")
|
130
132
|
end
|
131
133
|
end
|
132
134
|
|
@@ -134,7 +136,7 @@ class Norikra::WebUI::Handler < Sinatra::Base
|
|
134
136
|
query_name = params[:query_name]
|
135
137
|
logging(:manage, :deregister, [query_name]) do
|
136
138
|
engine.deregister(query_name)
|
137
|
-
redirect
|
139
|
+
redirect url_for("/#queries")
|
138
140
|
end
|
139
141
|
end
|
140
142
|
|
@@ -142,7 +144,7 @@ class Norikra::WebUI::Handler < Sinatra::Base
|
|
142
144
|
query_name = params[:query_name]
|
143
145
|
logging(:manage, :suspend, [query_name]) do
|
144
146
|
engine.suspend(query_name)
|
145
|
-
redirect
|
147
|
+
redirect url_for("/#queries")
|
146
148
|
end
|
147
149
|
end
|
148
150
|
|
@@ -150,7 +152,7 @@ class Norikra::WebUI::Handler < Sinatra::Base
|
|
150
152
|
query_name = params[:query_name]
|
151
153
|
logging(:manage, :resume, [query_name]) do
|
152
154
|
engine.resume(query_name)
|
153
|
-
redirect
|
155
|
+
redirect url_for("/#queries")
|
154
156
|
end
|
155
157
|
end
|
156
158
|
|
data/lib/norikra/webui/http.rb
CHANGED
@@ -26,10 +26,12 @@ module Norikra::WebUI
|
|
26
26
|
Norikra::WebUI::Handler.engine = @engine
|
27
27
|
Norikra::WebUI::API.engine = @engine
|
28
28
|
@app = Rack::Builder.new {
|
29
|
-
map
|
30
|
-
|
29
|
+
map opts[:context_path] do
|
30
|
+
map '/api' do
|
31
|
+
run Norikra::WebUI::API
|
32
|
+
end
|
33
|
+
run Norikra::WebUI::Handler
|
31
34
|
end
|
32
|
-
run Norikra::WebUI::Handler
|
33
35
|
}
|
34
36
|
end
|
35
37
|
|
@@ -37,7 +39,7 @@ module Norikra::WebUI
|
|
37
39
|
info "WebUI server #{@host}:#{@port}, #{@threads} threads"
|
38
40
|
@thread = Thread.new do
|
39
41
|
@mizuno = Mizuno::Server.new
|
40
|
-
@mizuno.run(@app, :
|
42
|
+
@mizuno.run(@app, embedded: true, threads: @threads, min_threads: @threads, port: @port, host: @host)
|
41
43
|
end
|
42
44
|
end
|
43
45
|
|
data/norikra.gemspec
CHANGED
@@ -19,11 +19,11 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib", "esper"]
|
21
21
|
|
22
|
-
spec.add_runtime_dependency "mizuno", "
|
22
|
+
spec.add_runtime_dependency "mizuno", ">= 0.6.9"
|
23
23
|
spec.add_runtime_dependency "rack"
|
24
24
|
spec.add_runtime_dependency "thor"
|
25
|
-
spec.add_runtime_dependency "msgpack-rpc-over-http
|
26
|
-
spec.add_runtime_dependency "norikra-client
|
25
|
+
spec.add_runtime_dependency "msgpack-rpc-over-http", ">= 0.0.7"
|
26
|
+
spec.add_runtime_dependency "norikra-client", "~> 1.3.0"
|
27
27
|
spec.add_runtime_dependency "sinatra"
|
28
28
|
spec.add_runtime_dependency "sinatra-contrib"
|
29
29
|
spec.add_runtime_dependency "erubis"
|
@@ -0,0 +1,133 @@
|
|
1
|
+
require_relative './spec_helper'
|
2
|
+
|
3
|
+
require 'norikra/engine'
|
4
|
+
require 'norikra/output_pool'
|
5
|
+
require 'norikra/typedef_manager'
|
6
|
+
|
7
|
+
include Norikra::SpecHelper
|
8
|
+
|
9
|
+
describe "Query" do
|
10
|
+
describe "#rewrite_query" do
|
11
|
+
it "keep outer alias not replaced" do
|
12
|
+
expression = 'select a, (select sum(b) from mytarget.win:length(3) as alias2 where alias1.c=alias2.c) as x from mytarget as alias1'
|
13
|
+
expected = 'select a, (select sum(b) from M1.win:length(3) as alias2 where alias1.c=alias2.c) as x from M1 as alias1'
|
14
|
+
with_engine do
|
15
|
+
statement_model = administrator.compileEPL(expression)
|
16
|
+
mapping = {"mytarget"=>"M1"}
|
17
|
+
Norikra::Query.rewrite_query(statement_model, mapping)
|
18
|
+
expect(statement_model.toEPL).to eql(expected)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
describe "#rewrite_event_field_name" do
|
23
|
+
it "keep outer alias not replaced" do
|
24
|
+
expression = 'select a, (select sum(b) from mytarget.win:length(3) as alias2 where alias1.c=alias2.c) as x from mytarget as alias1'
|
25
|
+
expected = 'select a, (select sum(b) from mytarget.win:length(3) as alias2 where alias1.c=alias2.c) as x from mytarget as alias1'
|
26
|
+
with_engine do
|
27
|
+
statement_model = administrator.compileEPL(expression)
|
28
|
+
mapping = {}
|
29
|
+
Norikra::Query.rewrite_event_field_name(statement_model, mapping)
|
30
|
+
expect(statement_model.toEPL).to eql(expected)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe "Engine(running)" do
|
37
|
+
before :each do
|
38
|
+
@typedef_manager = Norikra::TypedefManager.new
|
39
|
+
@output_pool = Norikra::OutputPool.new
|
40
|
+
@engine = Norikra::Engine.new(@output_pool, @typedef_manager, {})
|
41
|
+
@engine.start
|
42
|
+
end
|
43
|
+
after :each do
|
44
|
+
@engine.stop
|
45
|
+
end
|
46
|
+
|
47
|
+
context "subquery using outer target alias" do
|
48
|
+
it 'should not raise' do
|
49
|
+
begin
|
50
|
+
target_name = "mytarget"
|
51
|
+
query_name = "q1"
|
52
|
+
query_group = "g1"
|
53
|
+
expression = "select a,(select sum(b) from mytarget.win:length(3) as alias2 where alias1.c=alias2.c) as x from mytarget as alias1"
|
54
|
+
query = Norikra::Query.new(name: query_name, group: query_group, expression: expression)
|
55
|
+
@engine.register(query)
|
56
|
+
|
57
|
+
events = [
|
58
|
+
{"a"=>1, "b"=>2, "c"=>3},
|
59
|
+
{"a"=>2, "b"=>2, "c"=>4},
|
60
|
+
{"a"=>3, "b"=>2, "c"=>3},
|
61
|
+
{"a"=>4, "b"=>2, "c"=>4},
|
62
|
+
{"a"=>5, "b"=>2, "c"=>5},
|
63
|
+
{"a"=>6, "b"=>2, "c"=>5},
|
64
|
+
{"a"=>7, "b"=>2, "c"=>5},
|
65
|
+
{"a"=>8, "b"=>2, "c"=>5}
|
66
|
+
]
|
67
|
+
events.each do |e|
|
68
|
+
@engine.send("mytarget", [e])
|
69
|
+
end
|
70
|
+
|
71
|
+
output = @engine.output_pool.pop(query_name)
|
72
|
+
|
73
|
+
expect(output).not_to be_nil
|
74
|
+
expect(output.size).to eql 8
|
75
|
+
expect(output[0][1]).to eql({"a"=>1, "x"=>2})
|
76
|
+
expect(output[1][1]).to eql({"a"=>2, "x"=>2})
|
77
|
+
expect(output[2][1]).to eql({"a"=>3, "x"=>4})
|
78
|
+
expect(output[3][1]).to eql({"a"=>4, "x"=>4})
|
79
|
+
expect(output[4][1]).to eql({"a"=>5, "x"=>2})
|
80
|
+
expect(output[5][1]).to eql({"a"=>6, "x"=>4})
|
81
|
+
expect(output[6][1]).to eql({"a"=>7, "x"=>6})
|
82
|
+
expect(output[7][1]).to eql({"a"=>8, "x"=>6})
|
83
|
+
rescue Object => e
|
84
|
+
puts $dummylogger.output
|
85
|
+
raise e
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
context "simple select" do
|
91
|
+
it 'returns all events' do
|
92
|
+
target_name = "mytarget"
|
93
|
+
query_name = "q1"
|
94
|
+
query_group = "g1"
|
95
|
+
expression = "select a,b,c from #{target_name}"
|
96
|
+
query = Norikra::Query.new(name: query_name, group: query_group, expression: expression)
|
97
|
+
@engine.register(query)
|
98
|
+
|
99
|
+
e1 = {"a"=>1, "b"=>2, "c"=>3}
|
100
|
+
e2 = {"a"=>6, "b"=>5, "c"=>4}
|
101
|
+
@engine.send(target_name, [e1]);
|
102
|
+
@engine.send(target_name, [e2]);
|
103
|
+
|
104
|
+
output = @engine.output_pool.pop(query_name)
|
105
|
+
|
106
|
+
expect(output).not_to be_nil
|
107
|
+
expect(output.size).to eql 2
|
108
|
+
expect(output[0][1]).to eql e1
|
109
|
+
expect(output[1][1]).to eql e2
|
110
|
+
end
|
111
|
+
|
112
|
+
it 'returns sum,avg' do
|
113
|
+
target_name = "mytarget"
|
114
|
+
query_name = "q1"
|
115
|
+
query_group = "g1"
|
116
|
+
expression = "select sum(a),avg(b),c from #{target_name}"
|
117
|
+
query = Norikra::Query.new(name: query_name, group: query_group, expression: expression)
|
118
|
+
@engine.register(query)
|
119
|
+
|
120
|
+
e1 = {"a"=>1, "b"=>2, "c"=>3}
|
121
|
+
e2 = {"a"=>6, "b"=>5, "c"=>4}
|
122
|
+
@engine.send(target_name, [e1]);
|
123
|
+
@engine.send(target_name, [e2]);
|
124
|
+
|
125
|
+
output = @engine.output_pool.pop(query_name)
|
126
|
+
|
127
|
+
expect(output).not_to be_nil
|
128
|
+
expect(output.size).to eql 2
|
129
|
+
expect(output[0][1]).to eql({"sum(a)"=>1,"avg(b)"=>2.0,"c"=>3})
|
130
|
+
expect(output[1][1]).to eql({"sum(a)"=>7,"avg(b)"=>3.5,"c"=>4})
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
data/spec/spec_helper.rb
CHANGED
data/views/base.erb
CHANGED
@@ -12,12 +12,12 @@
|
|
12
12
|
<!-- TODO: logo favicon <link rel="shortcut icon" href="../../assets/ico/favicon.png"> -->
|
13
13
|
|
14
14
|
<!-- Bootstrap core CSS -->
|
15
|
-
<link href="/css/bootstrap.css" rel="stylesheet">
|
15
|
+
<link href="<%= url_for("/css/bootstrap.css") %>" rel="stylesheet">
|
16
16
|
<!-- Bootstrap theme -->
|
17
|
-
<link href="/css/bootstrap-theme.min.css" rel="stylesheet">
|
17
|
+
<link href="<%= url_for("/css/bootstrap-theme.min.css") %>" rel="stylesheet">
|
18
18
|
|
19
19
|
<!-- Custom styles for this template -->
|
20
|
-
<link href="/css/norikra.css" rel="stylesheet">
|
20
|
+
<link href="<%= url_for("/css/norikra.css") %>" rel="stylesheet">
|
21
21
|
|
22
22
|
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
23
23
|
<!--[if lt IE 9]>
|
@@ -60,9 +60,8 @@
|
|
60
60
|
<!-- Placed at the end of the document so the pages load faster -->
|
61
61
|
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
62
62
|
<!-- <script src="//code.jquery.com/jquery.js"></script> -->
|
63
|
-
<script src="/js/jquery.min.js"></script>
|
64
|
-
<script src="/js/bootstrap.min.js"></script>
|
65
|
-
<script src="/js/norikra.webui.js"></script>
|
63
|
+
<script src="<%= url_for("/js/jquery.min.js") %>"></script>
|
64
|
+
<script src="<%= url_for("/js/bootstrap.min.js") %>"></script>
|
65
|
+
<script src="<%= url_for("/js/norikra.webui.js") %>"></script>
|
66
66
|
</body>
|
67
67
|
</html>
|
68
|
-
|
data/views/index.erb
CHANGED
@@ -75,12 +75,12 @@
|
|
75
75
|
<td><%= query.targets.join(", ") %></td>
|
76
76
|
<td><%= query.suspended? ? "suspended" : "" %></td>
|
77
77
|
<td>
|
78
|
-
<button class="btn btn-default btn-xs show-query-expression" data-load="/json/query
|
78
|
+
<button class="btn btn-default btn-xs show-query-expression" data-load="<%= url_for("/json/query/#{query.name}") %>">show query</button>
|
79
79
|
</td>
|
80
80
|
<td style="text-align: right;"><%= pool[query.name] %></td>
|
81
81
|
<td>
|
82
82
|
<% if pool[query.name].to_i > 0 %>
|
83
|
-
<button class="btn btn-info btn-xs show-query-events-sample" data-load="/json/events_sample
|
83
|
+
<button class="btn btn-info btn-xs show-query-events-sample" data-load="<%= url_for("/json/events_sample/#{query.name}") %>">
|
84
84
|
<span class="glyphicon glyphicon-search"></span>
|
85
85
|
</button>
|
86
86
|
<% end %>
|
@@ -104,7 +104,7 @@
|
|
104
104
|
<pre><%= query.expression %></pre>
|
105
105
|
</div>
|
106
106
|
<div class="modal-footer">
|
107
|
-
<form class="form-inline" action="/resume" method="POST">
|
107
|
+
<form class="form-inline" action="<%= url_for("/resume") %>" method="POST">
|
108
108
|
<input type="hidden" name="query_name" value="<%= query.name %>" />
|
109
109
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
110
110
|
<button type="submit" class="btn btn-primary">Resume</button>
|
@@ -131,7 +131,7 @@
|
|
131
131
|
<pre><%= query.expression %></pre>
|
132
132
|
</div>
|
133
133
|
<div class="modal-footer">
|
134
|
-
<form class="form-inline" action="/suspend" method="POST">
|
134
|
+
<form class="form-inline" action="<%= url_for("/suspend") %>" method="POST">
|
135
135
|
<input type="hidden" name="query_name" value="<%= query.name %>" />
|
136
136
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
137
137
|
<button type="submit" class="btn btn-danger">Suspend</button>
|
@@ -160,7 +160,7 @@
|
|
160
160
|
<pre><%= query.expression %></pre>
|
161
161
|
</div>
|
162
162
|
<div class="modal-footer">
|
163
|
-
<form class="form-inline" action="/deregister" method="POST">
|
163
|
+
<form class="form-inline" action="<%= url_for("/deregister") %>" method="POST">
|
164
164
|
<input type="hidden" name="query_name" value="<%= query.name %>" />
|
165
165
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
166
166
|
<button type="submit" class="btn btn-danger">Remove</button>
|
@@ -183,7 +183,7 @@
|
|
183
183
|
<% if input_data[:query_add][:error] %>
|
184
184
|
<div class="alert alert-danger"><%= input_data[:query_add][:error] %></div>
|
185
185
|
<% end %>
|
186
|
-
<form action="/register"
|
186
|
+
<form action="<%= url_for("/register") %>" method="POST">
|
187
187
|
<div class="row">
|
188
188
|
<div class="col-sm-8 form-group">
|
189
189
|
<label for="addQueryExpression">Query</label>
|
@@ -218,7 +218,7 @@
|
|
218
218
|
<td><%= target[:auto_field] %></td>
|
219
219
|
<td>
|
220
220
|
<% if target[:fields].size > 0 %>
|
221
|
-
<button class="btn btn-default btn-xs show-target-fields" data-load="/json/target
|
221
|
+
<button class="btn btn-default btn-xs show-target-fields" data-load="<%= url_for("/json/target/#{target[:name]}") %>">show fields</button>
|
222
222
|
<% else %>
|
223
223
|
(lazy target)
|
224
224
|
<% end %>
|
@@ -242,7 +242,7 @@
|
|
242
242
|
<p>name: <%= target[:name] %></p>
|
243
243
|
</div>
|
244
244
|
<div class="modal-footer">
|
245
|
-
<form class="form-inline" action="/close" method="POST">
|
245
|
+
<form class="form-inline" action="<%= url_for("/close") %>" method="POST">
|
246
246
|
<input type="hidden" name="target" value="<%= target[:name] %>" />
|
247
247
|
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
248
248
|
<button type="submit" class="btn btn-danger">Remove</button>
|
@@ -263,13 +263,13 @@
|
|
263
263
|
<h1 id="stats">Target/Query stat dump</h1>
|
264
264
|
</div>
|
265
265
|
|
266
|
-
<a href="/stat/dump" class="btn btn-info btn-lg" role="button">Download JSON</a>
|
266
|
+
<a href="<%= url_for("/stat/dump") %>" class="btn btn-info btn-lg" role="button">Download JSON</a>
|
267
267
|
|
268
268
|
<div class="page-header">
|
269
269
|
<h1 id="logs">Server logs</h1>
|
270
270
|
</div>
|
271
271
|
|
272
|
-
<button id="show_server_logs" class="btn btn-info btn-lg" data-url="/logs">Show server logs</button>
|
272
|
+
<button id="show_server_logs" class="btn btn-info btn-lg" data-url="<%= url_for("/logs") %>">Show server logs</button>
|
273
273
|
|
274
274
|
<div id="logsection" style="display: none;">
|
275
275
|
<table id="logtable" class="table logs">
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: norikra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.0
|
4
|
+
version: 1.3.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- TAGOMORI Satoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
|
-
- -
|
16
|
+
- - '>='
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version:
|
18
|
+
version: 0.6.9
|
19
19
|
name: mizuno
|
20
20
|
prerelease: false
|
21
21
|
type: :runtime
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.6.9
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
@@ -57,29 +57,29 @@ dependencies:
|
|
57
57
|
requirements:
|
58
58
|
- - '>='
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.0.
|
61
|
-
name: msgpack-rpc-over-http
|
60
|
+
version: 0.0.7
|
61
|
+
name: msgpack-rpc-over-http
|
62
62
|
prerelease: false
|
63
63
|
type: :runtime
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.0.
|
68
|
+
version: 0.0.7
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- -
|
72
|
+
- - ~>
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 1.
|
75
|
-
name: norikra-client
|
74
|
+
version: 1.3.0
|
75
|
+
name: norikra-client
|
76
76
|
prerelease: false
|
77
77
|
type: :runtime
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.
|
82
|
+
version: 1.3.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
requirement: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
@@ -240,6 +240,7 @@ files:
|
|
240
240
|
- lib/norikra/webui.rb
|
241
241
|
- lib/norikra/webui/api.rb
|
242
242
|
- lib/norikra/webui/handler.rb
|
243
|
+
- lib/norikra/webui/helpers.rb
|
243
244
|
- lib/norikra/webui/http.rb
|
244
245
|
- norikra.gemspec
|
245
246
|
- public/css/bootstrap-theme.css
|
@@ -261,6 +262,7 @@ files:
|
|
261
262
|
- spec/engine_spec.rb
|
262
263
|
- spec/field_spec.rb
|
263
264
|
- spec/fieldset_spec.rb
|
265
|
+
- spec/issue64_spec.rb
|
264
266
|
- spec/listener_spec.rb
|
265
267
|
- spec/output_pool_spec.rb
|
266
268
|
- spec/query_spec.rb
|
@@ -288,12 +290,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
288
290
|
version: '0'
|
289
291
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
290
292
|
requirements:
|
291
|
-
- - '
|
293
|
+
- - '>='
|
292
294
|
- !ruby/object:Gem::Version
|
293
|
-
version:
|
295
|
+
version: '0'
|
294
296
|
requirements: []
|
295
297
|
rubyforge_project:
|
296
|
-
rubygems_version: 2.
|
298
|
+
rubygems_version: 2.4.5
|
297
299
|
signing_key:
|
298
300
|
specification_version: 4
|
299
301
|
summary: Schema-less stream processing server with SQL
|
@@ -301,6 +303,7 @@ test_files:
|
|
301
303
|
- spec/engine_spec.rb
|
302
304
|
- spec/field_spec.rb
|
303
305
|
- spec/fieldset_spec.rb
|
306
|
+
- spec/issue64_spec.rb
|
304
307
|
- spec/listener_spec.rb
|
305
308
|
- spec/output_pool_spec.rb
|
306
309
|
- spec/query_spec.rb
|
@@ -310,3 +313,4 @@ test_files:
|
|
310
313
|
- spec/target_spec.rb
|
311
314
|
- spec/typedef_manager_spec.rb
|
312
315
|
- spec/typedef_spec.rb
|
316
|
+
has_rdoc:
|