influxdb 1.1, kapacitor 1.1

I'm trying to capture counts in another measurement.  I have this script

---------------------------------
ID: task_rates
Error: 
Template: 
Type: batch
Status: enabled
Executing: true
Created: 19 Nov 16 06:30 CST
Modified: 19 Nov 16 08:15 CST
LastEnabled: 19 Nov 16 08:15 CST
Databases Retention Policies: ["metrics"."days30"]
TICKscript:
// go back in time
var myperiod = 60m

// group by time
var mytime = 60m

// sample every time
var myevery = 1m

// Task type
// measurement to put the results
var mymeasurement = 'taskRates'

// purposely forcing batch to return 0 records, this easily will duplicate the 
problem
var success = batch
    |query(' SELECT count(jobRunTime) FROM "metrics"."days30"."tasks" where  
"status" = \'FINISHED1\' ')
        .period(myperiod)
        .every(myevery)
        .groupBy(time(mytime), 'id', 'serverID', 'taskType', 'component')
        .align()
        .fill(0)

// Get views total
var total = batch
    |query('SELECT count(jobRunTime) FROM "metrics"."days30"."tasks" where  
("status"=\'FINISHED\' or "status"=\'ERROR\') ')
        .period(myperiod)
        .every(myevery)
        .groupBy(time(mytime), 'id', 'serverID', 'taskType', 'component')
        .align()
        .fill(0)

// Join success and total
success
    |join(total)
        .as('success', 'total')
        .tolerance(60s)
        .fill(0)
    |eval(lambda: "success.count", lambda: "total.count")
        // Give the resulting field a name
        .as('success', 'total')
    |influxDBOut()
        .database('metrics')
        .measurement(mymeasurement)

DOT:
digraph task_rates {
graph [throughput="0.00 batches/s"];

query2 [avg_exec_time_ns="0s" batches_queried="80" points_queried="160" 
query_errors="0" ];
query2 -> join4 [processed="80"];

query1 [avg_exec_time_ns="0s" batches_queried="0" points_queried="0" 
query_errors="0" ];
query1 -> join4 [processed="0"];

join4 [avg_exec_time_ns="40.52µs" ];
join4 -> eval5 [processed="0"];

eval5 [avg_exec_time_ns="0s" eval_errors="0" ];
eval5 -> influxdb_out6 [processed="0"];

influxdb_out6 [avg_exec_time_ns="0s" points_written="0" write_errors="0" ];
}

---------------------------------

the problem is if query1 doesn't return any rows, I don't get any records in my 
measurement.

What did I do wrong?




-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/2a57d322-f1eb-454b-be80-8f55c842df19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to