DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
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
29namespace ers
30{
46 public:
47 explicit ThrottleStream(const std::string &criteria);
48
49 void write(const ers::Issue &issue) override;
50
51 private:
53 public:
55 void reset();
56
57 std::time_t m_lastOccurance;
58 std::time_t m_lastReport;
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;
72
75 std::mutex m_mutex;
76 };
77}
78
79#endif
Base class for any user define issue.
Definition Issue.hpp:80
ERS abstract output stream interface.
std::map< std::string, IssueRecord > IssueMap
void reportSuppression(IssueRecord &record, const ers::Issue &issue)
void write(const ers::Issue &issue) override
void throttle(IssueRecord &record, const ers::Issue &issue)
ThrottleStream(const std::string &criteria)