rippled
Loading...
Searching...
No Matches
JobTypeInfo.h
1#ifndef XRPL_CORE_JOBTYPEINFO_H_INCLUDED
2#define XRPL_CORE_JOBTYPEINFO_H_INCLUDED
3
4#include <xrpld/core/Job.h>
5
6namespace ripple {
7
10{
11private:
14
20 int const m_limit;
21
25
26public:
27 // Not default constructible
28 JobTypeInfo() = delete;
29
33 int limit,
35 std::chrono::milliseconds peakLatency)
36 : m_type(type)
37 , m_name(std::move(name))
38 , m_limit(limit)
39 , m_avgLatency(avgLatency)
40 , m_peakLatency(peakLatency)
41 {
42 }
43
45 type() const
46 {
47 return m_type;
48 }
49
50 std::string const&
51 name() const
52 {
53 return m_name;
54 }
55
56 int
57 limit() const
58 {
59 return m_limit;
60 }
61
62 bool
63 special() const
64 {
65 return m_limit == 0;
66 }
67
70 {
71 return m_avgLatency;
72 }
73
76 {
77 return m_peakLatency;
78 }
79};
80
81} // namespace ripple
82
83#endif
Holds all the 'static' information about a job, which does not change.
Definition JobTypeInfo.h:10
std::chrono::milliseconds const m_avgLatency
Average and peak latencies for this job type.
Definition JobTypeInfo.h:23
std::chrono::milliseconds getPeakLatency() const
Definition JobTypeInfo.h:75
int const m_limit
The limit on the number of running jobs for this job type.
Definition JobTypeInfo.h:20
JobType type() const
Definition JobTypeInfo.h:45
bool special() const
Definition JobTypeInfo.h:63
JobType const m_type
Definition JobTypeInfo.h:12
int limit() const
Definition JobTypeInfo.h:57
std::chrono::milliseconds getAverageLatency() const
Definition JobTypeInfo.h:69
std::chrono::milliseconds const m_peakLatency
Definition JobTypeInfo.h:24
std::string const & name() const
Definition JobTypeInfo.h:51
JobTypeInfo(JobType type, std::string name, int limit, std::chrono::milliseconds avgLatency, std::chrono::milliseconds peakLatency)
Definition JobTypeInfo.h:30
std::string const m_name
Definition JobTypeInfo.h:13
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
JobType
Definition Job.h:16
STL namespace.