Project
Loading...
Searching...
No Matches
RateLimiter.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef O2_FRAMERWORK_CORE_RATELIMITER_H
13#define O2_FRAMERWORK_CORE_RATELIMITER_H
14
16#include <cstddef>
17#include <cstdint>
18#include <chrono>
19#include <vector>
20
21namespace o2::framework
22{
24{
25 public:
26 int check(ProcessingContext& ctx, int maxInFlight, size_t minSHM);
27
28 private:
29 int64_t mConsumedTimeframes = 0;
30 int64_t mSentTimeframes = 0;
31
32 std::vector<std::chrono::time_point<std::chrono::system_clock>> mTfTimes;
33 std::chrono::time_point<std::chrono::system_clock> mLastTime, mFirstTime;
34 int64_t mTimeCountingSince = 0;
35 float mSmothDelay = 0.f;
36};
37} // namespace o2::framework
38
39#endif
int check(ProcessingContext &ctx, int maxInFlight, size_t minSHM)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20