holoscan::DataExporter

Beta
View as Markdown

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.

#include <holoscan/data_exporter.hpp>

Constructors

DataExporter

holoscan::DataExporter::DataExporter(
const std::string &app_name
)

Destructor

~DataExporter

virtual holoscan::DataExporter::~DataExporter() = default

Methods

export_data

virtual void holoscan::DataExporter::export_data(
const std::vector<std::string> &data
)

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

Parameters

data
const std::vector<std::string> &

The data to be written to the CSV file.

app_name

const std::string & holoscan::DataExporter::app_name() const

Return the application name.

data_directory

const std::string & holoscan::DataExporter::data_directory() const

Returns a data directory name.

cleanup_data_directory

void holoscan::DataExporter::cleanup_data_directory()

Remove the data directory and its contents.

create_data_directory_with_timestamp

void holoscan::DataExporter::create_data_directory_with_timestamp()

Create a data directory with the current timestamp inside the application directory.


Static methods

get_analytics_data_directory_env

static expected<std::string, ErrorCode> holoscan::DataExporter::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.


Member variables

NameTypeDescription
app_name_std::string
directory_name_std::string