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

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.
 

Detailed Description

Writer for log files at a fixed resolution.

Definition at line 156 of file log.h.

Constructor & Destructor Documentation

◆ LogWriter()

roo_monitoring::LogWriter::LogWriter ( roo_io::Filesystem &  fs,
const char *  log_dir,
CachedLogDir cache,
Resolution  resolution 
)

Creates a log writer for the specified directory and resolution.

Definition at line 223 of file log.cpp.

Member Function Documentation

◆ can_skip_write()

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().

◆ close()

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().

◆ first_timestamp()

int64_t roo_monitoring::LogWriter::first_timestamp ( ) const
inline

Returns the first timestamp recorded in the current file.

Definition at line 176 of file log.h.

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

◆ open()

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().

◆ resolution()

Resolution roo_monitoring::LogWriter::resolution ( ) const
inline

Returns the resolution used for this writer.

Definition at line 163 of file log.h.

Referenced by roo_monitoring::WriteTransaction::write().

◆ write()

void roo_monitoring::LogWriter::write ( int64_t  timestamp,
uint64_t  stream_id,
uint16_t  datum 
)

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