FACT++  1.0
int DataLogger::PrintState ( const Event evt)
private

print the current state of the dataLogger

print the dataLogger's current state. invoked by the PRINT command

Parameters
evtthe current event. Not used by the method
Returns
the new state. Which, in that case, is the current state

Definition at line 1564 of file datalogger.cc.

References DimWriteStatistics::Stats::freeSpace, StateMachineImp::GetCurrentState(), DimWriteStatistics::GetTotalSizeWritten(), DimWriteStatistics::GetUpdateInterval(), if(), MessageImp::Message(), NumSubAndFitsType::numOpenFits, NumSubAndFitsType::numSubscriptions, DimWriteStatistics::Stats::sizeWritten, and str.

Referenced by DataLogger().

1565 {
1566  Message("------------------------------------------");
1567  Message("------- DATA LOGGER CURRENT STATE --------");
1568  Message("------------------------------------------");
1569 
1570  //print the path configuration
1571 #if BOOST_VERSION < 104600
1572  Message("File path: " + boost::filesystem::system_complete(boost::filesystem::path(fFilePath)).directory_string());
1573 #else
1574  Message("File path: " + boost::filesystem::system_complete(boost::filesystem::path(fFilePath)).parent_path().string());
1575 #endif
1576 
1577  //print active run numbers
1578  ostringstream str;
1579  //timeout value
1580  str << "Timeout delay for old run numbers: " << fRunNumberTimeout << " ms";
1581  Message(str);
1582  str.str("");
1583  str << "Active Run Numbers:";
1584  for (list<RunNumberType>::const_iterator it=fRunNumber.begin(); it!=fRunNumber.end(); it++)
1585  str << " " << it->runNumber;
1586  if (fRunNumber.empty())
1587  str << " <none>";
1588  Message(str);
1589 
1590  //print all the open files.
1591  Message("------------ OPEN FILES ----------------");
1592  if (fNightlyLogFile.is_open())
1593  Message("Nightly log-file: "+fFullNightlyLogFileName);
1594 
1595 // if (fNightlyReportFile.is_open())
1596  // Message("Nightly report-file: "+fFullNightlyReportFileName);
1597 
1599  // /*const bool statWarning =*/ calculateTotalSizeWritten(statVar, true);
1600 #ifdef HAVE_FITS
1601  str.str("");
1602  str << "Number of open FITS files: " << fNumSubAndFitsData.numOpenFits;
1603  Message(str);
1604  // FIXME: Print list of open FITS files
1605 #else
1606  Message("FITS output disabled at compilation");
1607 #endif
1608  Message("----------------- STATS ------------------");
1610  {
1611  str.str("");
1612  str << "Statistics are updated every " << fFilesStats.GetUpdateInterval() << " ms";
1613  Message(str);
1614  }
1615  else
1616  Message("Statistics updates are currently disabled.");
1617  str.str("");
1618  str << "Total Size written: " << statVar.sizeWritten/1000 << " kB";
1619  Message(str);
1620  str.str("");
1621  str << "Disk free space: " << statVar.freeSpace/1000000 << " MB";
1622  Message(str);
1623 
1624  Message("------------ DIM SUBSCRIPTIONS -----------");
1625  str.str("");
1626  str << "There are " << fNumSubAndFitsData.numSubscriptions << " active DIM subscriptions.";
1627  Message(str);
1628  for (map<const string, map<string, SubscriptionType> >::const_iterator it=fServiceSubscriptions.begin(); it!= fServiceSubscriptions.end();it++)
1629  {
1630  Message("Server "+it->first);
1631  for (map<string, SubscriptionType>::const_iterator it2=it->second.begin(); it2!=it->second.end(); it2++)
1632  Message(" -> "+it2->first);
1633  }
1634  Message("--------------- BLOCK LIST ---------------");
1635  for (set<string>::const_iterator it=fBlackList.begin(); it != fBlackList.end(); it++)
1636  Message(" -> "+*it);
1637  if (fBlackList.empty())
1638  Message(" <empty>");
1639 
1640  Message("--------------- ALLOW LIST ---------------");
1641  for (set<string>::const_iterator it=fWhiteList.begin(); it != fWhiteList.end(); it++)
1642  Message(" -> "+*it);
1643  if (fWhiteList.empty())
1644  Message(" <empty>");
1645 
1646  Message("-------------- GROUPING LIST -------------");
1647  Message("The following servers and/or services will");
1648  Message("be grouped into a single fits file:");
1649  for (set<string>::const_iterator it=fGrouping.begin(); it != fGrouping.end(); it++)
1650  Message(" -> "+*it);
1651  if (fGrouping.empty())
1652  Message(" <no grouping>");
1653 
1654  Message("------------------------------------------");
1655  Message("-------- END OF DATA LOGGER STATE --------");
1656  Message("------------------------------------------");
1657 
1658  return GetCurrentState();
1659 }
DimWriteStatistics fFilesStats
Definition: datalogger.cc:235
uint32_t numSubscriptions
Definition: datalogger.cc:96
int GetCurrentState() const
return the current state of the machine
uint32_t numOpenFits
Definition: datalogger.cc:97
ofstream fNightlyLogFile
ofstream for the NightlyLogfile
Definition: datalogger.cc:203
char str[80]
Definition: test_client.c:7
string fFilePath
ofstream for the Nightly report file
Definition: datalogger.cc:209
set< string > fBlackList
black/white listing
Definition: datalogger.cc:310
uint16_t GetUpdateInterval() const
uint32_t fRunNumberTimeout
old run numbers time-out delay (in seconds)
Definition: datalogger.cc:213
const Stats & GetTotalSizeWritten() const
set< string > fWhiteList
Definition: datalogger.cc:311
SubscriptionsListType fServiceSubscriptions
All the services to which we have subscribed to, sorted by server name.
Definition: datalogger.cc:224
NumSubAndFitsType fNumSubAndFitsData
Definition: datalogger.cc:294
list< RunNumberType > fRunNumber
run numbers
Definition: datalogger.cc:211
if(extraDns) new Dns
int Message(const std::string &str)
Definition: MessageImp.h:46
string fFullNightlyLogFileName
full name of the nightly log file
Definition: datalogger.cc:226
set< string > fGrouping
list of services to be grouped
Definition: datalogger.cc:313

+ Here is the call graph for this function:

+ Here is the caller graph for this function: