xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
core
JobTypeInfo.h
1
#pragma once
2
3
#include <xrpl/core/Job.h>
4
5
#include <
chrono
>
6
#include <
string
>
7
#include <
utility
>
8
9
namespace
xrpl
{
10
14
class
JobTypeInfo
15
{
16
private
:
17
JobType
const
type_
;
18
std::string
const
name_
;
19
26
int
const
limit_
;
27
31
std::chrono::milliseconds
const
avgLatency_
;
32
std::chrono::milliseconds
const
peakLatency_
;
33
34
public
:
35
// Not default constructible
36
JobTypeInfo
() =
delete
;
37
38
JobTypeInfo
(
39
JobType
type
,
40
std::string
name
,
41
int
limit
,
42
std::chrono::milliseconds
avgLatency,
43
std::chrono::milliseconds
peakLatency)
44
:
type_
(
type
)
45
,
name_
(
std
::move(
name
))
46
,
limit_
(
limit
)
47
,
avgLatency_
(avgLatency)
48
,
peakLatency_
(peakLatency)
49
{
50
}
51
52
[[nodiscard]]
JobType
53
type
()
const
54
{
55
return
type_
;
56
}
57
58
[[nodiscard]]
std::string
const
&
59
name
()
const
60
{
61
return
name_
;
62
}
63
64
[[nodiscard]]
int
65
limit
()
const
66
{
67
return
limit_
;
68
}
69
70
[[nodiscard]]
bool
71
special
()
const
72
{
73
return
limit_
== 0;
74
}
75
76
[[nodiscard]]
std::chrono::milliseconds
77
getAverageLatency
()
const
78
{
79
return
avgLatency_
;
80
}
81
82
[[nodiscard]]
std::chrono::milliseconds
83
getPeakLatency
()
const
84
{
85
return
peakLatency_
;
86
}
87
};
88
89
}
// namespace xrpl
std::string
chrono
xrpl::JobTypeInfo::limit
int limit() const
Definition
JobTypeInfo.h:65
xrpl::JobTypeInfo::limit_
int const limit_
The limit on the number of running jobs for this job type.
Definition
JobTypeInfo.h:26
xrpl::JobTypeInfo::peakLatency_
std::chrono::milliseconds const peakLatency_
Definition
JobTypeInfo.h:32
xrpl::JobTypeInfo::name_
std::string const name_
Definition
JobTypeInfo.h:18
xrpl::JobTypeInfo::name
std::string const & name() const
Definition
JobTypeInfo.h:59
xrpl::JobTypeInfo::getPeakLatency
std::chrono::milliseconds getPeakLatency() const
Definition
JobTypeInfo.h:83
xrpl::JobTypeInfo::avgLatency_
std::chrono::milliseconds const avgLatency_
Average and peak latencies for this job type.
Definition
JobTypeInfo.h:31
xrpl::JobTypeInfo::type_
JobType const type_
Definition
JobTypeInfo.h:17
xrpl::JobTypeInfo::special
bool special() const
Definition
JobTypeInfo.h:71
xrpl::JobTypeInfo::type
JobType type() const
Definition
JobTypeInfo.h:53
xrpl::JobTypeInfo::getAverageLatency
std::chrono::milliseconds getAverageLatency() const
Definition
JobTypeInfo.h:77
xrpl::JobTypeInfo::JobTypeInfo
JobTypeInfo()=delete
xrpl::JobTypeInfo::JobTypeInfo
JobTypeInfo(JobType type, std::string name, int limit, std::chrono::milliseconds avgLatency, std::chrono::milliseconds peakLatency)
Definition
JobTypeInfo.h:38
std::chrono::milliseconds
std
STL namespace.
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::JobType
JobType
Definition
Job.h:21
string
utility
Generated by
1.17.0