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