Module: MobyBehaviour::QT::Cpu

Includes:
Behaviour
Defined in:
lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/cute_cpu.rb

Overview

description

behaviour

QtCpu

requires

testability-driver-qt-sut-plugin

input_type

*

sut_type

QT

sut_version

*

objects

*

Instance Method Summary collapse

Methods included from Behaviour

#command_params

Instance Method Details

#start_cpu_measurementObject

description

Start collecting CPU usage per second data for the app.

returns

NilClass

description: -
example: -

exceptions

ArgumentError

description:  In case the given parameters are not valid.


59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/cute_cpu.rb', line 59

def start_cpu_measurement
    
  begin
    
    log_cpu(:interval => 1, :filePath => '/tmp') 
    
  rescue Exception
    
    $logger.behaviour "FAIL;Failed start_cpu_measurement.;#{ identity };start_cpu_measurement;"
    raise
    
  end
    
  $logger.behaviour "PASS;Operation start_cpu_measurement executed successfully.;#{ identity };start_cpu_measurement;"
    
  nil
  
end

#stop_cpu_measurementObject

description

Stop collecting CPU usage data for the object.

returns

Array

description: An Array of CPU entries. Each entry is a hash table that contains the value and time stamp {value => 42.00, cpuLoad => 42.00, time_stamp => 06:49:42.259}
example: [{value => 42.0, cpuLoad => 42.0, time_stamp => 06:49:42.259}, {value => 32.0, cpuLoad => 32.0, time_stamp => 06:49:43.259}]

exceptions

ArgumentError

description:  In case the given parameters are not valid.


90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/cute_cpu.rb', line 90

def stop_cpu_measurement
    
  begin
    
    results = parse_results_cpu( stop_cpu_log() )
    
  rescue Exception
    
    $logger.behaviour "FAIL;Failed stop_cpu_measurement.;#{ identity };stop_cpu_measurement;"
    
    raise
    
  end
    
  $logger.behaviour "PASS;Operation stop_cpu_measurement executed successfully.;#{ identity };stop_cpu_measurement;"
    
  results
    
end