Skip To Content

Sample data with GeoEvent Sampler

Real-time data can be received in a number of data formats (text, JSON, GeoJSON, and so on) over many types of protocols (HTTP, WebSocket, TCP, and so on). Validating and exploring event records directly in GeoEvent Manager, before writing those event records to a feature layer for viewing in a web map, for example, can be especially useful. GeoEvent Sampler is a utility in the service designer of GeoEvent Manager that samples a fixed number of event records as they are routed through elements (inputs, outputs, filters, and processors) of a published GeoEvent Service. The sampled event records can be viewed as prettified JSON or delimited text in the sampler window. Sampling event records can provide earlier and greater insight into real-time event data and can assist in designing, validating, and troubleshooting different routes in a GeoEvent Service.

Unlike GeoEvent Logger and GeoEvent Simulator, which are Windows applications installed with GeoEvent Server, GeoEvent Sampler is a utility in the service designer in GeoEvent Manager. You can access GeoEvent Sampler from a new or existing GeoEvent Service by turning on the utility at the bottom of the service designer. The following image and table illustrate and describe the key functionality provided by GeoEvent Sampler:

GeoEvent Sampler utility in the service designer

ParameterDescription

1—Enable and Disable

The Enable and Disable options start and stop GeoEvent Sampler on a selected route between two elements of a published GeoEvent Service. GeoEvent Sampler is disabled by default and must be enabled to sample event records on a selected route.

  • Enable—Event records streaming through a GeoEvent Service display in the sampler window upon selecting a route between elements in a published GeoEvent Service.
  • Disable—Event records streaming through a published GeoEvent Service are not displayed in the sampler window. Existing event records remain in the window until they are manually cleared or the GeoEvent Services page is refreshed. If sampling is disabled, clicking a route in a GeoEvent Service does not display event data.

Learn more about enabling GeoEvent Sampler

2—Select Route

The name of the selected route in a GeoEvent Service. Event data is displayed in the sampler window for the selected route only. Any route between an input, output, filter, or processor element can be selected in a published GeoEvent Service.

The name of the selected route is displayed as the concatenation of the connected element names. Examples of route names are:

  • Input Connector TO Output Connector
  • Field Mapper TO Bearing Calculator
  • Filter “Speed > 80” TO Change_Status_Speeding_Field_Calculator
  • Hurricane_Warning TO Email_FieldCrewA
Note:

The name of the selected route is displayed when GeoEvent Sampler is enabled and a route between two elements in a GeoEvent Service is selected.

3—GeoEvent Sampler utility

Click the arrow to show or hide the GeoEvent Sampler in the service designer. The GeoEvent Sampler utility is shown by default.

4—Refresh

Use Refresh to clear the currently sampled event records and sample another set from the selected route.

After a refresh, another set of event records is sampled up to the value specified in the Sample Size setting. For example, if Sample Size is set to 10 and a refresh occurs, the active event records are cleared and another sample of 10 appears in the sampler window.

If two routes are being compared, clicking Refresh clears event records for each route and each route is sampled again.

Learn more about comparing event records from two routes

5—Clear

Use Clear to remove sampled event records from the sampler window.

After the samples are deleted, event records continue to be sampled from the selected route up to the value specified in the Sample Size setting. For example, if Sample Size is set to 10 and Clear is used after three event records are sampled, the sampler removes the three event records and continues to sample for the remaining seven event records.

If two routes are being compared, Clear is available for each route.

Note:

The option to clear the sampler window or windows is only available after at least one event record is sampled.

6—View in Event Viewer

Use View in Event Viewer to visualize the geometry of the sampled event records in a web map viewer.

The Event Viewer window only displays the geometry of sampled event records currently displayed in the sampler window. When the Event Viewer window is open, no newly sampled event records are displayed. Open the Event Viewer window after the appropriate number of event records are sampled and available in the sampler window.

Note:

You can view sampled event records in the Event Viewer window only when event records have a geometry whose field is tagged GEOMETRY in its GeoEvent Definition. Additionally, sampled event records must be in the JSON data type format. Viewing as text is not supported.

Note:

The Event Viewer basemap can be changed using the basemap selection widget. Additional custom or offline basemaps can be specified in the global settings available in GeoEvent Manager. Custom or offline basemaps are displayed in the basemap selection widget.

7—Copy to Clipboard

Use Copy to Clipboard to copy event records currently displayed in the sampler window to the system clipboard. The copied event records can be pasted to a separate text file or text editor for storage or further review.

If two routes are being compared, Copy to Clipboard is available for each route.

Note:

Event records are copied in the data type format defined in the Data Type setting (either Text or JSON). The data type format can be changed in Settings.

8—Settings

Access the settings for sampling event records, including Data Type and Sample Size.

  • Data Type—Specifies how sampled event records are formatted, either prettified JSON or delimited text. The default is JSON.
  • Sample Size—Specifies the number of event records to sample from a selected route. The sample size can be set to 1, 10, or 100 event records. The default is 10.

9—Sampler window

Event records sampled from a selected route appear in the sampler window.

Sampled event records display as either JSON or text depending on the data type format specified in the Data Type setting.

10—Event counter

The event counter displays the number of event records sampled on a selected route. The number of event records sampled does not exceed the value specified in the Sample Size setting. For example, a count of 3/10 means three event records, out of a maximum of 10, have been sampled.

Note:

The event counter resets to zero when a new route is selected or if sampling is refreshed.

Enable GeoEvent Sampler

Event records can be sampled and displayed in real time from a route (or connection) between an input, output, filter, or processor element in a published GeoEvent Service. To get started with GeoEvent Sampler, open GeoEvent Manager and either create a GeoEvent Service or open an existing GeoEvent Service.

Learn more about creating a GeoEvent Service

To access and enable GeoEvent Sampler in the service designer, complete the following steps:

  1. Open a published GeoEvent Service and ensure that it is receiving event records.
  2. To open GeoEvent Sampler, click at the bottom of the service designer.
  3. Click settings to open the Settings pane for GeoEvent Sampler and specify the Data Type and Sample Size values.

    The default data type is JSON and the default sample size is 10.

  4. Click Enable to start GeoEvent Sampler.
Note:

You can also start GeoEvent Sampler by right-clicking a route between two elements in a published GeoEvent Service and choosing Sample Route. GeoEvent Sampler opens and sampling of event records begins on the selected route.

Sample event records

To sample event records, choose a route between an input, output, filter, or processor element while GeoEvent Sampler is open and enabled.

To sample event records from a route in a GeoEvent Service, create a GeoEvent Service or open an existing published GeoEvent Service, ensure that it is actively receiving event records, and complete the following steps:

  1. Ensure that GeoEvent Sampler is open in the service designer and is enabled.
  2. Click a route in the published GeoEvent Service to begin sampling event records on that route.

    Example selected route in a GeoEvent Service

  3. Note:

    You can also start GeoEvent Sampler by right-clicking a route and choosing Sample Route from the menu. GeoEvent Sampler opens, is enabled, and begins sampling event records from the selected route.

    As real-time data flows through a GeoEvent Service, the sampler window displays a sample of event records from the selected route as they are processed. The sampled event records are displayed as text or JSON depending on the data format type specified in the Data Type setting. The total number of sampled event records displayed depends on the Sample Size value. The number of event records sampled is shown in the events sampled counter.
  4. Click Copy to Clipboard to copy the active sample of event records from the sampler window.
  5. Click Clear to remove the active sample of event records from the sampler window.
  6. Click Refresh to sample the selected route again.

Visualize sampled event records

The primary purpose of GeoEvent Sampler is to provide a sample of event records as text or JSON in real time as they are processed in a published GeoEvent Service. GeoEvent Sampler includes Event Viewer, which is a web map viewer that can be used to visualize and verify the geometry of processed event records.

To visualize sampled event records in the Event Viewer window, create a GeoEvent Service or open an existing, published GeoEvent Service, ensure that it is actively receiving event records, and complete the following steps:

  1. Ensure that GeoEvent Sampler is open in the service designer and is enabled.
  2. Click settings and ensure that Data Type is set to JSON.
  3. Click a route in the published GeoEvent Service to begin sampling event records on the selected route.
  4. Note:

    Right-click a route and from the menu, choose Sample Route to begin sampling event records.

  5. After a sample of event records is displayed as JSON in the sampler window, click View in Event Viewer View in Event Viewer to view event records in the Event Viewer window.
  6. Note:

    Event Viewer only supports sampling JSON formatted event records that contain a geometry field tagged as GEOMETRY in the corresponding GeoEvent Definition. If the sampled event records are formatted as text and do not have a GEOMETRY field, the View in Event Viewer button is unavailable.

  7. Explore the sampled event records in the Event Viewer window.

    Event records viewed in the Event Viewer

  8. Event Viewer only displays the active set of sampled event records. To display another set of sampled event records, close the Event Viewer window, click Refresh, and click View in Event Viewer again.
  9. In the Event Viewer window, click an event record.

    A pop-up appears with the attribute information.

    Event record attribute data viewed in a pop-up in the Event Viewer window

Compare event records from two routes

You can perform event records sampling on two routes at the same time. Sampling two routes can be useful to compare and validate changes on related real-time data. For example, an event record emitted by a buffer creator processor can be expected to have a different geometry (polygon) from its original source geometry (point). By sampling event records from the routes going to and from the processor, you can ensure that event records are not only received by the buffer creator processor, they are buffered by the processor as well.

To compare sampled event records from two routes, create a GeoEvent Service or open an existing, published GeoEvent Service, ensure that it is actively receiving event records, and complete the following steps:

  1. Ensure that GeoEvent Sampler is open in the service designer and is enabled.
  2. Click a route in a GeoEvent Service to begin sampling event records on the first selected route.

    First route selected in an example GeoEvent Service

    Note:

    Right-click a route and from the menu, choose Sample Route to start sampling the first route.

  3. With the first route selected, right-click a second route and choose Compare Route.

    Second route selected in an example GeoEvent Service

    Note:
    Compare Route is only available once the first route is selected. Routes sharing the same source element—whether an input, output, filter, or processor—cannot be compared.

    The second selected route is a different color (orange), indicating that an event record sampling is performed on the two selected routes.

    Example of two selected routes in a GeoEvent Service

    With the two routes selected, two sampler windows appear in GeoEvent Sampler, allowing you to compare the two routes. The sampler window (blue) returns the sampled event records from the first selected route, and the window (orange) returns the sampled event records from the second selected route.

    Sampler window comparing two selected routes

    Event record sampling can only be performed on one or two routes. When comparing two routes, changing the settings, refreshing, and opening the Event Viewer window applies to both sampler windows. Clearing and copying the data to the clipboard can be done independently and apply to the sampler window where the tool is used.

  4. Click to view event records from each route in the Event Viewer window.

    Viewing two compared routes in the Event Viewer window

    Event Viewer opens a viewer for each selected route. This can be useful to validate geometry changes when performing event processing. For example, original point geometry from an event record can be visualized in the first viewer while the same event record emitted from a buffer creator processor, for example, can be visualized in the second viewer. This allows you to ensure the original point geometry was buffered successfully and is now a polygon. Use the lock widget to synchronise each of the viewers and ensure you are looking at the same geographic area for geometric changes.

Considerations and limitations

Keep the following in mind when using GeoEvent Sampler:

  • Event records are only sampled when a GeoEvent Service is published, started, and is actively receiving real-time event data. Nothing appears in the sampler window if the GeoEvent Service is not published or is stopped, or no event data is being received.
  • GeoEvent Sampler can be used to perform sampling on the routes connecting inputs, outputs, processors, and filters only. Direct sampling of inputs, outputs, processors, and filter elements is not supported.
  • Consider your real-time data and service design when sampling event records.
  • GeoEvent Sampler automatically disconnects and is unavailable after 10 minutes of inactivity.
  • GeoEvent Sampler only supports the comparison of two routes between elements of a GeoEvent Service.
  • The order of event records sampled is not guaranteed. The order in which event records are collected into GeoEvent Server may not be the same order in which they appear in the sampler window.
  • Sampled event records are not persisted or cached. Refreshing the sampler window or the browser session removes currently sampled event records.
  • Changing the GeoEvent Sampler settings requires a refresh. If the settings are changed during an active sampling of event records, the new settings do not take effect until GeoEvent Sampler is refreshed.
  • When comparing two routes, the first sampler window may reach its sample size before the second sampler window displays any event records. In this case, the route may not have met a filter or processing condition and is not being received.
  • The sampler window displays a progress bar when waiting to receive the first event record.
  • Viewing event records in the Event Viewer window is supported in offline environments. Access the global settings to configure Event Viewer with a basemap that is accessible offline.