载入中...
搜索中...
未找到
ClimbingTelemetry.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
11#include "common/Time.h"
12
13#include <array>
14#include <cstddef>
15#include <cstdint>
16#include <span>
17
18namespace eve::climbing {
19
21enum class ClimbingWorkload : std::uint8_t { Ordinary, CandidateProbe, Active };
22
24enum class ClimbingQueryBudgetState : std::uint8_t { WithinBudget, Exceeded };
25
28 static constexpr std::uint32_t Ordinary = 4;
29 static constexpr std::uint32_t CandidateProbe = 16;
30 static constexpr std::uint32_t Active = 8;
31
33 [[nodiscard]] static constexpr std::uint32_t forWorkload(ClimbingWorkload workload) noexcept {
34 switch (workload) {
38 }
39 return 0;
40 }
41};
42
56
63
67 std::uint32_t sampleCount = 0;
68 std::uint64_t p50Nanoseconds = 0;
69 std::uint64_t p95Nanoseconds = 0;
70 std::uint32_t p50QueryCount = 0;
71 std::uint32_t p95QueryCount = 0;
72 std::uint32_t maxQueryCount = 0;
73 std::uint32_t budgetExceededCount = 0;
74};
75
83public:
84 static constexpr std::size_t Capacity = 256;
85
87 void record(ClimbingTelemetrySample sample) noexcept;
89 void updateLatestCounters(ClimbingRuntimeCounters counters) noexcept;
91 [[nodiscard]] std::span<const ClimbingTelemetrySample> samples() const noexcept {
92 return {samples_.data(), size_};
93 }
95 [[nodiscard]] ClimbingTelemetrySummary summarize(ClimbingWorkload workload) const noexcept;
97 void clear() noexcept {
98 size_ = 0;
99 next_ = 0;
100 }
101
102private:
103 std::array<ClimbingTelemetrySample, Capacity> samples_{};
104 std::size_t size_ = 0;
105 std::size_t next_ = 0;
106};
107
108} // namespace eve::climbing
Shared value types with no climbing runtime dependency.
#define EVENGINE_API_DOMAINS
Definition Export.h:110
Common time values and an injectable deterministic simulation clock.
Runtime-owned fixed ring of performance samples.
std::span< const ClimbingTelemetrySample > samples() const noexcept
Return current samples in physical storage order; order is irrelevant to percentile summaries.
void clear() noexcept
Clear samples without releasing storage.
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
ClimbingQueryBudgetState
Named result of comparing one workload sample with its query budget.
ClimbingWorkload
Stable workload classes used by the climbing performance budgets.
Query budgets for one 60 Hz primary-character simulation tick.
static constexpr std::uint32_t CandidateProbe
static constexpr std::uint32_t Active
static constexpr std::uint32_t Ordinary
static constexpr std::uint32_t forWorkload(ClimbingWorkload workload) noexcept
Return the fixed narrow-query budget for a workload.
Allocation-free counters produced by the latest runtime workload.
One profiler sample; elapsed time is observational and never feeds simulation state.
Fixed percentile summary for one workload without retaining dynamic storage.
Small owning world-space vector used at climbing module boundaries.