Number of points in a timeseries


#1

Hi all

I’m trying to build a metric whose returned timeseries is filled by the number of seconds for the given interval. So I will have a only-one value timeseries.

I’m able to get the desidered grain with the eval function.
E.g.:

    {
          "id": "SecondStep",
          "name": "SecondStep",
          "srcType": {
            "moduleName": "structure",
            "typeName": "ServicePoint"
          },
          "expression": "sum(eval('SECOND', sum(1)))",
          "path": "",
          "description": ""
    }

Is there a way to aggregate the expression above over space-time?

Annidating sum+eval seems to have no effect.
nor “expression”: “sum(eval(‘SECOND’, sum(sum(1))))” has effect…

As alternative I can multiply the values obtained with the expression above by the number of points in the timeseries.

In this case is there a way to have the number of points in a time series?

TS.count() returns always 0
length(TS) returns always 2


#2

I’ve found a ugly solution to my issue but still can’t find out how to know the lenght of the timeseries:

{
      "id": "SecondStep",
      "name": "SecondStep",
      "srcType": {
        "moduleName": "structure",
        "typeName": "ServicePoint"
      },
      "expression": "aggregate((end() - start())/1000, 'SUM')",
      "description": "Number of seconds in the input interval"
}

#3

Can you describe the actual use case? What are you planning to use this time series for?