Operator PrintWithTimeIntervals

Toolkits > com.ibm.streamsx.topology.pysamples 1.1.0 > com.ibm.streamsx.topology.pysamples.positional > PrintWithTimeIntervals

Print tuples with inter-tuple arrival delay.

Python

@spl.for_each()
class PrintWithTimeIntervals(object):
    "Print tuples with inter-tuple arrival delay."
    def __init__(self):
        self.last = datetime.now()

    def __call__(self, *tuple_):
        now = datetime.now()
        iat = now - self.last
        self.last = now
        print(tuple_, " ", iat, " seconds", flush=True)

Summary

Ports
This operator has 1 input port and 0 output ports.
Windowing
This operator does not accept any windowing configurations.
Parameters
This operator does not support parameters.
Metrics
This operator does not report any metrics.

Properties

Implementation
C++
Threading
Always - Operator always provides a single threaded execution context.

Input Ports

Ports (0)

__SPLPY__INPORT_0__DESCRIPTION__SPLPY__

Properties

Libraries

SPLPY header
Include Path: ../../opt/.splpy/include
Python libraries.
Command: ../../opt/.splpy/common/pyversion3.sh