33 auto reset(
float value) -> void;
52 return values_.data();
101 std::array<float, NUM_SAMPLES> values_{};
105 float average_{0.0f};
107 int32_t smart_init_samples_{-1};
120auto draw_progress_bar(
float width,
float max_width,
float height,
const ImVec4& color) -> bool;
135 uint32_t current_value,
138 float height) -> void;
Class for collecting and managing time-series sample data. Maintains a rolling buffer of samples with...
auto get_max() const -> float
Get the maximum value in the current sample set.
auto get_offset() const -> int32_t
Get the current offset in the rolling buffer.
sample_data()
Constructor that initializes all samples to zero.
auto get_min() const -> float
Get the minimum value in the current sample set.
static constexpr uint32_t NUM_SAMPLES
auto push_sample(float value) -> void
Add a new sample to the rolling buffer. Automatically updates min, max, and average statistics.
auto get_values() const -> const float *
Get the raw sample values array.
auto get_average() const -> float
Get the average value of the current sample set.
auto reset(float value) -> void
Reset all samples to a specific value.
auto draw_resource_bar(const char *name, const char *tooltip, uint32_t current_value, uint32_t max_value, float max_width, float height) -> void
Draw a resource usage bar with label and percentage.
auto draw_progress_bar(float width, float max_width, float height, const ImVec4 &color) -> bool
Draw a colored progress bar with hover effects.