CatapultServer
v0.5.0.1 (Elephant)
|
std::list< NodeInteractionsBucket > m_buckets
Definition: NodeInteractionsContainer.h:97
static constexpr TimeSpan FromDifference(Timestamp end, Timestamp start)
Creates a time span from the difference between start and end.
Definition: TimeSpan.h:64
Timestamp CreationTime
Time at which the bucket was created.
Definition: NodeInteractionsContainer.h:63
NodeInteractions(uint32_t numSuccesses, uint32_t numFailures)
Constructs node interactions around numSuccesses and numFailures.
Definition: NodeInteractionsContainer.h:36
Node interactions container.
Definition: NodeInteractionsContainer.h:50
Definition: NodeInteractionsContainer.h:52
Represents a time duration.
Definition: TimeSpan.h:30
static utils::TimeSpan InteractionDuration()
Maximum duration of an interaction.
Definition: NodeInteractionsContainer.cpp:40
void addInteraction(Timestamp timestamp, const consumer< NodeInteractionsBucket & > &consumer)
Definition: NodeInteractionsContainer.cpp:71
static utils::TimeSpan BucketDuration()
Maximum duration of an interaction bucket.
Definition: NodeInteractionsContainer.cpp:36
static constexpr TimeSpan FromHours(uint64_t hours)
Creates a time span from the given number of hours.
Definition: TimeSpan.h:44
uint32_t NumFailures
Number of failed interactions.
Definition: NodeInteractionsContainer.h:69
void pruneBuckets(Timestamp timestamp)
Prunes buckets at timestamp.
Definition: NodeInteractionsContainer.cpp:64
void incrementSuccesses(Timestamp timestamp)
Increments successful interactions at timestamp.
Definition: NodeInteractionsContainer.cpp:56
uint32_t NumSuccesses
Number of successful interactions.
Definition: NodeInteractionsContainer.h:43
Node interactions.
Definition: NodeInteractionsContainer.h:29
uint32_t NumFailures
Number of failed interactions.
Definition: NodeInteractionsContainer.h:46
utils::BaseValue< uint64_t, Timestamp_tag > Timestamp
Definition: src/catapult/types.h:73
Definition: AddressExtractionExtension.cpp:28
NodeInteractionsBucket(Timestamp timestamp)
Constructs a bucket around timestamp.
Definition: NodeInteractionsContainer.h:55
void incrementFailures(Timestamp timestamp)
Increments failed interactions at timestamp.
Definition: NodeInteractionsContainer.cpp:60
uint32_t NumSuccesses
Number of successful interactions.
Definition: NodeInteractionsContainer.h:66
NodeInteractions()
Default constructor for node interactions.
Definition: NodeInteractionsContainer.h:32
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
NodeInteractions interactions(Timestamp timestamp) const
Gets the node interactions at timestamp..
Definition: NodeInteractionsContainer.cpp:44