DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
ers
include
ers
internal
ThrottleStream.hpp
Go to the documentation of this file.
1
/*
2
* DUNE DAQ modification notice:
3
* This file has been modified from the original ATLAS ers source for the DUNE DAQ project.
4
* Fork baseline commit: 8267df82a4f6fe6bf02c4014923eba19eddc4614 (2020-04-14).
5
* Renamed since fork: yes (from ers/internal/ThrottleStream.h to include/ers/internal/ThrottleStream.hpp).
6
*
7
* Original copyright:
8
* Copyright (C) 2001-2020 CERN for the benefit of the ATLAS collaboration.
9
* Licensed under the Apache License, Version 2.0.
10
*/
11
12
/*
13
* ThrottleStream.h
14
* ers
15
*
16
* Created by Gordon Crone on 02.08.05.
17
* Copyright 2004 CERN. All rights reserved.
18
*
19
*/
20
21
#ifndef ERS_THROTTLE_STREAM_H
22
#define ERS_THROTTLE_STREAM_H
23
24
#include <map>
25
#include <mutex>
26
27
#include <
ers/OutputStream.hpp
>
28
29
namespace
ers
30
{
45
class
ThrottleStream
:
public
ers::OutputStream
{
46
public
:
47
explicit
ThrottleStream
(
const
std::string &criteria);
48
49
void
write
(
const
ers::Issue
&issue)
override
;
50
51
private
:
52
class
IssueRecord
{
53
public
:
54
IssueRecord
();
55
void
reset
();
56
57
std::time_t
m_lastOccurance
;
58
std::time_t
m_lastReport
;
59
std::string
m_lastOccuranceFormatted
;
60
int
m_initialCounter
;
61
int
m_threshold
;
62
int
m_suppressedCounter
;
63
};
64
65
private
:
66
void
throttle
(
IssueRecord
&record,
const
ers::Issue
&issue);
67
68
void
reportSuppression
(
IssueRecord
&record,
const
ers::Issue
&issue);
69
70
typedef
std::map<std::string, IssueRecord>
IssueMap
;
71
IssueMap
m_issueMap
;
72
73
int
m_initialThreshold
;
74
int
m_timeLimit
;
75
std::mutex
m_mutex
;
76
};
77
}
78
79
#endif
OutputStream.hpp
ers::Issue
Base class for any user define issue.
Definition
Issue.hpp:80
ers::OutputStream
ERS abstract output stream interface.
Definition
OutputStream.hpp:50
ers::ThrottleStream::IssueRecord
Definition
ThrottleStream.hpp:52
ers::ThrottleStream::IssueRecord::m_threshold
int m_threshold
Definition
ThrottleStream.hpp:61
ers::ThrottleStream::IssueRecord::m_lastOccuranceFormatted
std::string m_lastOccuranceFormatted
Definition
ThrottleStream.hpp:59
ers::ThrottleStream::IssueRecord::IssueRecord
IssueRecord()
ers::ThrottleStream::IssueRecord::m_initialCounter
int m_initialCounter
Definition
ThrottleStream.hpp:60
ers::ThrottleStream::IssueRecord::m_suppressedCounter
int m_suppressedCounter
Definition
ThrottleStream.hpp:62
ers::ThrottleStream::IssueRecord::m_lastReport
std::time_t m_lastReport
Definition
ThrottleStream.hpp:58
ers::ThrottleStream::IssueRecord::m_lastOccurance
std::time_t m_lastOccurance
Definition
ThrottleStream.hpp:57
ers::ThrottleStream::IssueRecord::reset
void reset()
ers::ThrottleStream::IssueMap
std::map< std::string, IssueRecord > IssueMap
Definition
ThrottleStream.hpp:70
ers::ThrottleStream::m_initialThreshold
int m_initialThreshold
Definition
ThrottleStream.hpp:73
ers::ThrottleStream::m_mutex
std::mutex m_mutex
Definition
ThrottleStream.hpp:75
ers::ThrottleStream::reportSuppression
void reportSuppression(IssueRecord &record, const ers::Issue &issue)
ers::ThrottleStream::write
void write(const ers::Issue &issue) override
ers::ThrottleStream::throttle
void throttle(IssueRecord &record, const ers::Issue &issue)
ers::ThrottleStream::ThrottleStream
ThrottleStream(const std::string &criteria)
ers::ThrottleStream::m_issueMap
IssueMap m_issueMap
Definition
ThrottleStream.hpp:71
ers::ThrottleStream::m_timeLimit
int m_timeLimit
Definition
ThrottleStream.hpp:74
ers
Definition
Logger.hxx:202
Generated on
for DUNE-DAQ by
1.17.0