rearview 1.0.3.rc.3-jruby → 1.0.3.rc.4-jruby
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/rearview/job.rb +0 -2
- data/app/models/rearview/job_error.rb +0 -2
- data/lib/rearview/alerts_handler.rb +0 -5
- data/lib/rearview/log_formatter.rb +40 -0
- data/lib/rearview/monitor_runner.rb +0 -4
- data/lib/rearview/monitor_supervisor.rb +0 -3
- data/lib/rearview/monitor_task.rb +6 -9
- data/lib/rearview/results_handler.rb +0 -3
- data/lib/rearview/stats_task.rb +4 -4
- data/lib/rearview/version.rb +1 -1
- data/lib/rearview.rb +13 -14
- data/spec/dummy/log/development.log +18 -0
- data/spec/dummy/log/test.log +2755 -0
- data/spec/lib/rearview/ext/numeric_spec.rb +16 -0
- data/spec/lib/rearview/log_formatter_spec.rb +13 -0
- metadata +7 -2
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Rearview::Ext::Numeric' do
|
4
|
+
context '#bytes_to_kilobytes' do
|
5
|
+
it "should convert bytes to kilobytes" do
|
6
|
+
expect(1024.bytes_to_kilobytes).to eq(1)
|
7
|
+
expect(10485760.bytes_to_kilobytes).to eq(10240)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
context '#bytes_to_megabytes' do
|
11
|
+
it "should convert bytes to megabytes" do
|
12
|
+
expect(1048576.bytes_to_megabytes).to eq(1)
|
13
|
+
expect(10485760.bytes_to_megabytes).to eq(10)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Rearview::LogFormatter do
|
4
|
+
let(:formatter) { Rearview::LogFormatter.new }
|
5
|
+
context '#call' do
|
6
|
+
it "includes the thread name" do
|
7
|
+
expect(formatter.call("DEBUG",Time.now.utc,"Rearview","yo")).to match(/#\d+\/main]/)
|
8
|
+
end
|
9
|
+
it "includes Rearview as the progname if none is provided" do
|
10
|
+
expect(formatter.call("DEBUG",Time.now.utc,nil,"yo")).to match(/Rearview: yo$/)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
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.0.3.rc.
|
4
|
+
version: 1.0.3.rc.4
|
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-01-
|
11
|
+
date: 2014-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -329,6 +329,7 @@ files:
|
|
329
329
|
- lib/rearview/distribute.rb
|
330
330
|
- lib/rearview/engine.rb
|
331
331
|
- lib/rearview/graphite_parser.rb
|
332
|
+
- lib/rearview/log_formatter.rb
|
332
333
|
- lib/rearview/logger.rb
|
333
334
|
- lib/rearview/monitor_runner.rb
|
334
335
|
- lib/rearview/monitor_service.rb
|
@@ -2225,6 +2226,7 @@ files:
|
|
2225
2226
|
- spec/lib/rearview/configuration_spec.rb
|
2226
2227
|
- spec/lib/rearview/cron_helper_spec.rb
|
2227
2228
|
- spec/lib/rearview/graphite_parser_spec.rb
|
2229
|
+
- spec/lib/rearview/log_formatter_spec.rb
|
2228
2230
|
- spec/lib/rearview/monitor_runner_spec.rb
|
2229
2231
|
- spec/lib/rearview/monitor_service_spec.rb
|
2230
2232
|
- spec/lib/rearview/monitor_supervisor_spec.rb
|
@@ -2239,6 +2241,7 @@ files:
|
|
2239
2241
|
- spec/lib/rearview/alerts/campfire_alert_spec.rb
|
2240
2242
|
- spec/lib/rearview/alerts/email_alert_spec.rb
|
2241
2243
|
- spec/lib/rearview/alerts/pagerduty_alert_spec.rb
|
2244
|
+
- spec/lib/rearview/ext/numeric_spec.rb
|
2242
2245
|
- spec/lib/rearview/templates/utilities_spec.rb
|
2243
2246
|
- spec/mailers/alert_mailer_spec.rb
|
2244
2247
|
- spec/models/dashboard_spec.rb
|
@@ -2347,6 +2350,7 @@ test_files:
|
|
2347
2350
|
- spec/lib/rearview/configuration_spec.rb
|
2348
2351
|
- spec/lib/rearview/cron_helper_spec.rb
|
2349
2352
|
- spec/lib/rearview/graphite_parser_spec.rb
|
2353
|
+
- spec/lib/rearview/log_formatter_spec.rb
|
2350
2354
|
- spec/lib/rearview/monitor_runner_spec.rb
|
2351
2355
|
- spec/lib/rearview/monitor_service_spec.rb
|
2352
2356
|
- spec/lib/rearview/monitor_supervisor_spec.rb
|
@@ -2361,6 +2365,7 @@ test_files:
|
|
2361
2365
|
- spec/lib/rearview/alerts/campfire_alert_spec.rb
|
2362
2366
|
- spec/lib/rearview/alerts/email_alert_spec.rb
|
2363
2367
|
- spec/lib/rearview/alerts/pagerduty_alert_spec.rb
|
2368
|
+
- spec/lib/rearview/ext/numeric_spec.rb
|
2364
2369
|
- spec/lib/rearview/templates/utilities_spec.rb
|
2365
2370
|
- spec/mailers/alert_mailer_spec.rb
|
2366
2371
|
- spec/models/dashboard_spec.rb
|