ANTAREX API

Clava API

LARA API

LARA Common Language API

ExamonBroker

ExamonBroker

ExamonBroker

Utility class to represent a broker. This is meant to be passed to the
initialization of collectors.

Parameters

ip: string - the IP of the broker
port: number - the port of the broker is listening to, defaults to 1883 (optional)

ExamonCollector

Constructor

ExamonCollector

new ExamonCollector(name, [$scope], topic)

Class that represents an Examon collector.

Parameters

name: string - the name of the collector
$scope: joinpoint - the scope in which the collector will be declared. If not defined, this will be declared globally. (optional)
topic: any

Instance Members

clean

clean($jp)

Inserts code that cleans this collector in the code.

If the provided join point is a statement (or encapsulated by one) the
code will be inserted after that statement. However, if the join point is a
scope, the code will be inserted at the end of that scope.

Parameters

$jp: stmt|scope - the reference join point for the insertion

declEndMicroSec

declEndMicroSec($jp)

Declares a variable with the value of the microsecond component of the end
point and returns its name. The code insertion is performed after the
provided reference join point.

Parameters

$jp: joinpoint - the reference join point (should not be a scope)

Returns

string - the name of the declared variable

declEndSec

declEndSec($jp)

Declares a variable with the value of the second component of the end point
and returns its name. The code insertion is performed after the provided
reference join point.

Parameters

$jp: joinpoint - the reference join point (should not be a scope)

Returns

string - the name of the declared variable

declMean

declMean($jp)

Declares a variable with the value of the mean component and returns its
name. The code insertion is performed after the provided reference join
point.

Parameters

$jp: joinpoint - the reference join point (should not be a scope)

Returns

string - the name of the declared variable

declStartMicroSec

declStartMicroSec($jp)

Declares a variable with the value of the microsecond component of the start
point and returns its name. The code insertion is performed after the
provided reference join point.

Parameters

$jp: joinpoint - the reference join point (should not be a scope)

Returns

string - the name of the declared variable

declStartSec

declStartSec($jp)

Declares a variable with the value of the second component of the start
point and returns its name. The code insertion is performed after the
provided reference join point.

Parameters

$jp: joinpoint - the reference join point (should not be a scope)

Returns

string - the name of the declared variable

end

end($jp)

Inserts code that ends this collector in the code.

If the provided join point is a statement (or encapsulated by one) the
code will be inserted after that statement. However, if the join point is a
scope, the code will be inserted at the end of that scope.

Parameters

$jp: stmt|scope - the reference join point for the insertion

get

get($jp)

Inserts code that gets the data of this collector in the code.

If the provided join point is a statement (or encapsulated by one) the
code will be inserted after that statement. However, if the join point is a
scope, the code will be inserted at the start of that scope.

Parameters

$jp: stmt|scope - the reference join point for the insertion

getEndMicroSec

getEndMicroSec()

Returns the code needed to get the microsecond component of the end point.


getEndSec

getEndSec()

Returns the code needed to get the second component of the end point.


getMean

getMean()

Returns the code needed to get the mean value component.


getStartMicroSec

getStartMicroSec()

Returns the code needed to get the microsecond component of the start point.


getStartSec

getStartSec()

Returns the code needed to get the second component of the start point.


getvarName

getvarName()

Returns the name of the variable inserted in the code to represent this collector.


init

init(broker, $jp)

Inserts code that initializes this collector in the code.

If the provided join point is a statement (or encapsulated by one) the
code will be inserted after that statement. However, if the join point is a
scope, the code will be inserted at the start of that scope.

Parameters

broker: ExamonBroker - the broker to which the collector will connect
$jp: stmt|scope - the reference join point for the insertion

insertAfter

insertAfter($jp, code)

Utility method that inserts code after the provided reference join point and
guarantees some consistency with the inserts performed by this library.

Parameters

$jp: joinpoint - the reference join point
code: string - the code to be inserted

start

start($jp)

Inserts code that starts this collector in the code.

If the provided join point is a statement (or encapsulated by one) the
code will be inserted after that statement. However, if the join point is a
scope, the code will be inserted at the start of that scope.

Parameters

$jp: stmt|scope - the reference join point for the insertion

ExamonRaw

Constructor

ExamonRaw

new ExamonRaw(name, $scope)

Class that represents a raw connection.

Parameters

name: string - the name of the raw connection
$scope: any

Instance Members

clean

clean($scope)

Parameters

$scope: any

getvarName

getvarName()

init

init(broker, $scope)

Parameters

broker: any
$scope: any

send

send(contents, index, topic, $scope)

Parameters

contents: any
index: any
topic: any
$scope: any

Global Functions

farInsertHelper

farInsertHelper($ref, code, map, beforeMap, start)

Utility method to perform far insertions after the provided reference join
point. Far insertions make sure that the new code that is inserted is as far
from the join point as possible, as opposed to the normal behavior of
insertions.

This method inserts the code after the reference with 2 exceptions.
1) If the reference join point is a return statement, the code will be
inserted before the statement.
2) If the reference join point is a scope, the code will be inserted at the
start or at the end of the scope, according to the value of the start
parameter.

Parameters

$ref: joinpoint - the reference join point
code: string - the code that will be inserted
map: map - map used to control the far insertion
beforeMap: map - map used to control the far insertion of scopes
start: boolean - whether to insert the code at the start (if scope)