summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Wall <richard@aziz>2010-06-23 23:32:02 +0100
committerRichard Wall <richard@aziz>2010-06-23 23:32:02 +0100
commit46177f0393a25e0a14f9b4f77e8b5692243329ca (patch)
treea7426dc19f78bd5eb7b2888e7c481d35a3eb4838
parent2bf746736bce59f2b81c4a13757bc0f5e0e43d98 (diff)
Move recipes to a separate file
-rw-r--r--docs/jarmon_example_recipes.js88
-rw-r--r--index.html1
-rw-r--r--jarmon.js79
3 files changed, 89 insertions, 79 deletions
diff --git a/docs/jarmon_example_recipes.js b/docs/jarmon_example_recipes.js
new file mode 100644
index 0000000..73dd3d5
--- /dev/null
+++ b/docs/jarmon_example_recipes.js
@@ -0,0 +1,88 @@
+/* Copyright (c) 2010 Richard Wall <richard (at) the-moon.net>
+ * See LICENSE for details.
+ *
+ * Some example recipes for Collectd RRD data - you *will* need to modify this
+ * based on the RRD data available on your system.
+ */
+
+if(typeof jarmon == 'undefined') {
+ var jarmon = {};
+}
+
+jarmon.COLLECTD_RECIPES = {
+ 'cpu': [
+ {
+ title: 'CPU Usage',
+ data: [
+ ['cpu-0/cpu-wait.rrd', 0, 'CPU-0 Wait', '%'],
+ ['cpu-1/cpu-wait.rrd', 0, 'CPU-1 Wait', '%'],
+ ['cpu-0/cpu-system.rrd', 0, 'CPU-0 System', '%'],
+ ['cpu-1/cpu-system.rrd', 0, 'CPU-1 System', '%'],
+ ['cpu-0/cpu-user.rrd', 0, 'CPU-0 User', '%'],
+ ['cpu-1/cpu-user.rrd', 0, 'CPU-1 User', '%']
+ ],
+ options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS,
+ jarmon.Chart.STACKED_OPTIONS)
+ },
+ ],
+
+ 'memory': [
+ {
+ title: 'Memory',
+ data: [
+ ['memory/memory-buffered.rrd', 0, 'Buffered', 'B'],
+ ['memory/memory-used.rrd', 0, 'Used', 'B'],
+ ['memory/memory-cached.rrd', 0, 'Cached', 'B'],
+ ['memory/memory-free.rrd', 0, 'Free', 'B']
+ ],
+ options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS,
+ jarmon.Chart.STACKED_OPTIONS)
+ }
+ ],
+
+ 'dns': [
+ {
+ title: 'DNS Query Types',
+ data: [
+ ['dns/dns_qtype-A.rrd', 0, 'A', 'Q/s'],
+ ['dns/dns_qtype-PTR.rrd', 0, 'PTR', 'Q/s'],
+ ['dns/dns_qtype-SOA.rrd', 0, 'SOA', 'Q/s'],
+ ['dns/dns_qtype-SRV.rrd', 0, 'SRV', 'Q/s']
+ ],
+ options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS)
+ },
+
+ {
+ title: 'DNS Return Codes',
+ data: [
+ ['dns/dns_rcode-NOERROR.rrd', 0, 'NOERROR', 'Q/s'],
+ ['dns/dns_rcode-NXDOMAIN.rrd', 0, 'NXDOMAIN', 'Q/s'],
+ ['dns/dns_rcode-SERVFAIL.rrd', 0, 'SERVFAIL', 'Q/s']
+ ],
+ options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS)
+ }
+ ],
+
+ 'load': [
+ {
+ title: 'Load Average',
+ data: [
+ ['load/load.rrd', 'shortterm', 'Short Term', ''],
+ ['load/load.rrd', 'midterm', 'Medium Term', ''],
+ ['load/load.rrd', 'longterm', 'Long Term', '']
+ ],
+ options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS)
+ }
+ ],
+
+ 'interface': [
+ {
+ title: 'Wlan0 Throughput',
+ data: [
+ ['interface/if_octets-wlan0.rrd', 'tx', 'Transmit', 'b/s'],
+ ['interface/if_octets-wlan0.rrd', 'rx', 'Receive', 'b/s']
+ ],
+ options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS)
+ }
+ ]
+};
diff --git a/index.html b/index.html
index ad73251..426e7eb 100644
--- a/index.html
+++ b/index.html
@@ -24,6 +24,7 @@
<script type="text/javascript" src="http://cdn.jquerytools.org/1.2.2/all/jquery.tools.min.js"></script>
<script type="text/javascript" src="jarmon.js"></script>
+ <script type="text/javascript" src="docs/jarmon_example_recipes.js"></script>
<script type="text/javascript">
// Recipes for the charts on this page
var application_recipes = [
diff --git a/jarmon.js b/jarmon.js
index 67b4522..8bef190 100644
--- a/jarmon.js
+++ b/jarmon.js
@@ -553,85 +553,6 @@ jarmon.Chart.STACKED_OPTIONS = {
};
-jarmon.COLLECTD_RECIPES = {
- 'cpu': [
- {
- title: 'CPU Usage',
- data: [
- ['cpu-0/cpu-wait.rrd', 0, 'CPU-0 Wait', '%'],
- ['cpu-1/cpu-wait.rrd', 0, 'CPU-1 Wait', '%'],
- ['cpu-0/cpu-system.rrd', 0, 'CPU-0 System', '%'],
- ['cpu-1/cpu-system.rrd', 0, 'CPU-1 System', '%'],
- ['cpu-0/cpu-user.rrd', 0, 'CPU-0 User', '%'],
- ['cpu-1/cpu-user.rrd', 0, 'CPU-1 User', '%']
- ],
- options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS,
- jarmon.Chart.STACKED_OPTIONS)
- },
- ],
-
- 'memory': [
- {
- title: 'Memory',
- data: [
- ['memory/memory-buffered.rrd', 0, 'Buffered', 'B'],
- ['memory/memory-used.rrd', 0, 'Used', 'B'],
- ['memory/memory-cached.rrd', 0, 'Cached', 'B'],
- ['memory/memory-free.rrd', 0, 'Free', 'B']
- ],
- options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS,
- jarmon.Chart.STACKED_OPTIONS)
- }
- ],
-
- 'dns': [
- {
- title: 'DNS Query Types',
- data: [
- ['dns/dns_qtype-A.rrd', 0, 'A', 'Q/s'],
- ['dns/dns_qtype-PTR.rrd', 0, 'PTR', 'Q/s'],
- ['dns/dns_qtype-SOA.rrd', 0, 'SOA', 'Q/s'],
- ['dns/dns_qtype-SRV.rrd', 0, 'SRV', 'Q/s']
- ],
- options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS)
- },
-
- {
- title: 'DNS Return Codes',
- data: [
- ['dns/dns_rcode-NOERROR.rrd', 0, 'NOERROR', 'Q/s'],
- ['dns/dns_rcode-NXDOMAIN.rrd', 0, 'NXDOMAIN', 'Q/s'],
- ['dns/dns_rcode-SERVFAIL.rrd', 0, 'SERVFAIL', 'Q/s']
- ],
- options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS)
- }
- ],
-
- 'load': [
- {
- title: 'Load Average',
- data: [
- ['load/load.rrd', 'shortterm', 'Short Term', ''],
- ['load/load.rrd', 'midterm', 'Medium Term', ''],
- ['load/load.rrd', 'longterm', 'Long Term', '']
- ],
- options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS)
- }
- ],
-
- 'interface': [
- {
- title: 'Wlan0 Throughput',
- data: [
- ['interface/if_octets-wlan0.rrd', 'tx', 'Transmit', 'b/s'],
- ['interface/if_octets-wlan0.rrd', 'rx', 'Receive', 'b/s']
- ],
- options: jQuery.extend(true, {}, jarmon.Chart.BASE_OPTIONS)
- }
- ]
-};
-
-
/**
* Presents the user with a form and a timeline with which they can choose a
* time range and co-ordinates the refreshing of a series of charts.