Bulk Updates

Hey Guys,

 

I have been using Jerome's oem_gateway and together with him we are tring to fix a few bugs and enhancements around the buffers. 

We are trying to submit a bulk update for eg.

http://emoncms.org/input/bulk.json?apikey=xxxxxxxxxxxxxxxxx&data=[[-120,69,12],[-100,69,79]]

but it's not inserting the data point at the offset of -120 and -100 instead it inserting the data points at now(). 

I am using timestore, any help would be appreciated

 

https://github.com/Jerome-github/oem_gateway/issues/6

TrystanLea's picture

Re: Bulk Updates

Ahh, the timeoffset should be positive. a valid bulk packet would look like this

[[0,10,1000],[5,10,1000],[10,10,1000],[15,10,1000]]

The server then looks at the last item time: 15s and subtracts this from the current server time.

the first packet would then get entered at:

time() - 15;

the second would be

time - 15 + 5

and so on.

I have been wondering if we change the bulk packet format to actually include the real timestamp as it might simplify bulk data generation and parsing, what do you think?

 

warlock's picture

Re: Bulk Updates

Hey Trystan,

 Still something is not working as expected,

I submitted this

http://emoncms.org/input/bulk.json?apikey=xxx&data=[[10800,69,100],[10805,69,200]]

that should insert data for 2 hours ago, but inserted it as now,

Jérôme's picture

Re: Bulk Updates

http://emoncms.org/input/bulk.json?apikey=xxx&data=[[10800,69,100],[10805,69,200]]

I think this should insert data 10800 seconds (3 hours) in the future, not 2 hours in the past.

warlock's picture

Re: Bulk Updates

i have tried both 

http://emoncms.org/input/bulk.json?apikey=xxx&data=[[10800,69,100],[10805,69,200]]

&

http://emoncms.org/input/bulk.json?apikey=xxx&data=[[-10800,69,100],[-10805,69,200]]

and get the same result, the data is add at the current time point

 

warlock's picture

Re: Bulk Updates

Using the actual timestamp would probably be a good idea

 

warlock's picture

Re: Bulk Updates

So conclusion is that the bulk update is not working as expected, both with negative and positive offsets, 

to avoid confusion I think it would be better to just use a timestamp,  I would love to jump in here and try code this but unfortunately you would not want me touching your code it could be very dangerous.

 

I am very keen to put this to bed as I live in a country "South Africa" where neither the power supply nor the ADSL lines are reliable, we have anyone of them going down temporary of for sustained period at least once to twice a week. For my stats and history is only useful it's it's accurate.

Thanks Trystan and Jerome for all the effort you guys put into this project. 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.