titanfe.apps.brick_runner.metrics module¶
Handle creation of metric data and streaming it to Kafka
-
class
titanfe.apps.brick_runner.metrics.
BrickMetrics
(flow: str = 'FlowName?', brick: str = 'BrickName?', brick_type: str = 'BrickType?', brick_family: str = 'BrickFamily?', runner: str = 'RunnerUid?', host: str = 'build-17650203-project-510666-titanfe', timestamp: str = <factory>, content_type: str = 'titan-brick-metrics', execution_time: float = 0.0)[source]¶ Bases:
titanfe.apps.brick_runner.metrics.MetricsBase
Metric data for brick executions
-
content_type
: str = 'titan-brick-metrics'¶
-
execution_time
: float = 0.0¶
-
-
class
titanfe.apps.brick_runner.metrics.
MetricEmitter
(metrics_metadata, logger)[source]¶ Bases:
object
The MetricEmitter encapsulates creation of metric data and sending them to a Kafka instance
- Parameters
metrics_metadata (dict) – base meta data of metrics emitted
logger (logging.logger) – the parent’s logger instance
-
async classmethod
create_from_brick_runner
(runner) → titanfe.apps.brick_runner.metrics.MetricEmitter[source]¶ Creates, starts and returns a MetricEmitter instance
-
class
titanfe.apps.brick_runner.metrics.
MetricsBase
(flow: str = 'FlowName?', brick: str = 'BrickName?', brick_type: str = 'BrickType?', brick_family: str = 'BrickFamily?', runner: str = 'RunnerUid?', host: str = 'build-17650203-project-510666-titanfe', timestamp: str = <factory>)[source]¶ Bases:
titanfe.utils.DictConvertable
,abc.ABC
Information that every “metric” should contain
-
brick
: str = 'BrickName?'¶
-
brick_family
: str = 'BrickFamily?'¶
-
brick_type
: str = 'BrickType?'¶
-
static
extract_from_runner
(runner)[source]¶ extract the basic information from a brick runner instance
-
flow
: str = 'FlowName?'¶
-
host
: str = 'build-17650203-project-510666-titanfe'¶
-
runner
: str = 'RunnerUid?'¶
-
timestamp
: str¶
-
-
class
titanfe.apps.brick_runner.metrics.
PacketMetricsAtBrick
(flow: str = 'FlowName?', brick: str = 'BrickName?', brick_type: str = 'BrickType?', brick_family: str = 'BrickFamily?', runner: str = 'RunnerUid?', host: str = 'build-17650203-project-510666-titanfe', timestamp: str = <factory>, content_type: str = 'titan-packet-metrics', packet: str = 'PacketUid?', execution_time: float = 0.0, traveling_time: float = 0.0, time_in_input: float = 0.0, time_in_output: float = 0.0, time_on_wire: float = 0.0, at_outlet: bool = False)[source]¶ Bases:
titanfe.apps.brick_runner.metrics.MetricsBase
Metric data for a packet being processed at a Brick
-
at_outlet
: bool = False¶
-
content_type
: str = 'titan-packet-metrics'¶
-
execution_time
: float = 0.0¶
-
packet
: str = 'PacketUid?'¶
-
time_in_input
: float = 0.0¶
-
time_in_output
: float = 0.0¶
-
time_on_wire
: float = 0.0¶
-
traveling_time
: float = 0.0¶
-
-
class
titanfe.apps.brick_runner.metrics.
QueueMetrics
(flow: str = 'FlowName?', brick: str = 'BrickName?', brick_type: str = 'BrickType?', brick_family: str = 'BrickFamily?', runner: str = 'RunnerUid?', host: str = 'build-17650203-project-510666-titanfe', timestamp: str = <factory>, content_type: str = 'titan-queue-metrics', queue_name: str = 'QueueName?', queue_length: int = 0)[source]¶ Bases:
titanfe.apps.brick_runner.metrics.MetricsBase
Metric data for Input/Output-queues
-
content_type
: str = 'titan-queue-metrics'¶
-
queue_length
: int = 0¶
-
queue_name
: str = 'QueueName?'¶
-
-
class
titanfe.apps.brick_runner.metrics.
QueueWithMetrics
(emitter, name, interval=0.1, maxsize=0)[source]¶ Bases:
asyncio.queues.Queue
an ayncio.Queue that emits metrics (queue length)
-
async
put
(item)[source]¶ Put an item into the queue.
Put an item into the queue. If the queue is full, wait until a free slot is available before adding item.
-
property
unfinished_tasks
¶
-
async