function getTimeSeries({streamsMetadata = {}, streamNames, streams}) {
  const timeSeries = {
    isLoading: true,
    data: {},
    missingStreams: []
  };
  for (const streamName of streamNames) {
    // ui configuration for this stream
    const streamMetadata = (streamsMetadata && streamsMetadata[streamName]) || {};
    const stream = streams[streamName];
    if (stream) {
      getTimeSeriesForStream(streamName, streamMetadata, stream, timeSeries);
    }
  }

  timeSeries.missingStreams = streamNames.filter(
    streamToDisplay => !timeSeries.data[streamToDisplay]
  );

  return timeSeries;
}
Get the stream time series for the given streams.

If the stream contains multiple time entries the first stream level
entry is use, which should be the entry with the smallest time.

A stream level entry is one with no object_id.

@param streamsMetadata {object} map from stream names to stream metadata
@param streams array of timeSeries streams data. The array contains either
               a single entry or an array of entries
@returns {Array} array of time series data