s-Dashboard Input Overview

s-Dashboard takes streams and views and displays these visually. In order to get the results you want, you need to configure this data, usually at two stages:

  • You first need to use s-Server, sqlline, s-Studio, or StreamLab to configure a stream or view for display. The tutorials in Building Streaming Applications offer suggestions on how to do so. The easiest method is to use StreamLab, but working directly in SQL (using either sqlLine or s-Studio, for example) gives you a wider range of options.
  • Once you have this stream or view established, you select input in s-Dashboard and further configure this input using by setting input preferences. Different display panels have different data needs. Some panels require a key column, for example, while others require numerical data or latitude/longitude.

You select input for each dashboard separately. This means that you can view the same data in multiple ways in two dashboards, view streams or views from two different schemas, or view different streams from the same schema.

This page covers the following subtopics:

Selecting Input

If you are using StreamLab, panels will open automatically with data from StreamLab. You will only need to follow the steps below if you wish to select a different input source.

In other cases, you select an input source: a stream, table, or view from the instance of s-Server that is connected to s-Dashboard.

The first time you do a Select Input, there may be a delay while s-Dashboard retrieves the catalog for s-Server. s-Server's catalog lists all schemas, streams, tables, and views.

If something changes in your s-Server (for example, a new stream is added), you will need to use the Invalidate the Cache command to refresh the catalog*, as described in the topic Invalidating the Cache in this guide.

To select input:

  1. Click the Select Input icon or select Select Input from the s-Dashboard menu.
    The Select Input dialog box opens. Depending on the complexity of s-Server's catalog, you may need to wait for as much as a minute while s-Dashboard retrieves the catalog from s-Server.
  2. Click a stream, table, or view and click Select. The dialog box closes, and the name of the input source appears in place of the Select Input icon.
  3. Click Select. The Select Input dialog box closes and the name of the stream, table, or view appears in the Title Bar.

Configuring Panel Input Preferences

Each panel gets its input from one stream, view, or table. There are separate preferences for how the frame reads its input and for whatever panel is selected.

To set input preferences:

Click the Configure Input Preferences Icon

The Input Preferences dialog box opens.
You can configure input preferences in four main categories:

Once you configure preferences, click Update. You can change preferences at any time.

Configuring Data Windows

The nature of streaming data means that it continually updates. This means that dashboards always display a subset of the data emitted from your source, such as "all failed logins from the last minute" or "all buses speeding over the past hour".

We use the term data window to refer to how s-Dashboard displays data in terms of time. (Some dashboards can only display one row at a time.) The data window can be a fixed number ("20 rows"), a fixed number per category ("20 rows for each department") a fixed time period ("every hour on the hour"), a sliding time period ("all data from the last sixty minutes").

The first thing you want to determine, then, is how you want to configure your data window. (You can always change this by returning to Input Preferences.)

Choose one of the following four options:

Data Window Description
N Rows A specified number of rows. When you choose N Rows, a dialog box appears that lets you enter a number. Very high numbers may affect performance.
N Rows Per Key s-Dashboard lets you use a column to divide your data into categories. This column is called the key column, and can be a list of cities, departments, countries, regions, products, and so on--any category into which your data can be grouped. N Rows Per Key works the same as N Rows, but lets you enter a number per category. When you choose N Rows Per Key, a dialog box appears that lets you enter a number. Very high numbers may affect performance.
Sliding Time Period All streaming rows have a timestamp called ROWTIME. This means that you can tell s-Dashboard "give me all the rows in the past hour" or "give me all the rows in the past minute" and so on. Again, high numbers may affect performance, so experiment accordingly.
Tumbling Time Period This data window also uses ROWTIME, and lets you tell s-Dashboard "give me data for an hour, then clear data, then give me data for the next hour", at, for example, 2:00 PM, 3:00 PM, 4:00 PM, and so on.

Throttling the Input Stream

You can choose to throttle the input stream. Once you select Throttled, a text box appears that allows you to specify a number of rows per second. The default throttled rate is 100 rows per second.

Throttling data for a panel is separate from throttling data in StreamLab. Dashboards pull data directly from s-Server, even if you have set them up through StreamLab. (This is why you can share dashboards independently of StreamLab.)

Working with Key Columns

Some panels let you group data into categories, using a special column called the key column. A key column has a limited set of values that categorize the values in other columns, such as cities, departments, product lines, and so on. You can enter the name of this key column in Input Preferences. You need to generate this column as part of your data before using it in s-Dashboard. You could, for example, use the Categorize Analytic in StreamLab to set up a stream with multiple categories.

The panels in the View Rows Over a Key Column display one row for each category in the key column. For example, you can use the Bars Over Key panel to group a bar chart. The stream below has a key column called "key" that contains a list of cities.

and producing this chart:

Forgetting s-Server Content

The first time you use the Select Input command, s-Dashboard caches the catalog for s-Server. That is, it identifies all schemas, streams, views, and tables. If your development team has added a new schema, stream, table, or view to s-Server, then these objects will not be available in s-Dashboard unless you use the Invalidate Cache command.

The Invalidate Cache command clears the cache of the currently-stored catalog and requests an updated version of the catalog from s-Server.

To do so:

  • Click the s-Dashboard menu icon on the outermost frame.

  • Choose Forget s-Server Contents.

The old catalog is discarded and an updated catalog is retrieved. When you select input, newly added schemas, streams, tables, and views will appear in the Select Input dialog box.

Treating Views as Tables

By default, s-Server assumes views are of streaming data, but they can refer to (foreign) tables. If you know that your view refers to a table, you can use the "Treat View as a Table" option to ask s-Dashboard to treat the view as a table (and therefore check the server less frequently).

Using the SELECT Template Option

By default, the dashboard uses either SELECT * FROM <input> SELECT (if Include ROWTIME is not selected) or SELECT STREAM ROWTIME,* FROM <input> (if Include ROWTIME is selected). You can use the SELECT template field to create a custom SELECT statement. This is an advanced feature that requires knowledge of both SQL and JavaScript to use. See Using the SELECT template in this guide for more details.

Reopening Input

At any time, you can refresh a panel's connection to its input with the Reopen Input command. This command restarts the connection to the stream, view, or table chosen for input.