quarks-edge / quarks

Quarks is an open source programming model and runtime for edge devices that enables you to analyze data and events at the device.
http://quarks-edge.github.io/
Apache License 2.0
123 stars 42 forks source link

detecting zero tuples flowing through a stream for the purpose of tagging #100

Open home4slc opened 8 years ago

home4slc commented 8 years ago

I'm writing a sample where I know a stream (Stream) has no tuples, however, it's a rigged example, and I'm trying to demonstrate that there is a way to test for no tuples flowing.

If no tuples are flowing, then I want to tag it in a different way then if tuples are flowing.

I talked with @vdogaru and we got it to the point where if I put a counter on the stream that I suspect has no tuples and then after submitting the topology go through all the counters and look at their values I can see which oplets (counters) have no tuples.

But I can't figure out a way programmatically to test if a stream has no tuples, and if that is the case tag it. Anyone have any thoughts on this?

If not, I will log it as an enhancement. Thanks.

ddebrunner commented 8 years ago

Currently tags are not a runtime concept, but are set at topology declaration time. So I'm not sure if it would be possible to detect no tuples flowing and then dynamically tag it.

ddebrunner commented 8 years ago

Seems like a peek operator with a timed window should be able to detect if no tuples are flowing. It could then set a metric indicating if tuples are flowing or not.