Scott Baker | 771819b | 2014-03-19 22:10:17 -0700 | [diff] [blame] | 1 | // ---------------------------------------------------------------------------- |
| 2 | // node count and average cpu utilization |
| 3 | |
Scott Baker | a0ffec5 | 2015-01-13 01:06:34 -0800 | [diff] [blame^] | 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); |
Scott Baker | 771819b | 2014-03-19 22:10:17 -0700 | [diff] [blame] | 7 | $.ajax({ |
Scott Baker | 61aefcf | 2014-04-25 15:21:18 -0700 | [diff] [blame] | 8 | url: url, |
Scott Baker | 771819b | 2014-03-19 22:10:17 -0700 | [diff] [blame] | 9 | dataType : 'json', |
| 10 | type : 'GET', |
Scott Baker | b23dd1d | 2014-06-09 16:03:35 -0700 | [diff] [blame] | 11 | success: function(newData) { |
Scott Baker | a0ffec5 | 2015-01-13 01:06:34 -0800 | [diff] [blame^] | 12 | console.log(newData); |
Scott Baker | b23dd1d | 2014-06-09 16:03:35 -0700 | [diff] [blame] | 13 | setTimeout(updatePageAnalytics, 30000); |
| 14 | }, |
| 15 | error: function() { |
Scott Baker | 771819b | 2014-03-19 22:10:17 -0700 | [diff] [blame] | 16 | } |
| 17 | }); |
Scott Baker | 771819b | 2014-03-19 22:10:17 -0700 | [diff] [blame] | 18 | } |
| 19 | |
Scott Baker | ca2e22d | 2014-05-23 18:26:06 -0700 | [diff] [blame] | 20 | $( document ).ready(function() { |
Scott Baker | a0ffec5 | 2015-01-13 01:06:34 -0800 | [diff] [blame^] | 21 | if (admin_object_name == "Sliver" && admin_object_id != undefined) { |
| 22 | updatePageCPU(); |
| 23 | } |
| 24 | }); |
Scott Baker | 771819b | 2014-03-19 22:10:17 -0700 | [diff] [blame] | 25 | |