History and charts

Automatic tag history and charting.

The camera keeps its own history for every tag in use. Charts on the overlay and the history in the DataBorder therefore need no server, no historian and no database anywhere else.

Stored data

Measurements are kept in three tiers of buckets. Each tier has a fixed number of slots.

TierPeriod covered
One sample every 10 secondsThe last hour
One sample every minuteThe last day
One sample every 10 minutesThe last week

Each bucket keeps the minimum, the maximum, the last value and the average for its slot. A chart uses the finest tier that covers its window.

One sample every 10 seconds360 buckets · 13% of the block · the last hourOne sample every minute1,440 buckets · 51% of the block · the last dayOne sample every 10 minutes1,008 buckets · 36% of the block · the last weekONE MEASUREMENT TAG · 90 KB, ALLOCATED ONCEWithin a band the squares run oldest to newest. When a band is full the oldestbucket is overwritten, so the block never grows.
Bucket average low to high Each square keeps a minimum, a maximum, a last value and an average.
The memory one measurement tag reserves, cut into the three tiers. One square is one bucket, so each band's area is its share of the block. Sample values.

State tags are kept as a log of transitions, up to ten thousand of them, together with hourly totals of the time spent in each state over the last week. The state strip, the donut, the state table and the hourly bars all draw from this log.

Strings are kept as a log of changes, up to a thousand entries.

State tag · Welder 3 state10,000 entries
#enteredstate held0Mon 05:58:12.340Idle0:31:48oldest1Mon 06:30:00.115Running1:42:062Mon 08:12:06.402Blocked0:04:123Mon 08:16:18.610Running2:11:574Mon 10:28:16.077Down0:18:33⋮  9,993 entries not shown9,998Sun 22:58:41.902Blocked0:01:079,999Sun 22:59:48.335Runningstill opennewest

When the next transition arrives, entry 0 is dropped and the rest shift down.

Hourly totals per state, from the same log168 bars · one per hour
MonTueWedThuFriSatSun60 min0

One bar is one hour, so every bar is full height.

String tag · Body VIN1,000 entries
#changedvalue held0Mon 06:31:11.204TMBJJ7NE5J01421180:02:36oldest1Mon 06:33:47.905TMBJJ7NE5J01421190:02:352Mon 06:36:22.417TMBJJ7NE5J01421200:02:41⋮  995 entries not shown998Sun 21:04:38.220TMBJJ7NE7K01438840:03:14999Sun 21:07:52.641TMBJJ7NE7K0143885still opennewest
running blocked idle down
The two logs and the hourly totals they feed. Sample entries from a welding line.

Fixed size allocation

Each measurement tag takes about 90 kilobytes of memory, which is allocated once. The history never grows beyond that. When a tier is full, the oldest bucket is overwritten. A camera with a few dozen tags in use keeps a week of history comfortably.

Stored tags

Only tags in use are polled and stored. A tag is in use when it is on the overlay, in the DataBorder, or feeding a derived state. When a tag stops being used, its history is kept for six hours in case you are rearranging the layout, and then dropped. A tag that is deleted from the library is dropped immediately.

Surviving restarts

Closed hours and closed days are written to the camera's flash memory as read-only segments, once each. The open hour and the state and string logs are written every 30 minutes and on a clean shutdown, and only when something has changed. After a restart, the minute and 10-minute tiers are restored from flash, and the 10-second tier refills within the hour.

The Stored data panel shows how full each tier is for every tag, when the history was last saved, and how much memory and flash it uses. See Status and troubleshooting.

Chart windows

Chart and state elements draw over a window that is chosen per element.

  • A rolling window covers the last 15 minutes, hour, 8 hours, day or week, and always ends now.
  • An anchored window covers this hour, this shift or today. It starts empty at the boundary and fills in. Shift boundaries are the start times you set under Settings → Shifts.

The time axis can show wall-clock times at the ends of the window, or offsets from now.

Full history in the DataBorder

The DataBorder can carry the last 24 hours of state runs, so that a decoded clip starts with context. It can also cycle the camera's full stored history, so that a longer clip reconstructs the charts above from the video alone. Both are options on the DataBorder page.