blob: 362072f0e87bcf571272f7b2831116db0aade2dc [file] [log] [blame]
ramangrover29a04696c2013-07-31 21:50:38 -07001<html>
2 <head>
ramangrover2975b73552013-08-06 10:31:04 -07003 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
ramangrover29a04696c2013-07-31 21:50:38 -07004 <script type="text/javascript" src="/webui/static/js/smoothie.js"></script>
ramangrover29a04696c2013-07-31 21:50:38 -07005 <script type="text/javascript">
ramangrover2975b73552013-08-06 10:31:04 -07006 $(document).ready(function() {
7 var feedSeries = new TimeSeries();
8 var buildGraph = setInterval(fetchFeedReport, 500);
ramangrover29a04696c2013-07-31 21:50:38 -07009
ramangrover2975b73552013-08-06 10:31:04 -070010 function fetchFeedReport() {
11 $.ajax({
12 url: '/feed/data?dataverse=%s&dataset=%s&feed=%s',
13 method: 'GET',
14 dataType: 'json',
15 success: onFeedReportReceived
16 });
17 }
ramangrover2940636ee2013-08-04 22:05:49 -070018
ramangrover2975b73552013-08-06 10:31:04 -070019
20 function onFeedReportReceived(data) {
21 var tput = data["value"];
22 if (tput == null) {
23 clearInterval(buildGraph);
24 } else {
25 feedSeries.append(data["time"], data["value"]);
26 }
27 }
28
29 function myYRangeFunction(range) {
30 var min = 0;
31 var max = 5000;
32 return {min: min, max: max};
33 }
34
35
36 function createTimeline() {
37 var chart = new SmoothieChart({minValue:0,horizontalLines:[{color:'#ffffff',lineWidth:1,value:0},{color:'#880000',lineWidth:2,value:3333},{color:'#880000',lineWidth:2,value:-3333}]});
38 chart.addTimeSeries(feedSeries, { strokeStyle: 'rgba(0, 255, 0, 1)', fillStyle: 'rgba(0, 255, 0, 0.2)', lineWidth: 4 });
39 chart.streamTo(document.getElementById("chart"), 500);
40 }
41 createTimeline();
42 });
ramangrover29a04696c2013-07-31 21:50:38 -070043 </script>
ramangrover29c996e282013-08-03 14:36:45 -070044 </head>
ramangrover2975b73552013-08-06 10:31:04 -070045 <body>
ramangrover29c996e282013-08-03 14:36:45 -070046
ramangrover2975b73552013-08-06 10:31:04 -070047 <p>Feed Ingestion</p>
ramangrover29c996e282013-08-03 14:36:45 -070048
ramangrover2975b73552013-08-06 10:31:04 -070049 <canvas id="chart" width="600" height="300"></canvas>
ramangrover29c996e282013-08-03 14:36:45 -070050
ramangrover29a04696c2013-07-31 21:50:38 -070051 </body>
52</html>
ramangrover2975b73552013-08-06 10:31:04 -070053