testing
OnDA Test Monitor.
This module contains an OnDA Monitor that can be used for testing.
TestProcessing
Bases: OmProcessingProtocol
See documentation for the __init__
function.
__init__(*, monitor_parameters)
OnDA Test Monitor.
This Processing class implements an OnDA Monitor that can be used for testing purposes. The monitor retrieves data events, but does not process the them. It simply broadcasts the timestamp of each data event to a network socket.
This class implements the interface described by its base Protocol class. Please see the documentation of that class for additional information about the interface.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
monitor_parameters |
MonitorParameters
|
An object storing OM's configuration parameters. |
required |
initialize_processing_node(*, node_rank, node_pool_size)
Initializes the processing nodes for the Test Monitor.
This function does not actually perform any task.
Please see the documentation of the base Protocol class for additional information about this method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_rank |
int
|
The OM rank of the current node, which is an integer that unambiguously identifies the current node in the OM node pool. |
required |
node_pool_size |
int
|
The total number of nodes in the OM pool, including all the processing nodes and the collecting node. |
required |
initialize_collecting_node(*, node_rank, node_pool_size)
Initializes the collecting node for the Test Monitor.
This function simply initializes the some internal counters and prepares a network socket.
Please see the documentation of the base Protocol class for additional information about this method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_rank |
int
|
The OM rank of the current node, which is an integer that unambiguously identifies the current node in the OM node pool. |
required |
node_pool_size |
int
|
The total number of nodes in the OM pool, including all the processing nodes and the collecting node. |
required |
process_data(*, node_rank, node_pool_size, data)
Processes a data event.
This function processes data events but does nothing with them. It simply extracts the timestamp information for each data event.
Please see the documentation of the base Protocol class for additional information about this method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_rank |
int
|
The OM rank of the current node, which is an integer that unambiguously identifies the current node in the OM node pool. |
required |
node_pool_size |
int
|
The total number of nodes in the OM pool, including all the processing nodes and the collecting node. |
required |
data |
Dict[str, Any]
|
A dictionary containing the data that OM retrieved for the detector data frame being processed.
|
required |
Returns:
Type | Description |
---|---|
Tuple[Dict[str, Any], int]
|
A tuple with two entries. The first entry is a dictionary storing the processed data that should be sent to the collecting node. The second entry is the OM rank number of the node that processed the information. |
wait_for_data(*, node_rank, node_pool_size)
Receives and handles requests from external programs.
This function is not used in the Testing Monitor, and therefore does nothing.
Please see the documentation of the base Protocol class for additional information about this method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_rank |
int
|
The OM rank of the current node, which is an integer that unambiguously identifies the current node in the OM node pool. |
required |
node_pool_size |
int
|
The total number of nodes in the OM pool, including all the processing nodes and the collecting node. |
required |
collect_data(*, node_rank, node_pool_size, processed_data)
Computes statistics on aggregated data and broadcasts data to external programs.
This method overrides the corresponding method of the base class: please also refer to the documentation of that class for more information.
This function receives data from the processing node, but does nothing with it. It simply broadcasts the value of an event counter and the timestamp of each received event over a network socket.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_rank |
int
|
The OM rank of the current node, which is an integer that unambiguously identifies the current node in the OM node pool. |
required |
node_pool_size |
int
|
The total number of nodes in the OM pool, including all the processing nodes and the collecting node. |
required |
processed_data |
Tuple[Dict, int]
|
A tuple whose first entry is a dictionary storing the data received from a processing node, and whose second entry is the OM rank number of the node that processed the information. |
required |
end_processing_on_processing_node(*, node_rank, node_pool_size)
Ends processing on the processing nodes for the testing Monitor.
This function prints a message on the console and ends the processing.
Please see the documentation of the base Protocol class for additional information about this method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_rank |
int
|
The OM rank of the current node, which is an integer that unambiguously identifies the current node in the OM node pool. |
required |
node_pool_size |
int
|
The total number of nodes in the OM pool, including all the processing nodes and the collecting node. |
required |
Returns:
Type | Description |
---|---|
Union[Dict[str, Any], None]
|
Usually nothing. Optionally, a dictionary storing information to be sent to the processing node. |
end_processing_on_collecting_node(*, node_rank, node_pool_size)
Ends processing on the collecting node.
This function prints a message on the console and ends the processing.
Please see the documentation of the base Protocol class for additional information about this method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node_rank |
int
|
The OM rank of the current node, which is an integer that unambiguously identifies the current node in the OM node pool. |
required |
node_pool_size |
int
|
The total number of nodes in the OM pool, including all the processing nodes and the collecting node. |
required |