Fork me on GitHub


The time period for which a boolean stream is true before turning false

The time that a stream spends in the true state. This transform uses the timestamp, so the timestamp is displayed in the sequence:

    {"t": 1, "d": true},
    {"t": 2, "d": true},
    {"t": 4, "d": true},
    {"t": 5, "d": false},
    {"t": 6, "d": false},
    {"t": 7, "d": true},
    {"t": 8, "d": false},
    {"t": 9, "d": true}

Given the above data, we can get the following:

    {"t": 5, "d": 4},
    {"t": 8, "d": 1}

The stream was true from timestamp 1 to 5, when it changed to false. So the total time the stream was true was 4 seconds. The stream then turned true at timestamp 7, and turned false at timestamp 8, meaning that it was true for 1 second. Finally, the stream turned true at timestamp 9, but we don’t know how long it was true, so ttrue does not return anything for this final part.

Transform Details

One-To-OneStatelessPeekInput SchemaOutput Schema

This Site


ConnectorDB is a very new open-source project. If you are a designer/developer or ML enthusiast, head on over to the connectordb github, where you can choose which part of ConnectorDB you want to contribute towards! Pull requests or bug reports are welcome!