Module: MobyBehaviour::QT::Fps

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

Overview

description

behaviour

QtFps

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

#collect_fps_dataObject

description

Collect the stored fps results from the target. This will not stop the measurement but it will restart it so the results returned will not be included in the next data request. Measuring fps will have a small impact on the software performance and memory consumption so it is recommended that the collection is stopped if no longer needed.

returns

Array

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

exceptions

ArgumentError

description:  In case the given parameters are not valid.


136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/fps.rb', line 136

def collect_fps_data

  begin

    results = parse_results( fixture('fps', 'collectData') )

  rescue Exception

    $logger.behaviour "FAIL;Failed collect_fps_data.;#{ identity };collect_fps_data;"

    raise

  end

  $logger.behaviour "PASS;Operation collect_fps_data executed successfully.;#{ identity };collect_fps_data;"

  results

end

#start_fps_measurementObject

description

Start collecting frames per second data for the object. Testability driver qttas package provides a fixture for measuring fps of a component. This behaviour is a wrapper for the fixture. The fixture intercepts paint events send to the target of the fps measurement and simply counts how many occur during each second. The way this is done differs a bit depending on the target object. For normal QWidgets the fps values are measured to the target object direclty. QGraphicsItem based objects this is not the case. For QGrapchisItem based objects the system determines the QGraphicsView the item is in and starts to listen to paint evets send to the viewport of the QGraphicsView. If you measure the QGraphicsView object directly the measurement is also done for the viewport.

returns

NilClass

description: -
example: -

exceptions

ArgumentError

description:  In case the given parameters are not valid.


69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/fps.rb', line 69

def start_fps_measurement

  begin

    fixture('fps', 'startFps')

  rescue Exception

    $logger.behaviour "FAIL;Failed start_fps_measurement.;#{ identity };start_fps_measurement;"
    raise

  end

  $logger.behaviour "PASS;Operation start_fps_measurement executed successfully.;#{ identity };start_fps_measurement;"

  nil
  
end

#stop_fps_measurementObject

description

Stop collecting frames per second data for the object.

returns

Array

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

exceptions

ArgumentError

description:  In case the given parameters are not valid.


100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/fps.rb', line 100

def stop_fps_measurement

  begin

    results = parse_results( fixture('fps', 'stopFps') )

  rescue Exception

    $logger.behaviour "FAIL;Failed stop_fps_measurement.;#{ identity };stop_fps_measurement;"

    raise

  end

  $logger.behaviour "PASS;Operation stop_fps_measurement executed successfully.;#{ identity };stop_fps_measurement;"

  results

end