Can you also look at the timestamp processing?
ref Best way to guarantee times when using BULK load with PHPTIMESERIES? - #2 by pb66
Personally I would like to see the legacy mode updated to be “absolute” so that omitting a “mode” means the supplied timestamps are used without adjustment. The only alternative would seem to be adding “&time=0” to the end of each request (minor, but annoyingly pointless if we are trying to make the bulk upload as minimal as possible). The current “&sentat=” is open to potential errors.
perhaps we could change these lines
// Legacy mode: input/bulk.json?data=[[0,16,1137],[2,17,1437,3164],[4,19,1412,3077]]
else {
$time_ref = time() - (int) $data[$len-1][0];
}
to something like
// Legacy mode: input/bulk.json?data=[[0,16,1137],[2,17,1437,3164],[4,19,1412,3077]]
elseif ((int) $data[$len-1][0] <1000000000);
{
$time_ref = time() - (int) $data[$len-1][0];
}
// New default "absolute" timestamp mode: input/bulk.json?data=[[1519749672,16,1137],[1519749682,16,1437,3164],[1519749692,16,1412,3077]]
else
{
$time_ref = 0;
}
by checking if the timestamp of the last packet is in the range of a complete unix timestamp or just an offset, we could set the timeref to 0 if absolute timestamps are used.