Synopsis

void sleep ( milliseconds )
void waitLeisure ( )
void createTestWindow ( width,
  height,
  alpha,
  maximized )
void waitTestWindows ( )
void destroyTestWindows ( )
void defineScriptEvent ( name,
  description )
void scriptEvent ( name )
void collectStatistics ( )
void runPerfScript ( scriptModule )

Details


sleep ()
void sleep ( milliseconds )

Used within an automation script to pause the the execution of the current script for the specified amount of time. Use as 'yield Scripting.sleep(500);'

milliseconds number of milliseconds to wait


waitLeisure ()
void waitLeisure ( )

Used within an automation script to pause the the execution of the current script until Cinnamon is completely idle. Use as 'yield Scripting.waitLeisure();'



createTestWindow ()
void createTestWindow ( width,
  height,
  alpha,
  maximized )

Creates a window using cdos-perf-helper for testing purposes. While this function can be used with yield in an automation script to pause until the D-Bus call to the helper process returns, because of the normal X asynchronous mapping process, to actually wait until the window has been mapped and exposed, use waitTestWindows().

width width of window, in pixels
height height of window, in pixels
alpha whether the window should be alpha transparent
maximized whethe the window should be created maximized


waitTestWindows ()
void waitTestWindows ( )

Used within an automation script to pause until all windows previously created with createTestWindow have been mapped and exposed.



destroyTestWindows ()
void destroyTestWindows ( )

Destroys all windows previously created with createTestWindow(). While this function can be used with yield in an automation script to pause until the D-Bus call to the helper process returns, this doesn't guarantee that Muffin has actually finished the destroy process because of normal X asynchronicity.



defineScriptEvent ()
void defineScriptEvent ( name,
  description )

Convenience function to define a zero-argument performance event within the 'script' namespace that is reserved for events defined locally within a performance automation script

name The event will be called script.
description Short human-readable description of the event


scriptEvent ()
void scriptEvent ( name )

Convenience function to record a script-local performance event previously defined with defineScriptEvent

name Name registered with defineScriptEvent()


collectStatistics ()
void collectStatistics ( )

Convenience function to trigger statistics collection



runPerfScript ()
void runPerfScript ( scriptModule )

Runs a script for automated collection of performance data. The script is defined as a Javascript module with specified contents.

First the run() function within the module will be called as a generator to automate a series of actions. These actions will trigger performance events and the script can also record its own performance events.

Then the recorded event log is replayed using handler functions within the module. The handler for the event 'foo.bar' is called foo_bar().

Finally if the module has a function called finish(), that will be called.

The event handler and finish functions are expected to fill in metrics to an object within the module called METRICS. Each property of this object represents an individual metric. The name of the property is the name of the metric, the value of the property is an object with the following properties:

description: human readable description of the metric units: a string representing the units of the metric. It has the form ' ... / / ...'. Certain unit values are recognized: s, ms, us, B, KiB, MiB. Other values can appear but are uninterpreted. Examples 's', '/ s', 'frames', 'frames / s', 'MiB / s / frame' value: computed value of the metric

The resulting metrics will be written to @outputFile as JSON, or, if @outputFile is not provided, logged.

After running the script and collecting statistics from the event log, Cinnamon will exit.

scriptModule module object with run and finish functions and event handlers