10 #ifndef logger_types_telem_saving_hpp
11 #define logger_types_telem_saving_hpp
13 #include "generated/telem_saving_generated.h"
40 const uint32_t & compressedSize,
41 const float & encodeRate,
42 const float & differenceRate,
43 const float & reorderRate,
44 const float & compressRate
47 auto fp = Createtelem_saving_fb(
builder, rawSize,compressedSize, encodeRate, differenceRate, reorderRate, compressRate);
59 return Verifytelem_saving_fbBuffer(verifier);
67 static_cast<void>(len);
69 auto fbs = Gettelem_saving_fb(msgBuffer);
73 s <<
"Saved " << ((float)fbs->rawSize())/1048576.0 <<
" MB @ " << ((
float) fbs->compressedSize() )/((
float) fbs->rawSize()) <<
"%.";
The MagAO-X logger flatbuffer log base type.
uint16_t eventCodeT
The type of an event code (16-bit unsigned int).
msgLen2T msgLenT
The type used to refer to the message length, regardless of length.
int8_t logPrioT
The type of the log priority code.
static void * messageBuffer(bufferPtrT &logBuffer)
Get the message buffer address.
std::shared_ptr< char > bufferPtrT
The log entry buffer smart pointer.
constexpr static logPrioT LOG_TELEM
A telemetry recording.
Message type for resolving log messages with a f.b. builder.
flatbuffers::FlatBufferBuilder builder
Base class for logs consisting of a flatbuffer message.
The type of the input message.
messageT(const uint32_t &rawSize, const uint32_t &compressedSize, const float &encodeRate, const float &differenceRate, const float &reorderRate, const float &compressRate)
Construct from components.
Log entry recording data saving statistics.
static const flatlogs::eventCodeT eventCode
The event code.
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatte for human consumption.
static const flatlogs::logPrioT defaultLevel
The default level.
static timespec lastRecord
The time of the last time this log was recorded. Used by the telemetry system.
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)