Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example calculating duration of condition and 10 minute aggregates #9

Open
lothar7 opened this issue Feb 25, 2019 · 1 comment
Open

Comments

@lothar7
Copy link

lothar7 commented Feb 25, 2019

It would be nice to see a trill example showing how to one would calculate the duration of a condition and use that for deciding which values should be returned.

Lets say we need to check a stream containing temperature values and if they are above a specified threshold (i.e 70 degrees) for more than 20 minutes, then output a "TEMPERATURE LIMIT EXCEEDED" error value. Once the condition is no longer satisfied, we output a "TEMPERATURE NORMAL" value.

Another great example would be to show a basic 10 minute aggregation calculation that takes values arriving at a few seconds apart(times may vary) and aggregate (SUM or AVERAGE) a single 10 minute value that is outputed every 10 minutes and aligned with the clock. I.e 12:00, 12:10, 12:20 etc..

@cybertyche
Copy link
Contributor

I'm looking into this from the thread on the main Trill repo, but it's a great idea to add it here. As soon as I have something for you, I'll make sure it gets added as a sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants