minidashboard, WIP
[plstackapi.git] / planetstack / core / static / page_analytics.js
1 // ----------------------------------------------------------------------------
2 // node count and average cpu utilization
3
4 function updatePageCPU() {
5     var url="/stats/?model_name=" + admin_object_name + "&pk=" + admin_object_id + "&meter=cpu" + "&controller_name=" + admin_object_controller;
6     console.log("fetching stats url " + url);
7     $.ajax({
8     url: url,
9     dataType : 'json',
10     type : 'GET',
11     success: function(newData) {
12         console.log(newData);
13         setTimeout(updatePageAnalytics, 30000);
14     },
15     error: function() {
16     }
17 });
18 }
19
20 $( document ).ready(function() {
21     if (admin_object_name == "Sliver" && admin_object_id != undefined) {
22         updatePageCPU();
23     }
24 });
25