|
roo_monitoring
API Documentation for roo_monitoring
|
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. | |
| roo_monitoring::LogReader::LogReader | ( | roo_io::Mount & | fs, |
| const char * | log_dir, | ||
| CachedLogDir & | cache, | ||
| Resolution | resolution, | ||
| int64_t | hot_file = -1 |
||
| ) |
| 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().
| 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().
| 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().
| 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().
|
inline |
Returns the lower bound of the current range.
Definition at line 123 of file log.h.
Referenced by roo_monitoring::Writer::flushSome().
| bool roo_monitoring::LogReader::seek | ( | LogCursor | cursor | ) |
Seeks to the specified cursor.
Definition at line 188 of file log.cpp.
References roo_monitoring::LogCursor::file(), roo_monitoring::filepath(), roo_monitoring::LogFileReader::open(), and roo_monitoring::LogCursor::position().
| LogCursor roo_monitoring::LogReader::tell | ( | ) |
Returns the current cursor.
Definition at line 205 of file log.cpp.
References roo_monitoring::LogFileReader::checkpoint(), and isHotRange().