corrade-http-templates – Diff between revs 8 and 75

Subversion Repositories:
Rev:
Only display areas with differencesIgnore whitespace
Rev 8 Rev 75
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3   3  
4 <head> 4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>Reading Simulator Statistics using Corrade</title> 6 <title>Reading Simulator Statistics using Corrade</title>
7   7  
8 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> 8 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
9 <script type="text/javascript"> 9 <script type="text/javascript">
10 $(function() { 10 $(function() {
11 function retrieveStats(series_1, series_2, series_3, series_4, series_5) { 11 function retrieveStats(series_1, series_2, series_3, series_4, series_5) {
12 $.ajax({ 12 $.ajax({
13 type: 'post', 13 type: 'post',
14 url: "getRegionData.php", 14 url: "getRegionData.php",
15 data: "query=Stats.ScriptTime,Stats.Dilation,Stats.FPS,Stats.PhysicsFPS,Stats.AgentUpdates&t=" + Math.random() 15 data: "query=Stats.ScriptTime,Stats.Dilation,Stats.FPS,Stats.PhysicsFPS,Stats.AgentUpdates&t=" + Math.random()
16 }).done(function(response) { 16 }).done(function(response) {
17 var time = (new Date()).getTime(); 17 var time = (new Date()).getTime();
18 var data = $.parseJSON(response); 18 var data = $.parseJSON(response);
19 series_1.addPoint( 19 series_1.addPoint(
20 [ 20 [
21 time, 21 time,
22 parseFloat( 22 parseFloat(
23 data["Stats.ScriptTime"] 23 data["Stats.ScriptTime"]
24 ) 24 )
25 ], 25 ],
26 false, // false for all but last 26 false, // false for all but last
27 true 27 true
28 ); 28 );
29 series_2.addPoint( 29 series_2.addPoint(
30 [ 30 [
31 time, 31 time,
32 parseFloat( 32 parseFloat(
33 data["Stats.Dilation"] 33 data["Stats.Dilation"]
34 ) 34 )
35 ], 35 ],
36 false, // false for all but last 36 false, // false for all but last
37 true 37 true
38 ); 38 );
39 series_3.addPoint( 39 series_3.addPoint(
40 [ 40 [
41 time, 41 time,
42 parseFloat( 42 parseFloat(
43 data["Stats.FPS"] 43 data["Stats.FPS"]
44 ) 44 )
45 ], 45 ],
46 false, // false for all but last 46 false, // false for all but last
47 true 47 true
48 ); 48 );
49 series_4.addPoint( 49 series_4.addPoint(
50 [ 50 [
51 time, 51 time,
52 parseFloat( 52 parseFloat(
53 data["Stats.PhysicsFPS"] 53 data["Stats.PhysicsFPS"]
54 ) 54 )
55 ], 55 ],
56 false, // false for all but last 56 false, // false for all but last
57 true 57 true
58 ); 58 );
59 series_5.addPoint( 59 series_5.addPoint(
60 [ 60 [
61 time, 61 time,
62 parseFloat( 62 parseFloat(
63 data["Stats.AgentUpdates"] 63 data["Stats.AgentUpdates"]
64 ) 64 )
65 ], 65 ],
66 true, 66 true,
67 true 67 true
68 ); 68 );
69 setTimeout( 69 setTimeout(
70 retrieveStats, 70 retrieveStats,
71 1000, 71 1000,
72 series_1, 72 series_1,
73 series_2, 73 series_2,
74 series_3, 74 series_3,
75 series_4, 75 series_4,
76 series_5 76 series_5
77 ); 77 );
78 }); 78 });
79 } 79 }
80 Highcharts.setOptions({ 80 Highcharts.setOptions({
81 global: { 81 global: {
82 useUTC: true 82 useUTC: true
83 } 83 }
84 }); 84 });
85 $('#container').highcharts({ 85 $('#container').highcharts({
86 chart: { 86 chart: {
87 type: 'spline', 87 type: 'spline',
88 animation: Highcharts.svg, // don't animate in old IE 88 animation: Highcharts.svg, // don't animate in old IE
89 marginRight: 10, 89 marginRight: 10,
90 //shadow: true, 90 //shadow: true,
91 events: { 91 events: {
92 load: function() { 92 load: function() {
93 // set up the updating of the chart each second 93 // set up the updating of the chart each second
94 setTimeout( 94 setTimeout(
95 retrieveStats, 95 retrieveStats,
96 1000, 96 1000,
97 this.series[0], 97 this.series[0],
98 this.series[1], 98 this.series[1],
99 this.series[2], 99 this.series[2],
100 this.series[3], 100 this.series[3],
101 this.series[4] 101 this.series[4]
102 ); 102 );
103 } 103 }
104 } 104 }
105 }, 105 },
106 title: { 106 title: {
107 text: '', 107 text: '',
108 useHTML: false 108 useHTML: false
109 }, 109 },
110 title: { 110 title: {
111 text: 'Region statistics for <a href="secondlife://Puguet%20Sound/128/128/10">Puguet Sound</a> using Corrade', 111 text: 'Region statistics for <a href="secondlife://Puguet%20Sound/128/128/10">Puguet Sound</a> using Corrade',
112 useHTML: true 112 useHTML: true
113 }, 113 },
114 credits: { 114 credits: {
115 enabled: false 115 enabled: false
116 }, 116 },
117 xAxis: { 117 xAxis: {
118 type: 'datetime', 118 type: 'datetime',
119 tickPixelInterval: 150 119 tickPixelInterval: 150
120 }, 120 },
121 yAxis: [{ 121 yAxis: [{
122 type: 'logarithmic', 122 type: 'logarithmic',
123 title: { 123 title: {
124 text: '' 124 text: ''
125 }, 125 },
126 plotLines: [{ 126 plotLines: [{
127 value: 0, 127 value: 0,
128 width: 1, 128 width: 1,
129 color: '#808080' 129 color: '#808080'
130 }] 130 }]
131 }], 131 }],
132 tooltip: { 132 tooltip: {
133 formatter: function() { 133 formatter: function() {
134 return '<b>' + this.series.name + '</b><br/>' + 134 return '<b>' + this.series.name + '</b><br/>' +
135 Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' + 135 Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' +
136 Highcharts.numberFormat(this.y, 2); 136 Highcharts.numberFormat(this.y, 2);
137 } 137 }
138 }, 138 },
139 legend: { 139 legend: {
140 enabled: true 140 enabled: true
141 }, 141 },
142 exporting: { 142 exporting: {
143 enabled: true 143 enabled: true
144 }, 144 },
145 series: [{ 145 series: [{
146 name: 'Script Time', 146 name: 'Script Time',
147 data: (function() { 147 data: (function() {
148 // generate the series length 148 // generate the series length
149 var data = [], 149 var data = [],
150 time = (new Date()).getTime(), 150 time = (new Date()).getTime(),
151 i; 151 i;
152   152  
153 for (i = -19; i <= 0; i += 1) { 153 for (i = -19; i <= 0; i += 1) {
154 data.push({ 154 data.push({
155 x: time + i * 1000, 155 x: time + i * 1000,
156 y: 0 156 y: 0
157 }); 157 });
158 } 158 }
159 return data; 159 return data;
160 }()) 160 }())
161 }, { 161 }, {
162 name: 'Dilation', 162 name: 'Dilation',
163 data: (function() { 163 data: (function() {
164 // generate the series length 164 // generate the series length
165 var data = [], 165 var data = [],
166 time = (new Date()).getTime(), 166 time = (new Date()).getTime(),
167 i; 167 i;
168   168  
169 for (i = -19; i <= 0; i += 1) { 169 for (i = -19; i <= 0; i += 1) {
170 data.push({ 170 data.push({
171 x: time + i * 1000, 171 x: time + i * 1000,
172 y: 0 172 y: 0
173 }); 173 });
174 } 174 }
175 return data; 175 return data;
176 }()) 176 }())
177 }, { 177 }, {
178 name: 'FPS', 178 name: 'FPS',
179 data: (function() { 179 data: (function() {
180 // generate the series length 180 // generate the series length
181 var data = [], 181 var data = [],
182 time = (new Date()).getTime(), 182 time = (new Date()).getTime(),
183 i; 183 i;
184   184  
185 for (i = -19; i <= 0; i += 1) { 185 for (i = -19; i <= 0; i += 1) {
186 data.push({ 186 data.push({
187 x: time + i * 1000, 187 x: time + i * 1000,
188 y: 0 188 y: 0
189 }); 189 });
190 } 190 }
191 return data; 191 return data;
192 }()) 192 }())
193 }, { 193 }, {
194 name: 'Physics FPS', 194 name: 'Physics FPS',
195 data: (function() { 195 data: (function() {
196 // generate the series length 196 // generate the series length
197 var data = [], 197 var data = [],
198 time = (new Date()).getTime(), 198 time = (new Date()).getTime(),
199 i; 199 i;
200   200  
201 for (i = -19; i <= 0; i += 1) { 201 for (i = -19; i <= 0; i += 1) {
202 data.push({ 202 data.push({
203 x: time + i * 1000, 203 x: time + i * 1000,
204 y: 0 204 y: 0
205 }); 205 });
206 } 206 }
207 return data; 207 return data;
208 }()) 208 }())
209 }, { 209 }, {
210 name: 'Agent Updates', 210 name: 'Agent Updates',
211 data: (function() { 211 data: (function() {
212 // generate the series length 212 // generate the series length
213 var data = [], 213 var data = [],
214 time = (new Date()).getTime(), 214 time = (new Date()).getTime(),
215 i; 215 i;
216   216  
217 for (i = -19; i <= 0; i += 1) { 217 for (i = -19; i <= 0; i += 1) {
218 data.push({ 218 data.push({
219 x: time + i * 1000, 219 x: time + i * 1000,
220 y: 0 220 y: 0
221 }); 221 });
222 } 222 }
223 return data; 223 return data;
224 }()) 224 }())
225 }] 225 }]
226 }); 226 });
227 }); 227 });
228 </script> 228 </script>
229 </head> 229 </head>
230   230  
231 <body> 231 <body>
232 <script src="js/highcharts.js"></script> 232 <script src="js/highcharts.js"></script>
233 <script src="js/exporting.js"></script> 233 <script src="js/exporting.js"></script>
234   234  
235 <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div> 235 <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
236   236  
237 </body> 237 </body>
238   238  
239 </html> 239 </html>
240   240  
241
Generated by GNU Enscript 1.6.5.90.
241
Generated by GNU Enscript 1.6.5.90.
242   242  
243   243  
244   244