Skip to content

Commit

Permalink
Added configurable page refresh rate.
Browse files Browse the repository at this point in the history
  • Loading branch information
tanelj committed Dec 8, 2011
1 parent 2fd8ea2 commit 5a5920d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and additional options:
* The title to show at the top of your Graphite
* A prefix to prepend to all URLs in the dashboard
* How many columns of graphs to create, 2 by default.
* How often dashboard page is refreshed, 60 sec by default.
* The width of the graphs, 500 by default
* The height of the graphs, 250 by default
* Where your whisper files are stored - future use
Expand Down
1 change: 1 addition & 0 deletions config/gdash.yaml-sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
:options:
:title: My Dashboard
:prefix: ""
:refresh_rate: 60
:graph_columns: 2
:graph_width: 500
:graph_height: 250
Expand Down
3 changes: 3 additions & 0 deletions lib/gdash/sinatra_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ def initialize(graphite_base, graph_templates, options = {})
# the dash site might have a prefix for its css etc
@prefix = options.delete(:prefix) || ""

# the page refresh rate
@refresh_rate = options.delete(:refresh_rate) || 60

# how many columns of graphs do you want on a page
@graph_columns = options.delete(:graph_columns) || 2

Expand Down
2 changes: 1 addition & 1 deletion views/layout.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<script src="<%= @prefix %>/js/bootstrap-dropdown.js"></script>
<script src="<%= @prefix %>/js/bootstrap-popover.js"></script>
<title><%= @dash_title %></title>
<meta http-equiv="refresh" content="60">
<meta http-equiv="refresh" content="<%= @refresh_rate %>">
</head>
<body style="padding-top: 80px;">
<div class="topbar-wrapper" style="z-index: 5;">
Expand Down

0 comments on commit 5a5920d

Please sign in to comment.