Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
mf::service::ELstatistics Class Reference

#include <ELstatistics.h>

Inheritance diagram for mf::service::ELstatistics:
mf::service::ELdestination

Classes

struct  Config
 

Public Types

using Parameters = fhicl::WrappedTable< Config >
 
- Public Types inherited from mf::service::ELdestination
enum  flag_enum {
  NO_LINE_BREAKS, TIMESTAMP, MILLISECOND, MODULE,
  SUBROUTINE, TEXT, SOME_CONTEXT, SERIAL,
  FULL_CONTEXT, TIME_SEPARATE, EPILOGUE_SEPARATE, NFLAGS
}
 

Public Member Functions

 ~ELstatistics ()
 
 ELstatistics (Parameters const &, std::ostream &)
 
 ELstatistics (Config const &, cet::ostream_handle &&)
 
 ELstatistics (ELstatistics const &)=delete
 
 ELstatistics (ELstatistics &&)=delete
 
ELstatisticsoperator= (ELstatistics const &)=delete
 
ELstatisticsoperator= (ELstatistics &&)=delete
 
- Public Member Functions inherited from mf::service::ELdestination
virtual ~ELdestination () noexcept=default
 
 ELdestination (Config const &)
 
 ELdestination (ELdestination const &)=delete
 
 ELdestination (ELdestination &&)=delete
 
ELdestinationoperator= (ELdestination const &)=delete
 
ELdestinationoperator= (ELdestination &&)=delete
 
void setThreshold (ELseverityLevel sv)
 
virtual void finish ()
 

Private Member Functions

void log (mf::ErrorObj &) override
 
void summary () override
 

Private Attributes

cet::ostream_handle osh_
 

Additional Inherited Members

- Protected Member Functions inherited from mf::service::ELdestination
std::string summarizeContext (std::string const &)
 
void emitToken (std::ostream &os, std::string const &s, bool nl=false, bool preambleMode=false)
 
std::string formSummary ()
 
bool skipMsg (ELextendedID const &)
 
void resetLimiters ()
 
void resetMsgCounters ()
 
virtual void fillPrefix (std::ostringstream &, mf::ErrorObj const &msg)
 
virtual void fillUsrMsg (std::ostringstream &, mf::ErrorObj const &msg)
 
virtual void fillSuffix (std::ostringstream &, mf::ErrorObj const &msg)
 
virtual void routePayload (std::ostringstream const &, mf::ErrorObj const &msg)
 
virtual void flush ()
 
- Protected Attributes inherited from mf::service::ELdestination
ELseverityLevel threshold_
 
MsgFormatSettings format_
 
int defaultLimit_
 
int defaultReportEvery_
 
int defaultTimespan_
 
std::map< std::string const, CategoryParamscategoryParams_
 
std::map< ELextendedID const, XidLimiterxidLimiters_
 
std::map< ELextendedID const, StatsCountstatsMap_
 
bool outputStatistics_ {false}
 
bool updatedStats_ {false}
 
bool reset_ {false}
 

Detailed Description

Definition at line 12 of file ELstatistics.h.

Member Typedef Documentation

Definition at line 17 of file ELstatistics.h.

Constructor & Destructor Documentation

mf::service::ELstatistics::~ELstatistics ( )
default
mf::service::ELstatistics::ELstatistics ( Parameters const &  pset,
std::ostream &  osp 
)

Definition at line 14 of file ELstatistics.cc.

15  : ELstatistics{pset(), cet::ostream_handle{osp}}
16  {}
ELstatistics(Parameters const &, std::ostream &)
Definition: ELstatistics.cc:14
mf::service::ELstatistics::ELstatistics ( Config const &  config,
cet::ostream_handle &&  osh 
)

Definition at line 10 of file ELstatistics.cc.

12  {}
static Config * config
Definition: config.cpp:1054
def move(depos, offset)
Definition: depos.py:107
cet::ostream_handle osh_
Definition: ELstatistics.h:34
ELdestination(Config const &)
fhicl::TableFragment< ELdestination::Config > elDestConfig
Definition: ELstatistics.h:15
mf::service::ELstatistics::ELstatistics ( ELstatistics const &  )
delete
mf::service::ELstatistics::ELstatistics ( ELstatistics &&  )
delete

Member Function Documentation

void mf::service::ELstatistics::log ( mf::ErrorObj msg)
overrideprivatevirtual

Reimplemented from mf::service::ELdestination.

Definition at line 19 of file ELstatistics.cc.

20  {
21  if (msg.xid().severity() < threshold_) {
22  if (outputStatistics_) {
23  statsMap_[msg.xid()].add(summarizeContext(msg.context()), false);
24  updatedStats_ = true;
25  }
26  return;
27  }
28  if (skipMsg(msg.xid())) {
29  if (outputStatistics_) {
30  statsMap_[msg.xid()].add(summarizeContext(msg.context()), false);
31  updatedStats_ = true;
32  }
33  return;
34  }
35  msg.setReactedTo(true);
36  // The only real difference between a statistics destination
37  // and an ordinary one is here, where we make no attempt to
38  // output the message.
39  if (outputStatistics_) {
40  statsMap_[msg.xid()].add(summarizeContext(msg.context()), true);
41  updatedStats_ = true;
42  }
43  }
ELseverityLevel severity() const
Definition: ELextendedID.cc:33
bool skipMsg(ELextendedID const &)
std::string const & context() const
Definition: ErrorObj.cc:98
std::map< ELextendedID const, StatsCount > statsMap_
std::string summarizeContext(std::string const &)
ELextendedID const & xid() const
Definition: ErrorObj.cc:61
ELseverityLevel threshold_
virtual void setReactedTo(bool)
Definition: ErrorObj.cc:177
ELstatistics& mf::service::ELstatistics::operator= ( ELstatistics const &  )
delete
ELstatistics& mf::service::ELstatistics::operator= ( ELstatistics &&  )
delete
void mf::service::ELstatistics::summary ( )
overrideprivatevirtual

Reimplemented from mf::service::ELdestination.

Definition at line 48 of file ELstatistics.cc.

49  {
51  osh_ << "\n=============================================\n\n"
52  << "MessageLogger Summary\n"
53  << formSummary();
54  }
55  updatedStats_ = false;
56  if (reset_) {
58  resetLimiters();
59  }
60  }
cet::ostream_handle osh_
Definition: ELstatistics.h:34

Member Data Documentation

cet::ostream_handle mf::service::ELstatistics::osh_
private

Definition at line 34 of file ELstatistics.h.


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