KsqlDB HOPPING window retention doesn't work - ksqldb

I am using ksqlDB version 0.14.0-rc732.
Declared a query :
CREATE TABLE LIVE_TRAFFIC AS
select
devicemac,
sum(traffic -> bytesIn) AS bytes_in,
sum(traffic -> bytesOut) AS bytes_out
from FLAT_TRAFFIC
WINDOW HOPPING (SIZE 1 MINUTES, ADVANCE BY 1 MINUTES, RETENTION 15 MINUTES, GRACE PERIOD 1 MINUTES)
GROUP by devicemac;
But the 15 min defined retention doesn't work.
Rows are being added to the table.

Related

InfluxQL time calculations return no records

I'd like to query InfluxDB using InfluxQL and exclude any rows from 0 to 5 minutes after the hour.
Seems pretty easy to do using the time field (the number of nanoseconds since the epoch) and a little modulus math. But the problem is that any WHERE clause with even the simplest calculation on time returns zero records.
How can I get what I need if I can't perform calculations on time? How can I exclude any rows from 0 to 5 minutes after the hour?
# Returns 10 records
SELECT * FROM "telegraf"."autogen"."processes" WHERE time > 0 LIMIT 10
# Returns 0 records
SELECT * FROM "telegraf"."autogen"."processes" WHERE (time/1) > 0 LIMIT 10

Relative/Dynamic lookback time for alerts in InfuxDB

I am sending events to InfluxDB which are timestamped. These are basically events to external service. I wanted to set an alert which would execute if the count of such events from 12 AM today to now() extends a certain number, an alert should be raised.
I have checked out Influx but it seems that you can lookback only some constant time such as 5 mins, 10 mins, 1 hr, 12 hr, 1 day etc from now(). But for me the lookback is dynamic.
Please help with some pointers to achieve this.

How to trigger esper as soon as the number of events exceed a threshold within time interval

I'd like to trigger esper as soon as it receives X number of events during an interval of Y minutes. I used this query but it triggers esper only 5 minutes after having received the first event and only if it's more then 10:
select count(*) as total
from report.win:time_batch(5 minutes)
where type = 'test_type'
having count(*) >= 10
I'd like to trigger it as soon as it gets 10 messages and of course, it should evaluate an interval of 5 minutes. I do not want to trigger it if, for instance, it receives 1 event every 10 minutes.
Any ideas?
Thanks!
select count(*) as total
from report(type = 'test_type')#time(5 minutes)
having count(*) >= 10
Above query outputs a row each time count 10 or more considering 5 minutes sliding. Add for example "output first every 1 minute" if the desired output is just once every X minutes.

Delete points between hours in InfluxDB

I have a measurement that stores prices for every 10 seconds (their seconds last with 0-10-20-30-40-50).
I would like to delete old points (older than 1 year) to keep only prices every hour.
How to get these candidates?
You can achieve this with Retention Policy + Continuous Query:
CREATE RETENTION POLICY "one_year" ON "database_name" DURATION 52w REPLICATION 1 DEFAULT
autogen RP has an infinite retention duration:
CREATE CONTINUOUS QUERY "aggregate_prices" ON "database_name"
BEGIN
SELECT mean("value")
INTO "autogen"."prices"
FROM "prices"
GROUP BY time(1h)
END

Jenkins polled repository once then never again, though 1 minute interval is set

I've set up a Jenkins job and set the poll interval at 1 minute (I used this syntax 0 * * * *).
Looking in the Polling log I can see its reported that a poll call was made as soon as I saved the changes to the job.
But not over 10 minutes later it hasn't made any other polls.
Any suggestions how I can proceed determining the problem?
You're looking for "* * * * *".
Jenkins gives a warning since every minute can be a bit excessive, but your version control server shouldn't have any problems handling the load.
Your cron syntax is set to poll once per hour, at zero minutes past the hour. From the Jenkins help text:
This field follows the syntax of cron (with minor differences). Specifically, each line consists of 5 fields separated by TAB or whitespace:
MINUTE HOUR DOM MONTH DOW
MINUTE Minutes within the hour (0-59)
HOUR The hour of the day (0-23)
DOM The day of the month (1-31)
MONTH The month (1-12)
DOW The day of the week (0-7) where 0 and 7 are Sunday.

Resources