FACT++  1.0
void DimWriteStatistics::SetUpdateInterval ( const int16_t  duration)

Set the update of the service interval

Parameters
durationthe duration between two services update, in second

Definition at line 238 of file DimWriteStatistics.cc.

References MessageImp::Error(), fLog, fUpdateInterval, MessageImp::Message(), str, and MessageImp::Warn().

Referenced by DataLogger::EvalOptions(), GetFileSizeOnDisk(), and DataLogger::SetStatsPeriod().

239 {
240  if (!finite(duration))
241  {
242  fLog.Error("Provided update interval is not a valid float... discarding.");
243  return;
244  }
245  if (uint16_t(duration) == fUpdateInterval)
246  {
247  fLog.Warn("Statistics update interval not modified. Supplied value already in use.");
248  return;
249  }
250 
251  if (duration <= 0)
252  fLog.Message("Statistics are now OFF.");
253  else
254  {
255  ostringstream str;
256  str << "Statistics update interval is now " << duration << " seconds";
257  fLog.Message(str);
258  }
259 
260  fUpdateInterval = duration<0 ? 0 : duration;
261 }
uint16_t fUpdateInterval
Current folder being watched for free space.
char str[80]
Definition: test_client.c:7
int Error(const std::string &str)
Definition: MessageImp.h:49
int Warn(const std::string &str)
Definition: MessageImp.h:48
int Message(const std::string &str)
Definition: MessageImp.h:46

+ Here is the call graph for this function:

+ Here is the caller graph for this function: