About sampling

Sampling uses a simple roll-up technique to get large data sets down to a manageable number of points. This improves chart rendering performance and it smooths out the chart data somewhat which can make it easier to interpret.

Rollup (or Rollup Interval) is an interval of time that is used to determine what (and how) data is presented in your chart. The effect is that rollup groups the data into auto-configured intervals. Each point displayed, using the rollup, represents a designated time interval before the specified plot time. This interval is a stat that can be seen in the Settings window Sampling Period property (only visible once sampling has begun).

When the focused point array is larger than 2500, roll-up buckets are created and calculated based on the available time based on total duration/2500. The roll-up amount is rounded up to the next highest time increment. For example, if the calculated roll-up bucket is 2.5 hours, a roll-up bucket of 3 hours is used and the roll up will start at an even increment. So if the first entry is 2:35 am, then the first rollover bucket will be 2:00 and the next bucket will start at 3:00.

Auto-Sampling turns on automatically if the focused data set exceeds 2500 and turns off automatically once the focused data set is below the 2500 threshold.

Sampling is on if the Chart view Sampling command is selected. Alternately, in the settings Sampling tab, you can turn on sampling by disabling Auto Sampling and setting Sampling to true. Additional settings allow you to configure the Facets Limit Mode, Show Start Trend Gaps or hide them, and Show Data Gaps.

Sampling enhancements

In Niagara 4.1 and later, enhancements in sampling protect against an unlimited number of points in a web chart consuming all available memory on the PC. The number of points are configurable with a system.property, as are the limits for when to start auto sampling and when to force auto sampling on.

Data chunking, which is used for all data, accommodates large histories (those exceeding configured size limits) resulting in improved performance. Chunking limits the amount of memory consumed while data is loading. The chart displays once information about the series is received and data displays in the chart as it comes in from a chunked response.

Note too, that an added chart command (in Niagara 4.1 and later) functions as described here:

  • The Stop command (Image), becomes visible only while data is loading. At any point during data loading, you can press the button to stop the chunking process. Press Stop once to halt data coming from the server. While stopped, the button displays a red border. Press Stop a second time to reload the data.
  • Changing the Time Range while the page is loading also triggers the Stop command followed by a page reload.
  • For performance reasons, you cannot turn off sampling once the number of points in the focused data set exceeds 50,000 (or the configured default maxSamplingSize). If you attempt to turn off sampling a popup alerts you that “The chart has too many points (>50,000). Sampling cannot be turned off until the page is focused on fewer points.” You can change the Time Range to focus on fewer points.

The following configurable system.properties (!defaults/system.properties) allow you to fine tune sampling defaults:

  • #niagara.webChart.autoSamplingSize=2500

    This property sets the default auto sampling size. This applies when sampling is turned on to improve web browser interaction.

  • #niagara.webChart.maxSamplingSize=50000

    This sets the default maximum sampling size. When exceeded, sampling cannot be turned off.

  • #niagara.webChart.maxSeriesCapacity=250000

    This sets the maximum capacity for a data series. When the indicated Time Range loads more points than the configured maximum capacity (default=250,000), the Sampling command displays a red border and a popup (shown) alerts you that only the most recent 250,000 points will be shown in the chart.

    Image