rearview 1.2.0-jruby → 1.2.1-jruby
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/rearview/jobs_controller.rb +1 -0
- data/app/controllers/rearview/monitor_controller.rb +6 -2
- data/lib/generators/templates/README.md +3 -2
- data/lib/generators/templates/rearview.rb +1 -1
- data/lib/graphite/client.rb +2 -2
- data/lib/rearview/version.rb +1 -1
- data/public/rearview-src/help/cron.html +34 -0
- data/public/rearview-src/js/app.js +2 -1
- data/public/rearview-src/js/main.js +2 -2
- data/public/rearview-src/js/util/cron.js +50 -0
- data/public/rearview-src/js/view/addmonitor.js +111 -19
- data/public/rearview-src/js/view/expandedmonitor.js +112 -34
- data/public/rearview-src/less/rearview.less +64 -2
- data/public/rearview-src/templates/expandedmonitor.hbs +71 -43
- data/public/rearview-src/templates/schedulemonitor.hbs +36 -7
- data/public/rearview/build.txt +2 -1
- data/public/rearview/help/cron.html +34 -0
- data/public/rearview/js/app.js +1 -1
- data/public/rearview/js/main.js +23 -23
- data/public/rearview/js/util/cron.js +1 -0
- data/public/rearview/js/view/addmonitor.js +1 -1
- data/public/rearview/js/view/expandedmonitor.js +1 -1
- data/public/rearview/less/rearview.less +64 -2
- data/public/rearview/templates/expandedmonitor.hbs +71 -43
- data/public/rearview/templates/schedulemonitor.hbs +36 -7
- data/spec/controllers/dashboard_children_controller_spec.rb +4 -4
- data/spec/controllers/dashboards_controller_spec.rb +7 -7
- data/spec/controllers/jobs_controller_spec.rb +20 -11
- data/spec/controllers/monitor_controller_spec.rb +21 -4
- data/spec/controllers/user_controller_spec.rb +2 -2
- data/spec/dummy/log/development.log +90 -0
- data/spec/dummy/log/test.log +16754 -0
- data/spec/lib/graphite/client_spec.rb +9 -1
- data/spec/views/metric/create.json.jbuilder_spec.rb +31 -0
- metadata +8 -2
@@ -61,10 +61,14 @@ describe Graphite::Client do
|
|
61
61
|
@client.stubs(:connection).returns(@connection_stub)
|
62
62
|
end
|
63
63
|
context 'true' do
|
64
|
-
it 'when response is 200, content-type is application/json, and json is a non-empty array' do
|
64
|
+
it 'when response is 200, content-type is "application/json", and json is a non-empty array' do
|
65
65
|
@request_stubs.get('/metrics/find?query=stats.my_count') {[ 200, { 'content-type' => 'application/json' }, '[ {"leaf": 1, "context": {}, "text": "my_count", "expandable": 0, "id": "stats.my_count", "allowChildren": 0} ]' ]}
|
66
66
|
expect(@client.metric_exists?('stats.my_count')).to be_true
|
67
67
|
end
|
68
|
+
it 'when response is 200, content-type is "application/json; charset=utf-8", and json is a non-empty array' do
|
69
|
+
@request_stubs.get('/metrics/find?query=stats.my_count') {[ 200, { 'content-type' => 'application/json; charset=utf-8' }, '[ {"leaf": 1, "context": {}, "text": "my_count", "expandable": 0, "id": "stats.my_count", "allowChildren": 0} ]' ]}
|
70
|
+
expect(@client.metric_exists?('stats.my_count')).to be_true
|
71
|
+
end
|
68
72
|
end
|
69
73
|
context 'false' do
|
70
74
|
it 'when response is not 200' do
|
@@ -94,6 +98,10 @@ describe Graphite::Client do
|
|
94
98
|
@request_stubs.get('/render') {[ 200, { 'content-type' => 'image/png', 'content-length' => '123' }, '' ]}
|
95
99
|
expect(@client.reachable?).to be_true
|
96
100
|
end
|
101
|
+
it 'is true when response is 200, content is "image/png; charset=bogus", and content-length > 0' do
|
102
|
+
@request_stubs.get('/render') {[ 200, { 'content-type' => 'image/png; charset=bogus', 'content-length' => '123' }, '' ]}
|
103
|
+
expect(@client.reachable?).to be_true
|
104
|
+
end
|
97
105
|
it 'is false when response is not 200' do
|
98
106
|
@request_stubs.get('/render') {[ 500, { }, '' ]}
|
99
107
|
expect(@client.reachable?).to be_false
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "rearview/monitor/create" do
|
4
|
+
let(:monitor_output) {
|
5
|
+
{:status=>"success",
|
6
|
+
:output=>"",
|
7
|
+
:graph_data=>
|
8
|
+
{"deploys.deals"=>
|
9
|
+
[[1393956250, 0.0],
|
10
|
+
[1393956260, 0.0],
|
11
|
+
[1393956270, 0.0],
|
12
|
+
[1393956280, 0.0],
|
13
|
+
[1393956290, 0.0],
|
14
|
+
[1393956300, 0.0]]}}
|
15
|
+
}
|
16
|
+
let(:monitor_keys) {
|
17
|
+
["status",
|
18
|
+
"output",
|
19
|
+
"errors",
|
20
|
+
"graph_data"]
|
21
|
+
}
|
22
|
+
it "renders monitor json" do
|
23
|
+
assign(:monitor_output,monitor_output)
|
24
|
+
render :template => "rearview/monitor/create", :formats => :json, :handler => :jbuilder
|
25
|
+
json = JSON.parse(rendered)
|
26
|
+
expect(json).to be_a_kind_of(Hash)
|
27
|
+
monitor_keys.each { |k| expect(json).to include(k) }
|
28
|
+
expect(json.keys.size).to eq(monitor_keys.size)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rearview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: jruby
|
6
6
|
authors:
|
7
7
|
- Trent Albright
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -423,6 +423,7 @@ files:
|
|
423
423
|
- public/rearview/fonts/ProximaNovaSoft-Regular/ProximaNovaSoft-Regular-webfont.woff
|
424
424
|
- public/rearview/fonts/ProximaNovaSoft-Regular/ProximaNovaSoft-Regular.otf
|
425
425
|
- public/rearview/help/alert.html
|
426
|
+
- public/rearview/help/cron.html
|
426
427
|
- public/rearview/help/quick.html
|
427
428
|
- public/rearview/img/livingsocial-logo-white.svg
|
428
429
|
- public/rearview/img/noise-light.png
|
@@ -442,6 +443,7 @@ files:
|
|
442
443
|
- public/rearview/js/model/monitor.js
|
443
444
|
- public/rearview/js/model/user.js
|
444
445
|
- public/rearview/js/route/index.js
|
446
|
+
- public/rearview/js/util/cron.js
|
445
447
|
- public/rearview/js/util/highcharts-gray-theme.js
|
446
448
|
- public/rearview/js/util/templar.js
|
447
449
|
- public/rearview/js/view/addcategory.js
|
@@ -1329,6 +1331,7 @@ files:
|
|
1329
1331
|
- public/rearview-src/fonts/ProximaNovaSoft-Regular/ProximaNovaSoft-Regular-webfont.woff
|
1330
1332
|
- public/rearview-src/fonts/ProximaNovaSoft-Regular/ProximaNovaSoft-Regular.otf
|
1331
1333
|
- public/rearview-src/help/alert.html
|
1334
|
+
- public/rearview-src/help/cron.html
|
1332
1335
|
- public/rearview-src/help/quick.html
|
1333
1336
|
- public/rearview-src/img/livingsocial-logo-white.svg
|
1334
1337
|
- public/rearview-src/img/noise-light.png
|
@@ -1348,6 +1351,7 @@ files:
|
|
1348
1351
|
- public/rearview-src/js/model/monitor.js
|
1349
1352
|
- public/rearview-src/js/model/user.js
|
1350
1353
|
- public/rearview-src/js/route/index.js
|
1354
|
+
- public/rearview-src/js/util/cron.js
|
1351
1355
|
- public/rearview-src/js/util/highcharts-gray-theme.js
|
1352
1356
|
- public/rearview-src/js/util/templar.js
|
1353
1357
|
- public/rearview-src/js/view/addcategory.js
|
@@ -2331,6 +2335,7 @@ files:
|
|
2331
2335
|
- spec/views/jobs/errors.json.jbuilder_spec.rb
|
2332
2336
|
- spec/views/jobs/index.json.jbuilder_spec.rb
|
2333
2337
|
- spec/views/jobs/show.json.jbuilder_spec.rb
|
2338
|
+
- spec/views/metric/create.json.jbuilder_spec.rb
|
2334
2339
|
- spec/views/user/show.json.jbuilder_spec.rb
|
2335
2340
|
- tasks/ci.rake
|
2336
2341
|
- tasks/rearview.rake
|
@@ -2468,4 +2473,5 @@ test_files:
|
|
2468
2473
|
- spec/views/jobs/errors.json.jbuilder_spec.rb
|
2469
2474
|
- spec/views/jobs/index.json.jbuilder_spec.rb
|
2470
2475
|
- spec/views/jobs/show.json.jbuilder_spec.rb
|
2476
|
+
- spec/views/metric/create.json.jbuilder_spec.rb
|
2471
2477
|
- spec/views/user/show.json.jbuilder_spec.rb
|