Converting non-TS data into TS for evaluation


#1

Hopefully a basic question…

I have a type that is not defined as a time series (it is a “log” type). However it has a numeric value and a timestamp, and I would like to be able to represent that numeric value as a time series. (I want to be able to normalize it to fixed intervals, visualize, etc). Essentially run tsEval on it. Surely there’s a simple trick to do that? :slight_smile:

entity type JobExecutionLog mixes OldContent schema name 'BLKDATIMP_JOBEXCLOG' {
  
  /**
   * When the job processing started.
   */
  start: datetime

  /**
   * When the job processing finished.
   */
  end: datetime

  /**
   * the user id who started the job processing
   */
  user: string

  /**
   * Number of objects updated.
   */
  updatedCount: int

  /**
   * Number of objects created
   */
  createdCount: int
}

#2

@yaroslav you can run Timeseries.fromObjs and pass the spec in. This will need details about the actual objs and the spec to normalize the series


#3

Great. Between this and tsDecl I should be set. I will construct something workable and post here.


#4

@rohit.sureka I poked at this for a bit. Timeseries.fromObjs() works but it executes on the client side (need to pass the actual objs). So if I want to take, say, 1 million rows in the source type, convert to normalized timeseries, then evaluate at DAY grain, I can’t do that - a fetch with 1 million rows will of course kill the browser. Is there a way to perform this server side?

I could wrap it into JS.exec() but even that is not ideal for large data sets.


#5

There is a Timeseries.fromObjStream. You can use that by passing any stream of objs to this