Skip to content

Runtime

CARET runtime package.

This package provides a set of classes with static (e.g., node names) and dynamic information (e.g., execution times). It has a ROS-friendly class structure that allows application developers to obtain the information they need for evaluation.

Application #

Bases: Summarizable

A class that represents the entire application to be measured.

callback_group_names: list[str] property #

Get callback group names.

Returns:

Type Description
list[str]

All callback group names defined in the architecture.

callback_groups: list[CallbackGroup] property #

Get callback groups.

Returns:

Type Description
list[CallbackGroup]

All callback groups defined in the architecture.

callback_names: list[str] property #

Get callback names.

Returns:

Type Description
list[str]

All callback names defined in the architecture.

callbacks: list[CallbackBase] property #

Get callbacks.

Returns:

Type Description
list[CallbackBase]

All callbacks defined in the architecture.

communications: list[Communication] property #

Get communications.

Returns:

Type Description
list[Communication]

All communications defined in the architecture.

executor_names: list[str] property #

Get executor names.

Returns:

Type Description
list[str]

All executor names defined in the architecture.

executors: list[Executor] property #

Get executors.

Returns:

Type Description
list[Executor]

All executors defined in the architecture.

node_names: list[str] property #

Get node names.

Returns:

Type Description
list[str]

All node names defined in the architecture.

node_paths: list[NodePathStructValue] property #

Get paths.

Returns:

Type Description
list[NodePathStructValue]

app node paths defined in the entire application.

nodes: list[Node] property #

Get nodes.

Returns:

Type Description
list[Node]

All nodes defined in the architecture.

path_names: list[str] property #

Get path names.

Returns:

Type Description
list[str]

App path names defined in the architecture.

paths: list[Path] property #

Get paths.

Returns:

Type Description
list[Path]

All paths defined in the architecture.

publishers: list[Publisher] property #

Get publishers.

Returns:

Type Description
list[Publisher]

All publishers defined in the architecture.

subscriptions: list[Subscription] property #

Get subscriptions.

Returns:

Type Description
list[Subscription]

All subscriptions defined in the architecture.

summary: Summary property #

Get summary [override].

Returns:

Type Description
Summary

Summary info.

topic_names: list[str] property #

Get topic names.

Returns:

Type Description
list[str]

All topic names defined in architecture.

__init__(architecture, infra) #

Construct an instance.

Parameters:

Name Type Description Default
architecture Architecture

Application architecture to be evaluated.

required
infra InfraBase

Measurement results.

required

Raises:

Type Description
UnsupportedTypeError

Occurs when the invalid infra is given.

get_callback(callback_name) #

Get a callback that matches the condition.

Parameters:

Name Type Description Default
callback_name str

callback name to get.

required

Returns:

Type Description
CallbackBase

callback that matches the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_callback_group(callback_group_name) #

Get a callback group that matches the condition.

Parameters:

Name Type Description Default
callback_group_name str

callback group name to get.

required

Returns:

Type Description
CallbackBase

callback group that matches the condition.

Raises:

Type Description
InvalidArgumentError

Given argument type is invalid.

ItemNotFoundError

Failed to find an item that matches the condition.

MultipleItemFoundError

Failed to identify an item that matches the condition.

get_callbacks(*callback_names) #

Get callbacks that match the condition.

Parameters:

Name Type Description Default
*callback_names str

callback names to get.

()

Returns:

Type Description
list[CallbackBase]

callbacks that match the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_communication(publisher_node_name, subscription_node_name, topic_name, *, publisher_construction_order=0, subscription_construction_order=0) #

Get communication that matches the condition.

Parameters:

Name Type Description Default
publisher_node_name str

node name that publishes the topic.

required
subscription_node_name str

node name that subscribes to the topic.

required
topic_name str

topic name.

required
publisher_construction_order int

A construction order of publisher.

0
subscription_construction_order int

A construction order of subscription.

0

Returns:

Type Description
Communication

communication that matches the condition.

Raises:

Type Description
InvalidArgumentError

Given argument type is invalid.

ItemNotFoundError

Failed to find an item that matches the condition.

MultipleItemFoundError

Failed to identify an item that matches the condition.

get_communications(topic_name) #

Get communication that matches the condition.

Parameters:

Name Type Description Default
topic_name str

topic name to get.

required

Returns:

Type Description
list[Communication]

communications that match the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Failed to find an item that matches the condition.

get_executor(executor_name) #

Get an executor that matches the condition.

Parameters:

Name Type Description Default
executor_name str

executor name to get. The name is defined in the architecture file (ex: executor_0).

required

Returns:

Type Description
Executor

executor that matches the condition.

Raises:

Type Description
InvalidArgumentError

Given argument type is invalid.

ItemNotFoundError

Failed to find an item that matches the condition.

get_node(node_name) #

Get a node that matches the condition.

Parameters:

Name Type Description Default
node_name str

node name to get.

required

Returns:

Type Description
Node

A node that matches the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_node_path(node_name, subscribe_topic_name, publish_topic_name, *, subscription_construction_order=0, publisher_construction_order=0) #

Get a node path that matches the condition.

Parameters:

Name Type Description Default
node_name str

node name to get.

required
subscribe_topic_name str

topic name which the node subscribes.

required
publish_topic_name str

topic name which the node publishes.

required
subscription_construction_order int

A construction order of subscription.

0
publisher_construction_order int

A construction order of publisher.

0

Returns:

Type Description
NodePathStructValue

node path that matches the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Occurs when no items were found.

get_node_paths(node_name) #

Get node paths.

Parameters:

Name Type Description Default
node_name str

node name to get.

required

Returns:

Type Description
list[NodePathStructValue]

node paths that match the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

get_path(path_name) #

Get a path that matches the condition.

Parameters:

Name Type Description Default
path_name str

path name to get. paths and their names are defined in the architecture.

required

Returns:

Type Description
Path

A path that matches the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_publishers(topic_name) #

Get publishers that match the condition.

Parameters:

Name Type Description Default
topic_name str

topic name to get.

required

Returns:

Type Description
list[Publisher]

publishers that match the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Failed to find an item that matches the condition.

get_subscriptions(topic_name) #

Get subscriptions that match the condition.

Parameters:

Name Type Description Default
topic_name str

topic name to get.

required

Returns:

Type Description
list[Publisher]

subscriptions that match the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Failed to find an item that matches the condition.

CallbackBase #

Bases: PathBase, Summarizable

A base class that represents callback.

callback_name: str property #

Get callback name defined in the architecture.

Returns:

Type Description
str

callback name defined in architecture.

callback_type: CallbackType property #

Get callback type.

Returns:

Type Description
CallbackType

callback type.

node_name: str property #

Get node name.

Returns:

Type Description
str

node name containing this callback.

publish_topic_names: list[str] | None property #

Get publisher topic names.

Returns:

Type Description
list[str] | None

topic name list to be published by the callback.

publishers: list[Publisher] | None property #

Get publishers.

Returns:

Type Description
list[Publisher] | None

publishers to which the callback publishes.

subscribe_topic_name: str | None property #

Get subscription topic name.

Returns:

Type Description
str | None

topic name to be subscribed by the callback. None except for subscription callback.

subscription: Subscription | None property #

Get subscription.

Returns:

Type Description
Subscription | None

subscription which the callback is attached. None except for subscription callback.

summary: Summary property #

Get summary [override].

Returns:

Type Description
Summary

summary info.

symbol: str property #

Get callback symbol name.

Returns:

Type Description
str

callback function symbol name.

timer: Timer | None property #

Get timer.

Returns:

Type Description
Timer | None

timer which the callback is attached. None except for timer callback.

value: CallbackStructValue property #

Get StructValue object.

Returns:

Type Description
CallbackStructValue

callback group value.

Notes

This property is for CARET debugging purposes.

__init__(info, records_provider, subscription, publishers, timer) #

Construct an instance.

Parameters:

Name Type Description Default
info CallbackStructValue

static info.

required
records_provider RecordsProvider

provider to be evaluated.

required
subscription Subscription | None

None except for subscription callbacks.

required
publishers list[Publisher] | None

publishers to which the callback publishes.

required
timer Timer | None

None except for timer callbacks.

required

CallbackGroup #

Bases: Summarizable

A class that represents the callback group.

callback_group_name: str property #

Get callback group name.

Returns:

Type Description
str

callback group name defined in the architecture.

callback_group_type: CallbackGroupType property #

Get callback_group_type.

Returns:

Name Type Description
CallbackGroupType CallbackGroupType

REENTRANT / MUTUALLY_EXCLUSIVE

callback_group_type_name: str property #

Get callback_group_type name.

Returns:

Type Description
CallbackGroupType name: str

'reentrant' / 'mutually_exclusive'

callbacks: list[CallbackBase] property #

Get callbacks.

Returns:

Type Description
list[CallbackBase]

callbacks which are contained in this callback group.

node_name: str property #

Get node name.

Returns:

Type Description
str

node name which is contained this callback group.

summary: Summary property #

Get summary [override].

Returns:

Type Description
Summary

summary info.

value: CallbackGroupStructValue property #

Get StructValue object.

Returns:

Type Description
CallbackGroupStructValue

callback group value.

Notes

This property is for CARET debugging purposes.

__init__(callback_group_info, callbacks) #

Construct an instance.

Parameters:

Name Type Description Default
callback_group_info CallbackGroupStructValue

static information.

required
callbacks list[CallbackBase]

callbacks to be added to the callback group.

required

get_callback(callback_name) #

Get a callback that matches the condition.

Parameters:

Name Type Description Default
callback_name str

callback name to get.

required

Returns:

Type Description
CallbackBase

callback that matches the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Occurs when no items were found.

get_callbacks(*callback_names) #

Get callbacks that match the condition.

Parameters:

Name Type Description Default
*callback_names str

callback names to get.

()

Returns:

Type Description
list[CallbackBase]

callbacks that match the condition.

Communication #

Bases: PathBase, Summarizable

Class that represents topic communication.

callback_publish: list[CallbackBase] | None property #

Get publisher callback.

Returns:

Type Description
list[CallbackBase] | None

callback which publishes this communication.

callback_subscription: CallbackBase | None property #

Get subscribe callback.

Returns:

Type Description
CallbackBase | None

callback to which subscribe this communication.

is_intra_proc_comm: bool | None property #

Get whether this communication is intra-process-communication.

Returns:

Type Description
bool | None

True when intra-process-communication. otherwise False.

publish_node: Node property #

Get publish node.

Returns:

Type Description
Node

A node that publishes this communication.

publish_node_name: str property #

Get publish node name.

Returns:

Type Description
str

node name which publishes this communication.

publisher: Publisher property #

Get publisher.

Returns:

Type Description
Publisher

publisher to publish this communication.

publisher_construction_order: int | None property #

Get publisher construction order.

Returns:

Type Description
int | None

A construction order of publisher.

rmw_implementation: str | None property #

Get rmw implementation.

Returns:

Type Description
str | None

rmw implementation.

subscribe_node: Node property #

Get subscribe node.

Returns:

Type Description
Node

node to which subscribes this communication.

subscribe_node_name: str property #

Get subscribe node name.

Returns:

Type Description
str

node name which subscribes to this communication.

subscription: Subscription property #

Get subscription.

Returns:

Type Description
Subscription

subscription to subscribe to this communication.

subscription_construction_order: int | None property #

Get subscription construction order.

Returns:

Type Description
int | None

A construction order of subscription.

summary: Summary property #

Get summary [override].

Returns:

Type Description
Summary

summary info.

topic_name: str property #

Get a topic name.

Returns:

Type Description
str

topic name of this communication.

value: CommunicationStructValue property #

Get StructValue object.

Returns:

Type Description
CommunicationStructValue

communication value.

Notes

This property is for CARET debugging purposes.

__init__(node_publish, node_subscription, publisher, subscription, communication_value, records_provider, callbacks_publish, callback_subscription) #

Construct an instance.

Parameters:

Name Type Description Default
node_publish Node

publish node.

required
node_subscription Node

subscribe node

required
publisher Publisher

publisher

required
subscription Subscription

subscription

required
communication_value CommunicationStructValue

static info.

required
records_provider RecordsProvider | RuntimeDataProvider | None

provider to be evaluated.

required
callbacks_publish list[CallbackBase] | None

callbacks publish

required
callback_subscription CallbackBase | None

callback subscription

required

verify() #

Verify whether latency can be generated.

Returns:

Type Description
bool

True if valid. Otherwise False.

Executor #

Bases: Summarizable

Class that represents executor.

callback_group_names: list[str] property #

Get callback group names.

Returns:

Type Description
list[str]

Callback group names added to the executor.

callback_groups: list[CallbackGroup] property #

Get callback groups.

Returns:

Type Description
list[CallbackGroup]

Callback groups added to the executor.

callback_names: list[str] property #

Get callback names.

Returns:

Type Description
list[str]

callback names added to the executor.

callbacks: list[CallbackBase] property #

Get callbacks.

Returns:

Type Description
list[CallbackBase]

Callbacks added to the executor.

executor_name: str property #

Get executor name.

Returns:

Type Description
str

executor name defined in the architecture.

executor_type: ExecutorType property #

Get executor type.

Returns:

Type Description
ExecutorType

executor type.

summary: Summary property #

Get summary [override].

Returns:

Type Description
Summary

summary info.

value: ExecutorStructValue property #

Get StructValue object.

Returns:

Type Description
ExecutorStructValue

executor value.

Notes

This property is for CARET debugging purposes.

__init__(executor_value, callback_groups) #

Construct an instance.

Parameters:

Name Type Description Default
executor_value ExecutorStructValue

Static info.

required
callback_groups list[CallbackGroup]

Callback groups added to the executor.

required

get_callback(callback_name) #

Get callback.

Parameters:

Name Type Description Default
callback_name str

callback name to get.

required

Returns:

Type Description
CallbackBase

callback that matches the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_callback_group(callback_group_name) #

Get callback group.

Parameters:

Name Type Description Default
callback_group_name str

callback group name to get.

required

Returns:

Type Description
CallbackGroup

Callback group that matches the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_callbacks(*callback_names) #

Get callbacks.

Parameters:

Name Type Description Default
*callback_names str

callback names to get.

()

Returns:

Type Description
list[CallbackBase]

callbacks that match the condition.

Node #

Bases: Summarizable

A class that represents a node.

callback_group_names: list[str] | None property #

Get callback group names.

Returns:

Type Description
list[str] | None

callback group names that the node contains.

callback_groups: list[CallbackGroup] | None property #

Get callback groups.

Returns:

Type Description
list[CallbackGroup] | None

callback groups that the node contains.

callback_names: list[str] | None property #

Get callback names.

Returns:

Type Description
list[str] | None

callback names that the node contains.

callbacks: list[CallbackBase] | None property #

Get callbacks.

Returns:

Type Description
list[CallbackBase] | None

callbacks that the node contains.

node_name: str property #

Get node name.

Returns:

Type Description
str

node name.

paths: list[NodePath] property #

Get node paths.

Node paths are defined by subscription and publisher pair.

Returns:

Type Description
list[NodePath]

node paths that the node contains.

publish_topic_names: list[str] property #

Get topic names the node publishes.

Returns:

Type Description
list[str]

topic names that the node publishes to.

publishers: list[Publisher] property #

Get publishers.

Returns:

Type Description
list[Publisher]

publishers used by the node.

subscribe_topic_names: list[str] property #

Get subscribe topic names.

Returns:

Type Description
list[str]

topic names to which the node subscribes.

subscriptions: list[Subscription] property #

Get subscriptions the node subscribes.

Returns:

Type Description
list[Subscription]

subscriptions that the node subscribes to.

summary: Summary property #

Get summary [override].

Returns:

Type Description
Summary

summary info.

timers: list[Timer] property #

Get timers.

Returns:

Type Description
list[Timer]

timers that the node contains.

value: NodeStructValue property #

Get StructValue object.

Returns:

Type Description
NodeStructValue

node value.

Notes

This property is for CARET debugging purposes.

variable_passings: list[VariablePassing] | None property #

Get variable passings.

Returns:

Type Description
list[VariablePassing] | None

Variable passings that the node contains.

__init__(node, publishers, subscription, timers, node_paths, callback_groups, variable_passings) #

Construct an instance.

Parameters:

Name Type Description Default
node NodeStructValue

static info

required
publishers list[Publisher]

publishers in the node.

required
subscription list[Subscription]

subscriptions in the node.

required
timers list[Timer]

timers in the node.

required
node_paths list[NodePath]

node paths in the node.

required
callback_groups list[CallbackGroup] | None

callback groups in the node.

required
variable_passings list[VariablePassing] | None

variable passings in the node.

required

get_callback(callback_name) #

Get callback.

Parameters:

Name Type Description Default
callback_name str

callback name to get.

required

Returns:

Type Description
CallbackBase

callback that matches the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_callback_group(callback_group_name) #

Get callback group.

Parameters:

Name Type Description Default
callback_group_name str

callback group name to get.

required

Returns:

Type Description
CallbackGroup

callback group that matches the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_callbacks(*callback_names) #

Get callbacks.

Parameters:

Name Type Description Default
*callback_names str

callback names to get.

()

Returns:

Type Description
list[CallbackBase]

callbacks that match the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Occurs when no items were found.

get_path(subscribe_topic_name, subscription_construction_order, publish_topic_name, publisher_construction_order) #

Get node path.

Parameters:

Name Type Description Default
subscribe_topic_name str | None

topic name to which the node subscribes.

required
subscription_construction_order int

A construction order of subscription.

required
publish_topic_name str | None

topic name to which the node publishes.

required
publisher_construction_order int

A construction order of publisher.

required

Returns:

Type Description
NodePath

node path that matches the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_publisher(topic_name, construction_order=None) #

Get publisher.

Parameters:

Name Type Description Default
topic_name str

publisher topic name to get.

required
construction_order int | None

construction order to get.

None

Returns:

Type Description
Publisher

A publisher that matches the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

get_subscription(topic_name, construction_order=None) #

Get subscription.

Parameters:

Name Type Description Default
topic_name str

topic name to get.

required
construction_order int | None

construction order to get.

None

Returns:

Type Description
Subscription

Subscription instance that matches the condition.

Raises:

Type Description
InvalidArgumentError

Occurs when the given argument type is invalid.

ItemNotFoundError

Occurs when no items were found.

MultipleItemFoundError

Occurs when several items were found.

NodePath #

Bases: PathBase, Summarizable

A class that represents a path inside a node.

Node path is defined as subscription-publisher pair. subscribe-publish policies are defined as "message context"

callbacks: list[CallbackBase] | None property #

Get callbacks.

Returns:

Type Description
list[CallbackBase] | None

Callbacks in node path. None except for message context is callback chain.

message_context: MessageContext | None property #

Get message context.

Returns:

Type Description
MessageContext | None

message context for this node path.

node_name: str property #

Get node name.

Returns:

Type Description
str

Node name which contains this node path.

publish_topic_name: str | None property #

Get a topic name to publish.

Returns:

Type Description
str | None

topic name to publish.

publisher: Publisher | None property #

Get publisher.

Returns:

Type Description
Publisher | None

node path publisher.

publisher_construction_order: int | None property #

Get a construction order of publisher.

Returns:

Type Description
int | None

construction order of publisher.

subscribe_topic_name: str | None property #

Get a topic name to subscribe to.

Returns:

Type Description
str | None

topic name to subscribe to.

subscription: Subscription | None property #

Get a subscription.

Returns:

Type Description
Subscription | None

subscription to subscribe to.

subscription_construction_order: int | None property #

Get a construction order of subscription.

Returns:

Type Description
int | None

construction order of subscription.

summary: Summary property #

Get summary [override].

Returns:

Type Description
Summary

summary info.

value: NodePathStructValue property #

Get StructValue object.

Returns:

Type Description
NodePathStructValue

node path value.

Notes

This property is for CARET debugging purposes.

__init__(node_path_value, records_provider, subscription, publisher, callbacks) #

Construct an instance.

Parameters:

Name Type Description Default
node_path_value NodePathStructValue

static info.

required
records_provider RecordsProvider

provider to be evaluated.

required
subscription Subscription | None

node path subscription

required
publisher Publisher | None

node path publisher

required
callbacks list[CallbackBase] | None

Callbacks in node path. Needed only if message context is CallbackChain.

required

to_path_beginning_records() #

Calculate records from last callback to publish.

Returns:

Type Description
RecordsInterface

Execution time of each operation.

to_path_end_records() #

Calculate records from last callback_start to callback_end.

Returns:

Type Description
RecordsInterface

Execution time of each operation.

Path #

Bases: PathBase, Summarizable

A class that represents a path.

A single path is composed of node paths and communications.

callback_chain: list[CallbackBase] | None property #

Get callback chain.

Returns:

Type Description
list[CallbackBase] | None

callbacks that compose the path. return None except for all of the node paths are callback chains.

callbacks: list[CallbackBase] property #

Get callbacks.

Returns:

Type Description
list[CallbackBase]

callbacks in all nodes that comprise the node path.

child: list[NodePath | Communication] property #

Get path children.

Returns:

Type Description
list[NodePath | Communication]

node paths and communications in the target path. node paths and communications are alternately contained.

child_names: list[str] property #

Get path children's names.

Returns:

Type Description
list[str]

node names and topic names in the target path.

communications: list[Communication] property #

Get communications.

Returns:

Type Description
list[Communication]

Communications in target path.

node_names: list[str] property #

Get node names.

Returns:

Type Description
list[str]

node names in the target path.

node_paths: list[NodePath] property #

Get node-paths.

Returns:

Type Description
list[NodePath]

node paths in target path.

path_name: str | None property #

Get path name.

Returns:

Type Description
str | None

Path name defined in the architecture.

summary: Summary property #

Get summary [override].

Returns:

Type Description
Summary

summary info.

topic_names: list[str] property #

Get topic names.

Returns:

Type Description
list[str]

topic names in the target path.

value: PathStructValue property #

Get StructValue object.

Returns:

Type Description
PathStructValue

path value.

Notes

This property is for CARET debugging purposes.

__init__(path, child, callbacks, include_first_callback=False, include_last_callback=False) #

Construct an instance.

Parameters:

Name Type Description Default
path PathStructValue

static info

required
child list[NodePath | Communication]

path children's which compose path (node paths and communications).

required
callbacks list[CallbackBase] | None

callbacks that compose the path. return None except for all of node paths are not callback-chain.

required
include_first_callback bool

Flags for including the processing time of the first callback in the path analysis.

False
include_last_callback bool

Flags for including the processing time of the last callback in the path analysis.

False

clear_cache() #

Clear to_records/to_dataframe cache.

verify() #

Verify whether the path can generate latencies.

Returns:

Type Description
bool

True if both architecture and measurement results are valid, otherwise false.

PathBase #

Base class for Latency.

column_names: list[str] property #

Get column names.

Returns:

Type Description
list[str]

column names

to_dataframe(remove_dropped=False, treat_drop_as_delay=False, lstrip_s=0, rstrip_s=0, *, shaper=None) #

Calculate dataframe.

Parameters:

Name Type Description Default
remove_dropped bool

If true, eliminate the records that caused the drop.

False
treat_drop_as_delay bool

Convert dropped records as a delay. Valid only when remove_dropped=false.

False
lstrip_s float

Remove from beginning. [s]

0
rstrip_s float

Remove from end [s]

0
shaper DataFrameShaper | None

shaper

None

Returns:

Type Description
DataFrame

Execution time of each operation.

to_histogram(binsize_ns=1000000, treat_drop_as_delay=False, lstrip_s=0, rstrip_s=0, *, shaper=None) #

Calculate histogram data.

Parameters:

Name Type Description Default
binsize_ns int

bin size for histogram. default 1ms.

1000000
treat_drop_as_delay bool

Convert dropped records as a delay.

False
lstrip_s float

Remove from beginning. [s]

0
rstrip_s float

Remove from end [s]

0
shaper DataFrameShaper | None

shaper

None

Returns:

Type Description
tuple[ndarray, ndarray]

frequency, latency[ns]

len(frequency)+1 == len(latency)

See Also
https://numpy.org/doc/stable/reference/generated/numpy.histogram.html

to_records() #

Calculate records.

Returns:

Type Description
RecordsInterface

Execution time of each operation.

to_timeseries(remove_dropped=False, treat_drop_as_delay=False, lstrip_s=0, rstrip_s=0, *, shaper=None) #

Calculate timeseries data.

Parameters:

Name Type Description Default
remove_dropped bool | None

If true, eliminate the records that caused the drop. default: False.

False
treat_drop_as_delay bool | None

Convert dropped records as a delay. Valid only when remove_dropped=false. default: False.

False
lstrip_s float

Remove from beginning. [s] default: 0

0
rstrip_s float

Remove from end [s] default: 0

0
shaper DataFrameShaper | None

shaper

None

Returns:

Type Description
tuple[ndarray, ndarray]

time[ns], latency[ns] len(time) == len(latency)

Publisher #

Bases: PathBase, Summarizable

Class that represents publisher.

callback_names: list[str] | None property #

Get callback names.

Returns:

Type Description
list[str] | None

Callback names which uses the publisher to publish.

construction_order: int property #

Get a construction order.

Returns:

Type Description
int

A construction order of this publisher.

node_name: str property #

Get node name.

Returns:

Type Description
str

node name which contains the publisher.

qos: Qos | None property #

Get QoS.

Returns:

Type Description
Qos | None

Publisher QoS

summary: Summary property #

Get summary [override].

Returns:

Type Description
Summary

summary info.

topic_name: str property #

Get a topic name.

Returns:

Type Description
str

A topic name that the publisher publishes.

value: PublisherStructValue property #

Get StructValue object.

Returns:

Type Description
PublisherStructValue

publisher value.

Notes

This property is for CARET debugging purposes.

__init__(publisher, provider) #

Construct an instance.

Parameters:

Name Type Description Default
publisher PublisherStructValue

static info.

required
provider RecordsProvider | RuntimeDataProvider

provider to be evaluated.

required

Subscription #

Bases: PathBase, Summarizable

A class that represents subscription.

callback_name: str | None property #

Get a subscription callback name.

Returns:

Type Description
str | None

callback name to which the subscription is attached.

construction_order: int property #

Get a construction order.

Returns:

Type Description
int

A construction order of this subscription.

node_name: str property #

Get node name.

Returns:

Type Description
str

node name to which the subscription subscribes.

qos: Qos | None property #

Get QoS.

Returns:

Type Description
Qos | None

Subscription QoS.

summary: Summary property #

Get summary [override].

Returns:

Type Description
Summary

summary info.

topic_name: str property #

Get a topic name.

Returns:

Type Description
str

A topic name to which the subscription subscribes.

value: SubscriptionStructValue property #

Get StructValue object.

Returns:

Type Description
SubscriptionStructValue

subscription value.

Notes

This property is for CARET debugging purposes.

__init__(val, data_provider) #

Construct an instance.

Parameters:

Name Type Description Default
val SubscriptionStructValue

static info.

required
data_provider RecordsProvider | RuntimeDataProvider

provider to be evaluated.

required

SubscriptionCallback #

Bases: CallbackBase

A class that represents subscription callback.

__init__(callback_info, records_provider, subscription, publishers=None) #

Construct an instance.

Parameters:

Name Type Description Default
callback_info SubscriptionCallbackStructValue

static info.

required
records_provider RecordsProvider

provider to be evaluated.

required
subscription Subscription

subscription to which callback subscribes.

required
publishers list[Publisher] | None

publishers to which the callback publishers

None

Timer #

Bases: PathBase, Summarizable

A class that represents timer.

callback_name: str | None property #

Get callback name.

Returns:

Type Description
str | None

callback name defined in the architecture.

node_name: str property #

Get node name.

Returns:

Type Description
str

node name which defines the timer.

period_ns: int property #

Get timer period.

Returns:

Type Description
int

timer period [ns].

summary: Summary property #

Get summary [override].

Returns:

Type Description
Summary

summary info.

value: TimerStructValue property #

Get StructValue object.

Returns:

Type Description
TimerStructValue

timer value.

Notes

This property is for CARET debugging purposes.

__init__(val, data_provider) #

Construct an instance.

Parameters:

Name Type Description Default
val TimerStructValue

static info.

required
data_provider RecordsProvider | RuntimeDataProvider

provider to be evaluated.

required

TimerCallback #

Bases: CallbackBase

Class that represents timer callback.

period_ns: int property #

Get timer period.

Returns:

Type Description
int

timer period [ns].

__init__(callback, records_provider, publishers, timer) #

Construct an instance.

Parameters:

Name Type Description Default
callback TimerCallbackStructValue

static info.

required
records_provider RecordsProvider

provider to be evaluated.

required
publishers list[Publisher] | None

publishers to which the callback publishers

required
timer Timer

timer

required

VariablePassing #

Bases: PathBase, Summarizable

callback_name_read property #

Get read side callback name.

Returns:

Type Description
[str]

read-side callback name.

callback_name_write: str property #

Get write side callback name.

Returns:

Type Description
[str]

write-side callback name.

node_name: str property #

Get node name.

Returns:

Type Description
str

node name which has the variable passing.

summary: Summary property #

Get summary [override].

Returns:

Type Description
Summary

summary info.

value: VariablePassingStructValue property #

Get StructValue object.

Returns:

Type Description
VariablePassingStructValue

variable passing value.

Notes

This property is for CARET debugging purposes.

__init__(variable_passing, records_provider) #

Construct an instance.

Parameters:

Name Type Description Default
variable_passing VariablePassingStructValue

static info.

required
records_provider RecordsProvider

provider to be evaluated.

required