Displaying 2 results from an estimated 2 matches for "audit_running_states".
2009 Jun 29
0
[PATCH server] REVISED Vm state change auditing/accounting
...OYABLE_STATES = [STATE_PENDING,
STATE_STOPPED,
STATE_CREATE_FAILED,
@@ -176,6 +203,13 @@ class Vm < ActiveRecord::Base
validates_inclusion_of :state,
:in => EFFECTIVE_STATE.keys
+ def get_calculated_uptime
+ if VmObserver::AUDIT_RUNNING_STATES.include?(state)
+ total_uptime_timestamp ? total_uptime + (Time.now - total_uptime_timestamp) : 0
+ else
+ total_uptime
+ end
+ end
def get_vm_pool
vm_resource_pool
diff --git a/src/app/models/vm_observer.rb b/src/app/models/vm_observer.rb
new file mode 100644
index 00000...
2009 Jun 24
1
[PATCH server] Vm state change auditing/accounting
...OYABLE_STATES = [STATE_PENDING,
STATE_STOPPED,
STATE_CREATE_FAILED,
@@ -176,6 +203,13 @@ class Vm < ActiveRecord::Base
validates_inclusion_of :state,
:in => EFFECTIVE_STATE.keys
+ def get_calculated_uptime
+ if VmObserver::AUDIT_RUNNING_STATES.include?(state)
+ total_uptime_timestamp ? total_uptime + (Time.now - total_uptime_timestamp) : 0
+ else
+ total_uptime
+ end
+ end
def get_vm_pool
vm_resource_pool
diff --git a/src/app/models/vm_observer.rb b/src/app/models/vm_observer.rb
new file mode 100644
index 00000...