Hello All,
I have an issue in understanding how exactly Metric in Visual Builder settings work. The easiest way would be to explain it on an example. Here's my data set:
{
"manufacure_date": "2019-07-01T08:00:00.000Z",
"modifieddate": "2019-07-01T08:58:56.000Z",
"name": "Car1",
"manufactured": 22
"target": 30
"gap": 8
} {
"manufacure_date": "2019-07-01T09:00:00.000Z",
"modifieddate": "2019-07-01T09:56:02.000Z",
"name": "Car1",
"manufactured": 16
"target": 30
"gap": 14
} {
"manufacure_date": "2019-07-01T10:00:00.000Z",
"modifieddate": "2019-07-01T10:27:06.000Z",
"name": "Car1",
"manufactured": 12
"target": 30
"gap": 18
}
Data at source is updated every 3-5 minutes. I run my pipeline every 2 minutes, visualization is refreshed every 60 seconds.
The way we gather data is simple. We take modifieddate
and based on a key, that contains two fields: name
and manufacure_date
we update the following fields: modifieddate
, manufactured
and gap
which is calculated on a query level.
There are three metrics on my visualization: manufactured
, target
and gap
. They are visualized using Metric and Top Hit aggregation method sorted on modifieddate
with size of 1.
Just like that:
Date filter is set to Last 1 hour
. It works just fine, but recently for Gap
I decided to use Visual Builder Metric, as it provides nice possibilities of conditional coloring with custom color pallet. I used the same Top Hit Aggregation, same fields and settings. Details:
Everything works fine during most of the hour, but once full hour passes, Visual Builder Gap changes to 0, while Metric Gap sits with correct value based on Last Hit. Once the new record comes into index (with modifieddate
from same hour as we currently have), VSB Gap shows correct value. I am not sure what might cause that, so if anyone could point me where'd the mistake, I'd appreciate it. I'm quite fresh to VSB so my understanding might be wrong.
Here's a breakdown that might put some light on what happens:
Thanks!
Note: I just changed VSB interval to 1y
. If my understanding is correct, it should work properly except for new eyars eve, 00:00:00