Class: Pangea::VMMetrics
Overview
Metrics associated with a VM
xen-api class: VM_metrics
Instance Method Summary collapse
-
#initialize(link, ref) ⇒ VMMetrics
constructor
:nodoc:.
-
#last_updated ⇒ Object
xen-api: VM_metrics.get_last_updated.
-
#memory_actual ⇒ Object
xen-api: VM_metrics.get_memory_actual.
-
#start_time ⇒ Object
xen-api: VM_metrics.get_start_time.
-
#state ⇒ Object
xen-api: VM_metrics.get_state.
- #to_s ⇒ Object
-
#vcpus_number ⇒ Object
xen-api: VM_metrics.get_VCPUs_number Number of cpus assigned to the domU.
-
#vcpus_utilisation ⇒ Object
xen-api: VM_metrics.get_VCPUs_utilisation.
Methods inherited from XObject
Constructor Details
#initialize(link, ref) ⇒ VMMetrics
:nodoc:
479 480 481 482 |
# File 'lib/pangea/objects.rb', line 479 def initialize(link, ref) #:nodoc: super(link, ref) @proxy_name = 'VM_metrics' end |
Instance Method Details
#last_updated ⇒ Object
xen-api: VM_metrics.get_last_updated
530 531 532 |
# File 'lib/pangea/objects.rb', line 530 def last_updated (ref_call :get_last_updated).to_time end |
#memory_actual ⇒ Object
xen-api: VM_metrics.get_memory_actual
487 488 489 |
# File 'lib/pangea/objects.rb', line 487 def memory_actual ref_call :get_memory_actual end |
#start_time ⇒ Object
xen-api: VM_metrics.get_start_time
523 524 525 |
# File 'lib/pangea/objects.rb', line 523 def start_time (ref_call :get_start_time).to_time end |
#state ⇒ Object
xen-api: VM_metrics.get_state
516 517 518 |
# File 'lib/pangea/objects.rb', line 516 def state ref_call :get_state end |
#to_s ⇒ Object
534 535 536 537 538 539 540 541 542 543 544 545 546 |
# File 'lib/pangea/objects.rb', line 534 def to_s vcpu_u = "" vcpus_utilisation.each do |k, v| vcpu_u += "#{k}: %0.2f\n" % (v * 100) end eol = "\n" "[VM Metrics]" + eol + "State: #{state}" + eol + "Start Time: #{start_time}" + eol + "Last Updated: #{last_updated}" + eol + "VCPUs Utilisation:" + eol + vcpu_u end |
#vcpus_number ⇒ Object
xen-api: VM_metrics.get_VCPUs_number Number of cpus assigned to the domU
495 496 497 |
# File 'lib/pangea/objects.rb', line 495 def vcpus_number ref_call :get_VCPUs_number end |
#vcpus_utilisation ⇒ Object
xen-api: VM_metrics.get_VCPUs_utilisation
returns a hash
cpu0 => utilisation,
cpu1 => utilization,
...
509 510 511 |
# File 'lib/pangea/objects.rb', line 509 def vcpus_utilisation ref_call :get_VCPUs_utilisation end |