10#ifndef logger_types_telem_chrony_stats_hpp
11#define logger_types_telem_chrony_stats_hpp
72 static_cast<void>(len);
77 std::string msg =
"[chrony_stats] ";
80 snprintf(num,
sizeof(num),
"%g",fbs->systemTime());
84 snprintf(num,
sizeof(num),
"%g",fbs->lastOffset());
88 snprintf(num,
sizeof(num),
"%g",fbs->rmsOffset());
92 snprintf(num,
sizeof(num),
"%g",fbs->freq());
96 snprintf(num,
sizeof(num),
"%g",fbs->residFreq());
100 snprintf(num,
sizeof(num),
"%g",fbs->skew());
103 msg +=
" root_del: ";
104 snprintf(num,
sizeof(num),
"%g",fbs->rootDelay());
107 msg +=
" root_disp: ";
108 snprintf(num,
sizeof(num),
"%g",fbs->rootDispersion());
112 msg += std::to_string(fbs->updateInt());
121 return fbs->systemTime();
127 return fbs->lastOffset();
133 return fbs->rmsOffset();
136 static double freq(
void * msgBuffer )
145 return fbs->residFreq();
148 static double skew(
void * msgBuffer )
157 return fbs->rootDelay();
163 return fbs->rootDispersion();
169 return fbs->updateInt();
190 std::cerr <<
"No member " << member <<
" in telem_chrony_stats\n";
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.
static constexpr flatlogs::eventCodeT TELEM_CHRONY_STATS
bool VerifyTelem_chrony_stats_fbBuffer(::flatbuffers::Verifier &verifier)
inline ::flatbuffers::Offset< Telem_chrony_stats_fb > CreateTelem_chrony_stats_fb(::flatbuffers::FlatBufferBuilder &_fbb, double systemTime=0.0, double lastOffset=0.0, double rmsOffset=0.0, double freq=0.0, double residFreq=0.0, double skew=0.0, double rootDelay=0.0, double rootDispersion=0.0, double updateInt=0.0)
const MagAOX::logger::Telem_chrony_stats_fb * GetTelem_chrony_stats_fb(const void *buf)
static constexpr 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 double systemTime, const double lastOffset, const double rmsOffset, const double freq, const double residFreq, const double skew, const double rootDelay, const double rootDispersion, const double updateInt)
Construct from components.
Log entry recording the statistics from chrony.
static double rootDispersion(void *msgBuffer)
static const flatlogs::logPrioT defaultLevel
The default level.
static double skew(void *msgBuffer)
static double freq(void *msgBuffer)
static double lastOffset(void *msgBuffer)
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
static timespec lastRecord
The time of the last time this log was recorded. Used by the telemetry system.
static double systemTime(void *msgBuffer)
static double rmsOffset(void *msgBuffer)
static double rootDelay(void *msgBuffer)
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatte for human consumption.
static double updateInt(void *msgBuffer)
static logMetaDetail getAccessor(const std::string &member)
Get the logMetaDetail for a member by name.
static const flatlogs::eventCodeT eventCode
The event code.
static double residFreq(void *msgBuffer)