Class DataExporter

Holoscan v2.1.0
class DataExporter

A base class to support exporting Holoscan application data for Federated Analytics.

This class will create a directory with the application name passed to the constructor. It will also create a subdirectory based on the current timestamp within the application directory.

The root directory for the application data can be specified by using environment variable HOLOSCAN_ANALYTICS_DATA_DIRECTORY. If not specified, it will default to current application directory.

Subclassed by holoscan::CsvDataExporter

Public Functions

explicit DataExporter(const std::string &app_name)

virtual ~DataExporter() = default

virtual void export_data(const std::vector<std::string> &data) = 0

A pure virtual function that needs to be implemented by subclasses to export the data in required format.

Parameters

Data – The data to be written to the CSV file.

inline const std::string &app_name() const

Return the application name.

inline const std::string &data_directory() const

Returns a data directory name.

void cleanup_data_directory()

Remove the data directory and its contents.

Public Static Functions

static expected<std::string, ErrorCode> get_analytics_data_directory_env()

Get the value of analytics data directory environment variable HOLOSCAN_ANALYTICS_DATA_DIRECTORY.

Returns

A string if the environment variable is set else it returns error code.

Protected Attributes

std::string app_name_

std::string directory_name_

Previous Class CudaStreamPool
Next Class DataFlowTracker
© Copyright 2022-2024, NVIDIA. Last updated on Jul 3, 2024.