scout_realtime 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/Vagrantfile +1 -1
- data/bin/scout_realtime +3 -2
- data/lib/scout_realtime/main.rb +4 -3
- data/lib/scout_realtime/version.rb +1 -1
- data/lib/scout_realtime/web/javascripts/application.js +9 -5
- data/lib/scout_realtime/web/stylesheets/styles.css +5 -11
- data/lib/scout_realtime/web/views/header.erb +4 -1
- data/lib/scout_realtime/web/views/layout.erb +1 -1
- data/lib/scout_realtime/web_app.rb +1 -1
- data/scout_realtime.gemspec +1 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## 1.0.4
|
2
|
+
|
3
|
+
* Added hostname to title
|
4
|
+
* Single play/pause button
|
5
|
+
* Added --bind option to bind to a specific IP Address on the host
|
6
|
+
* Updating server_metrics dependency to 1.2.4
|
7
|
+
|
1
8
|
## 1.0.3
|
2
9
|
|
3
10
|
* switch to relatives paths in templates, so it will work in an nginx subfolder.
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ Scout realtime is a better `top` command: it gives you disk, memory, network, CP
|
|
26
26
|
|
27
27
|
* **Something isn't working. Where's the log?** By default, the log is written to `~/scout_realtime.log`
|
28
28
|
* **Does my server need to have a public IP or domain name?** Yes, you need a public IP or domain name to view Scout Realtime in your browser.
|
29
|
-
* **Installing the gem didn't work.** You need Ruby 1.
|
29
|
+
* **Installing the gem didn't work.** You need Ruby 1.9.3+ on your server to run Scout Realtime. Try `which ruby` (to confirm you have Ruby), `ruby -v` (to show Ruby's version), and `which gem` to confirm you have Ruby gems (Ruby's package manager) available.
|
30
30
|
* **Can multiple people view the realtime stats?** Yes. You'll probably want to open a port in your firewall instead of relying on the SSH tunnel for access: `sudo iptables -A INPUT -p tcp --dport 5555 -j ACCEPT`
|
31
31
|
* **The SSH tunnel is a pain. Is there a way to set up persistent access?** Yes -- open a port in your firewall using the iptables command above.
|
32
32
|
* **Is that safe?** It's as safe or safer than any any other service you have listening for HTTP traffic. The realtime web server only serves two endpoints, and there's nothing available at either of those endpoints that can be used in an attack.
|
data/Vagrantfile
CHANGED
data/bin/scout_realtime
CHANGED
@@ -56,6 +56,7 @@ Advanced options:
|
|
56
56
|
EOS
|
57
57
|
|
58
58
|
opt :port, "point your web browser to this port to view realtime metrics.", :default => 5555, :short => "-p"
|
59
|
+
opt :bind, "bind to this IP address on the host", :default => '0.0.0.0', :short => '-b'
|
59
60
|
opt :foreground, "run in the foreground, i.e., don't daemonize the process. Useful for debugging.", :default => false, :short => "-f"
|
60
61
|
opt :log_path, "full path for a log file", :default=>log_path
|
61
62
|
opt :pid_path, "full path for a PID file", :default=>pid_path
|
@@ -81,7 +82,7 @@ EOS
|
|
81
82
|
# TODO: should be able to pass :daemonize => !opts[:foreground] to Dante::Runner instead
|
82
83
|
if opts[:foreground]
|
83
84
|
puts " ** Initializing. cntl-c to stop. Logging to STDOUT **"
|
84
|
-
Scout::Realtime::Main.instance(:port=>opts[:port]).go_sinatra
|
85
|
+
Scout::Realtime::Main.instance(:port=>opts[:port],:bind=>opts[:bind]).go_sinatra
|
85
86
|
puts startup_message
|
86
87
|
else
|
87
88
|
if command == :start
|
@@ -91,7 +92,7 @@ else
|
|
91
92
|
end
|
92
93
|
|
93
94
|
Dante::Runner.new('scout_realtime').execute(:daemonize => !opts[:foreground], :pid_path => pid_path, :log_path => log_path, :port=>opts[:port]) do |options|
|
94
|
-
Scout::Realtime::Main.instance(:port=>options[:port]).go_sinatra
|
95
|
+
Scout::Realtime::Main.instance(:port=>options[:port],:bind=>opts[:bind]).go_sinatra
|
95
96
|
end
|
96
97
|
puts startup_message
|
97
98
|
puts '* "scout_realtime stop" to stop the daemon'
|
data/lib/scout_realtime/main.rb
CHANGED
@@ -7,9 +7,10 @@ module Scout
|
|
7
7
|
|
8
8
|
attr_accessor :running, :runner, :stats_thread
|
9
9
|
|
10
|
-
# opts: {:port=>xxx}
|
10
|
+
# opts: {:port=>xxx, bind=>'0.0.0.0'}
|
11
11
|
def initialize(opts={})
|
12
12
|
@port=opts[:port]
|
13
|
+
@bind_address=opts[:bind] || '0.0.0.0'
|
13
14
|
Scout::Realtime::logger=Logger.new(STDOUT)
|
14
15
|
@stats_thread = Thread.new {}
|
15
16
|
@runner = Scout::Realtime::Runner.new
|
@@ -50,12 +51,12 @@ module Scout
|
|
50
51
|
#end
|
51
52
|
|
52
53
|
start_thread
|
53
|
-
Scout::Realtime::WebApp.run!(:port=>@port)
|
54
|
+
Scout::Realtime::WebApp.run!(:port=>@port,:bind=>@bind_address)
|
54
55
|
end
|
55
56
|
|
56
57
|
def go_webrick
|
57
58
|
logger.info("starting web server ")
|
58
|
-
server = WEBrick::HTTPServer.new(:Port =>
|
59
|
+
server = WEBrick::HTTPServer.new(:Port => @port, :AccessLog => [], :BindAddress => @bind_address)
|
59
60
|
server.mount '/', Scout::Realtime::WebServer
|
60
61
|
trap 'INT' do
|
61
62
|
server.shutdown
|
@@ -6,15 +6,19 @@ function d(s){console.debug(s)}
|
|
6
6
|
|
7
7
|
window.refresher = null;
|
8
8
|
function toggleData() {
|
9
|
-
|
9
|
+
// Pause button is displayed on page load when streaming.
|
10
|
+
// Play button is shown when streaming is paused.
|
11
|
+
if (window.refresher) {
|
12
|
+
// streaming => pause
|
10
13
|
clearInterval(window.refresher);
|
11
14
|
window.refresher = null;
|
12
|
-
$("#toggle #
|
13
|
-
$("#toggle #
|
15
|
+
$("#toggle #play").show()//addClass("disabled");
|
16
|
+
$("#toggle #pause").hide()//removeClass("disabled");
|
14
17
|
} else {
|
18
|
+
// pause => streaming
|
15
19
|
window.refresher = setInterval(refresh, refreshInterval);
|
16
|
-
$("#toggle #
|
17
|
-
$("#toggle #
|
20
|
+
$("#toggle #play").hide()//;removeClass("disabled");
|
21
|
+
$("#toggle #pause").show()//;addClass("disabled");
|
18
22
|
}
|
19
23
|
}
|
20
24
|
|
@@ -78,7 +78,7 @@ svg .line {
|
|
78
78
|
|
79
79
|
#toggle #report-time {
|
80
80
|
position: absolute;
|
81
|
-
right:
|
81
|
+
right: 75px;
|
82
82
|
top: 14px;
|
83
83
|
width: 80px;
|
84
84
|
text-align: right;
|
@@ -90,6 +90,9 @@ svg .line {
|
|
90
90
|
display: inline-block;
|
91
91
|
margin: 0;
|
92
92
|
transition: 0.1s background-color;
|
93
|
+
border: 1px solid #E1E1E1;
|
94
|
+
border-width: 0 1px;
|
95
|
+
margin-left: 10px;
|
93
96
|
}
|
94
97
|
|
95
98
|
#toggle .button:hover {
|
@@ -97,21 +100,12 @@ svg .line {
|
|
97
100
|
background-color: #FCF8F6;
|
98
101
|
}
|
99
102
|
|
100
|
-
|
101
|
-
border: 1px solid #E1E1E1;
|
102
|
-
border-width: 0 1px;
|
103
|
-
margin-left: 10px;
|
104
|
-
}
|
105
|
-
|
103
|
+
/* play and pause */
|
106
104
|
#toggle img {
|
107
105
|
padding-top: 15px;
|
108
106
|
vertical-align: middle;
|
109
107
|
}
|
110
108
|
|
111
|
-
#toggle .disabled img {
|
112
|
-
opacity: 0.3;
|
113
|
-
}
|
114
|
-
|
115
109
|
/* sidebar */
|
116
110
|
|
117
111
|
#sidebar_top, #sidebar_bottom {
|
@@ -2,7 +2,10 @@
|
|
2
2
|
<img src="images/logo.png" alt="Scout Realtime"/>
|
3
3
|
<div id="toggle">
|
4
4
|
<span id='report-time'></span>
|
5
|
-
<span
|
5
|
+
<span class="button">
|
6
|
+
<img id='pause' src="images/pause.png" width=12 height=14 />
|
7
|
+
<img id='play' src="images/play.png" width=14 height=14 >
|
8
|
+
</span>
|
6
9
|
</div>
|
7
10
|
<div>
|
8
11
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<html lang="en">
|
3
3
|
<head>
|
4
4
|
<meta charset="utf-8">
|
5
|
-
<title
|
5
|
+
<title><%= ServerMetrics::SystemInfo.hostname %> · Scout Realtime</title>
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7
7
|
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
8
8
|
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
@@ -11,7 +11,7 @@ class Scout::Realtime::WebApp < Sinatra::Base
|
|
11
11
|
set :static, true # set up static file routing
|
12
12
|
set :public_dir, File.expand_path('../web', __FILE__) # set up the static dir (with images/js/css inside)
|
13
13
|
set :views, File.expand_path('../web/views', __FILE__) # set up the views dir
|
14
|
-
set :bind, "0.0.0.0" #
|
14
|
+
set :bind, self.bind || "0.0.0.0" # 0.0.0.0 is the default and is required for Vagrant
|
15
15
|
#set :traps, false # setting this to false means 1) sinatra won't capture any interrupts or term signals; 2) we need to call Scout::Realtime::WebApp.quit! ourselves in our own signal trap
|
16
16
|
|
17
17
|
#helpers Sinatra::ContentFor
|
data/scout_realtime.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scout_realtime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-
|
14
|
+
date: 2014-04-28 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -116,7 +116,7 @@ dependencies:
|
|
116
116
|
requirements:
|
117
117
|
- - ~>
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: 1.2.
|
119
|
+
version: 1.2.4
|
120
120
|
type: :runtime
|
121
121
|
prerelease: false
|
122
122
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -124,7 +124,7 @@ dependencies:
|
|
124
124
|
requirements:
|
125
125
|
- - ~>
|
126
126
|
- !ruby/object:Gem::Version
|
127
|
-
version: 1.2.
|
127
|
+
version: 1.2.4
|
128
128
|
description: Realtime server metrics in your browser.
|
129
129
|
email:
|
130
130
|
- support@scoutapp.com
|