search for: total_uptime_timestamp

Displaying 6 results from an estimated 6 matches for "total_uptime_timestamp".

2009 Jun 24
1
[PATCH server] Vm state change auditing/accounting
Adds VmStateChangeEvent class and uses VmObserver to track/audit state changes for Vm objects. Callbacks in VmObserver also update the new total_uptime and total_uptime_timestamp attributes of Vm class, which allows easy calculation of time spent in running states for user resource use accounting. --- src/app/models/vm.rb | 34 +++++++++++ src/app/models/vm_observer.rb | 96 ++++++++++++++++++++++++++++++ src/app/models/vm_state_change_ev...
2009 Jun 29
0
[PATCH server] REVISED Vm state change auditing/accounting
Adds VmStateChangeEvent class and uses VmObserver to track/audit state changes for Vm objects. Callbacks in VmObserver also update the new total_uptime and total_uptime_timestamp attributes of Vm class, which allows easy calculation of time spent in running states for user resource use accounting. --- src/app/models/vm.rb | 34 +++++++++++ src/app/models/vm_observer.rb | 96 ++++++++++++++++++++++++++++++ src/app/models/vm_state_change_ev...
2009 Jun 29
3
[PATCH server] UI for accumulated uptime for VMs.
...super(:full_items => @pool.vms, :find_opts => {}, :include_pool => :true) + super(:full_items => @pool.vms, :find_opts => {:select => "*, case + when state='running' then + (cast(total_uptime || ' sec' as interval) + + (now() - total_uptime_timestamp)) + else cast(total_uptime || ' sec' as interval) + end as calc_uptime"}, :include_pool => :true) end def delete diff --git a/src/app/controllers/smart_pools_controller.rb b/src/app/controllers/smart_pools_controller.rb index 8762ac0..b355f4b 100644 --- a/src/ap...
2009 Jul 06
0
[PATCH server] UI for accumulated uptime for VMs. (revised2)
...eaf94 100644 --- a/src/app/models/vm.rb +++ b/src/app/models/vm.rb @@ -420,14 +420,23 @@ class Vm < ActiveRecord::Base return i end + def self.calc_uptime + "*, case when state='running' then + (cast(total_uptime || ' sec' as interval) + + (now() - total_uptime_timestamp)) + else cast(total_uptime || ' sec' as interval) + end as calc_uptime" + end + # Make method for calling paginated vms easier for clients. # TODO: Might want to have an optional param for per_page var def self.paged_with_perms(user, priv, page, order) - Vm.paginat...
2009 Jul 02
1
[PATCH server] UI for accumulated uptime for VMs. (revised)
...eaf94 100644 --- a/src/app/models/vm.rb +++ b/src/app/models/vm.rb @@ -420,14 +420,23 @@ class Vm < ActiveRecord::Base return i end + def self.calc_uptime + "*, case when state='running' then + (cast(total_uptime || ' sec' as interval) + + (now() - total_uptime_timestamp)) + else cast(total_uptime || ' sec' as interval) + end as calc_uptime" + end + # Make method for calling paginated vms easier for clients. # TODO: Might want to have an optional param for per_page var def self.paged_with_perms(user, priv, page, order) - Vm.paginat...
2009 Jul 06
2
[PATCH server] UI for accumulated uptime for VMs. (revised3)
...4 100644 --- a/src/app/models/vm.rb +++ b/src/app/models/vm.rb @@ -420,14 +420,23 @@ class Vm < ActiveRecord::Base return i end + def self.calc_uptime + "vms.*, case when state='running' then + (cast(total_uptime || ' sec' as interval) + + (now() - total_uptime_timestamp)) + else cast(total_uptime || ' sec' as interval) + end as calc_uptime" + end + # Make method for calling paginated vms easier for clients. # TODO: Might want to have an optional param for per_page var def self.paged_with_perms(user, priv, page, order) - Vm.paginat...