Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
344 views
in Technique[技术] by (71.8m points)

batching elements with different timestamps in TimeStream

I've 2-3 hours of TimeStream experience.

I have a lot of small records (timestamp + 2 floats) that are coming quite fast (roughly every 10ms).

How can I batch these so I can send them every 2-3 seconds?

For example, I have data like this:

{
    t: timestamp
    a: float
    b: float
}

From what I understand you have records which are essentially a name / data / type value with optionally a timestamp.

so I can do represent one data set like this (kinda pseudo code):

t = record ( time = t )
a = record ( name=a, value=3 )
b = record ( name=b, value=2 )

and then do the write request like that:

writeRequest = ( commonAttribute = t, records = [a, b] )

but that means I have one write request for 2 floats + a timestamp

with about 100 of them per second, I would have to batch the write requests so I send the data every few seconds; how can this be done? I can't find this in the docs.

I understand that I can group many values under one timestamp, but I'm trying to find how to send many groups of values + a timestamp

question from:https://stackoverflow.com/questions/65946716/batching-elements-with-different-timestamps-in-timestream

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...