Class DiskMonitor

Inheritance Relationships

Base Type

  • public ska::pst::common::ApplicationManager

Class Documentation

class DiskMonitor : public ska::pst::common::ApplicationManager

Monitors the disk system used for file writing.

Public Functions

DiskMonitor(std::string recording_path)

Construct a new Disk Monitor object.

Parameters

recording_path – file system to be monitored

~DiskMonitor()

Destroy the DiskMonitor object.

void validate_configure_beam(const ska::pst::common::AsciiHeader &config, ska::pst::common::ValidationContext *context)

Configure beam as described by the configuration parameters.

Parameters
  • config – beam configuration containing the recording path, data and weights key

  • context – A validation context where errors should be added.

void validate_configure_scan(const ska::pst::common::AsciiHeader &config, ska::pst::common::ValidationContext *context)

Configure scan as described by the configuration parameters.

Parameters
  • config – scan configuration containing the bytes_per_second and scan_len_max

  • context – A validation context where errors should be added.

void validate_start_scan(const ska::pst::common::AsciiHeader &config)

Start the scan using the provided configuration parameters.

Parameters

config – Scan runtime configuration parameters

void increment_bytes(uint64_t nbytes)

Increment bytes_written by the specified number of bytes.

Parameters

nbytes – Number of bytes to increment

Throws

std::runtime_error – if scanning is false

uint64_t get_bytes_written() const

Return the amount of data of data written in the current scan.

Throws

std::runtime_error – if configured is false

Returns

uint64_t Number of bytes written.

double get_data_write_rate() const

Get the current data write rate.

Throws

std::runtime_error – if scanning is false

Returns

double data write rate in bytes per second

double get_expected_data_write_rate() const

Get the expected data rate based on the configuration.

Throws

std::runtime_error – if configured is false

Returns

double expected data rate in bytes per second

size_t get_disk_capacity() const

Return the capacity of the file system.

Throws

std::runtime_error – if resources_assigned is false

Returns

uint64_t total capacity of the file system in bytes.

size_t get_disk_available() const

Get the available space of the file system.

Throws

std::runtime_error – if resources_assigned is false

Returns

float data write rate in bytes per second

double get_recording_time_available() const

Get the available recording time base on the data rate and available disk space.

Throws

std::runtime_error – if configured is false

Returns

double available recording time in seconds