|
roo_monitoring
API Documentation for roo_monitoring
|
Writer for log files at a fixed resolution. More...
#include <log.h>
Public Member Functions | |
| LogWriter (roo_io::Filesystem &fs, const char *log_dir, CachedLogDir &cache, Resolution resolution) | |
| Creates a log writer for the specified directory and resolution. | |
| Resolution | resolution () const |
| Returns the resolution used for this writer. | |
| void | open (roo_io::FileUpdatePolicy update_policy) |
| Opens the log file according to the update policy. | |
| void | close () |
| Closes the log file. | |
| void | write (int64_t timestamp, uint64_t stream_id, uint16_t datum) |
| Writes a single log sample. | |
| bool | can_skip_write (int64_t timestamp, uint64_t stream_id) |
| Returns true if a write can be skipped for this bucket. | |
| int64_t | first_timestamp () const |
| Returns the first timestamp recorded in the current file. | |
| roo_monitoring::LogWriter::LogWriter | ( | roo_io::Filesystem & | fs, |
| const char * | log_dir, | ||
| CachedLogDir & | cache, | ||
| Resolution | resolution | ||
| ) |
| bool roo_monitoring::LogWriter::can_skip_write | ( | int64_t | timestamp, |
| uint64_t | stream_id | ||
| ) |
Returns true if a write can be skipped for this bucket.
Definition at line 264 of file log.cpp.
Referenced by roo_monitoring::WriteTransaction::write().
| void roo_monitoring::LogWriter::close | ( | ) |
Closes the log file.
Definition at line 259 of file log.cpp.
Referenced by write(), and roo_monitoring::WriteTransaction::~WriteTransaction().
|
inline |
Returns the first timestamp recorded in the current file.
Definition at line 176 of file log.h.
Referenced by roo_monitoring::Writer::flushSome().
| void roo_monitoring::LogWriter::open | ( | roo_io::FileUpdatePolicy | update_policy | ) |
Opens the log file according to the update policy.
Definition at line 247 of file log.cpp.
References roo_monitoring::Filename::filename(), roo_monitoring::Filename::forTimestamp(), and roo_monitoring::CachedLogDir::insert().
Referenced by write().
|
inline |
Returns the resolution used for this writer.
Definition at line 163 of file log.h.
Referenced by roo_monitoring::WriteTransaction::write().
| void roo_monitoring::LogWriter::write | ( | int64_t | timestamp, |
| uint64_t | stream_id, | ||
| uint16_t | datum | ||
| ) |
Writes a single log sample.
Definition at line 269 of file log.cpp.
References close(), roo_monitoring::kRangeLength, open(), roo_monitoring::timestamp_ms_ceil(), roo_monitoring::writeDatum(), and roo_monitoring::writeTimestamp().
Referenced by roo_monitoring::WriteTransaction::write().