roo_monitoring
API Documentation for roo_monitoring
Loading...
Searching...
No Matches
roo_monitoring::LogReader Class Reference

Reader that walks across a sequence of log files. More...

#include <log.h>

Public Member Functions

 LogReader (roo_io::Mount &fs, const char *log_dir, CachedLogDir &cache, Resolution resolution, int64_t hot_file=-1)
 Creates a reader for the specified log directory and resolution.
 
bool nextRange ()
 Advances to the next time range.
 
int64_t range_floor () const
 Returns the lower bound of the current range.
 
bool seek (LogCursor cursor)
 Seeks to the specified cursor.
 
LogCursor tell ()
 Returns the current cursor.
 
bool isHotRange ()
 Returns true if the current range is hot (still being written).
 
void deleteRange ()
 Deletes the current range files.
 
bool nextSample (int64_t *timestamp, std::vector< LogSample > *data)
 Reads the next sample in the current range.
 

Detailed Description

Reader that walks across a sequence of log files.

Definition at line 114 of file log.h.

Constructor & Destructor Documentation

◆ LogReader()

roo_monitoring::LogReader::LogReader ( roo_io::Mount &  fs,
const char *  log_dir,
CachedLogDir cache,
Resolution  resolution,
int64_t  hot_file = -1 
)

Creates a reader for the specified log directory and resolution.

Definition at line 122 of file log.cpp.

Member Function Documentation

◆ deleteRange()

void roo_monitoring::LogReader::deleteRange ( )

Deletes the current range files.

Definition at line 210 of file log.cpp.

References roo_monitoring::CachedLogDir::erase(), roo_monitoring::filepath(), and isHotRange().

◆ isHotRange()

bool roo_monitoring::LogReader::isHotRange ( )

Returns true if the current range is hot (still being written).

Definition at line 167 of file log.cpp.

Referenced by deleteRange(), roo_monitoring::Writer::flushSome(), and tell().

◆ nextRange()

bool roo_monitoring::LogReader::nextRange ( )

Advances to the next time range.

Definition at line 145 of file log.cpp.

References roo_monitoring::kRangeLength, roo_monitoring::timestamp_ms_ceil(), and roo_monitoring::timestamp_ms_floor().

Referenced by roo_monitoring::Writer::flushSome().

◆ nextSample()

bool roo_monitoring::LogReader::nextSample ( int64_t *  timestamp,
std::vector< LogSample > *  data 
)

Reads the next sample in the current range.

Definition at line 173 of file log.cpp.

References roo_monitoring::LogFileReader::close(), roo_monitoring::LogFileReader::is_open(), and roo_monitoring::LogFileReader::next().

◆ range_floor()

int64_t roo_monitoring::LogReader::range_floor ( ) const
inline

Returns the lower bound of the current range.

Definition at line 123 of file log.h.

Referenced by roo_monitoring::Writer::flushSome().

◆ seek()

bool roo_monitoring::LogReader::seek ( LogCursor  cursor)

◆ tell()

LogCursor roo_monitoring::LogReader::tell ( )

Returns the current cursor.

Definition at line 205 of file log.cpp.

References roo_monitoring::LogFileReader::checkpoint(), and isHotRange().


The documentation for this class was generated from the following files: