Contents

DiscoverHistory Tool

You can get history metadata and images from the DataStore container using the DiscoverHistory tool.

Build and Run the DiscoverHistory Tool

This section provides information for building and running DiscoverHistory tool in various modes such as the PROD mode and the DEV mode.

Prerequisites

As a prerequisite to run the DiscoverHistory tool, a set of config, interfaces, public, and private keys should be present in ETCD. To meet the prerequisite, ensure that an entry for the DiscoverHistory tool with its relative path from the [WORK_DIR]/IEdgeInsights] directory is set in the video-streaming-storage.yml file in the [WORK_DIR]/IEdgeInsights/build/usecases/ directory. For more information, see the following example:

AppContexts:
- ConfigMgrAgent
- VideoIngestion
- VideoAnalytics
- Visualizer/multimodal-data-visualization-streaming/eii
- Visualizer/multimodal-data-visualization/eii
- tools/DiscoverHistory
- DataStore

Run the DiscoverHistory Tool in the PROD mode

After completing the prerequisites, perform the following steps to run the DiscoverHistory tool in the PROD mode:

  1. Open the config.json file.

#. Enter the query for DataStore influxdb. #.

Run the following command to generate the new docker-compose.yml that includes DiscoverHistory:

python3 builder.py -f usecases/video-streaming-storage.yml
  1. Provision, build, and run the DiscoverHistory tool along with the EII video-streaming-storage recipe or stack. For more information, refer to the EII README.

  2. Check if the ia_datastore service is running.

  3. Locate the data and the frames directories from the following path: /opt/intel/eii/tools_output. ..

    Note: The frames directory will be created only if img_handle is part of the select statement. If frames directory is not created, restarting the DiscoverHistory service would help to create it as the dependent services would have come up by then.

#. Use the ETCDUI to change the query in the configuration. #.

Run the following command to start the container with new configuration:

docker restart ia_discover_history

Run the DiscoverHistory Tool in the DEV Mode

After completing the prerequisites, perform the following steps to run the DiscoverHistory tool in the DEV mode:

  1. Open the [.env] file from the [WORK_DIR]/IEdgeInsights/build directory.

  2. Set the DEV_MODE variable as true.

Run the DiscoverHistory Tool in the zmq_ipc Mode

After completing the prerequisites, to run the DiscoverHistory tool in the zmq_ipc mode, modify the interface section of the config.json file as follows:

{
    "type": "zmq_ipc",
    "EndPoint": "/EII/sockets"
}

Sample Select Queries

The following table shows the samples for the select queries and its details:

Note

Include the following parameters in the query to get the good and the bad frames:

  • *img_handle

  • *defects

  • *encoding_level

  • *encoding_type

  • *height

  • *width

  • *channel

The following examples shows how to include the parameters:

  • “select img_handle, defects, encoding_level, encoding_type, height, width, channel from camera1_stream_results order by desc limit 10”

  • “select * from camera1_stream_results order by desc limit 10”

Multi-instance Feature Support for the Builder Script with the DiscoverHistory Tool

The multi-instance feature support of the Builder works only for the video pipeline ([WORK_DIR]/IEdgeInsights/build/usecase/video-streaming.yml). For more details, refer to the EII core Readme

In the following example, you can view how to change the configuration to use the builder.py script -v 2 feature with 2 instances of the DiscoverHistory tool enabled:

DiscoverHistory instance 1 interfaces DiscoverHistory instance 2 interfaces