24#ifndef MYSQL_SCHEDULER_CLOCK_LWM_REGISTRY_H
25#define MYSQL_SCHEDULER_CLOCK_LWM_REGISTRY_H
Clock implementation that computes LWM (Low Water Mark) based on executed tasks.
Definition: clock_lwm_registry.h:85
void test_set_current_lwm(Time_point_t lwm)
Backdoor for unit tests to set LWM to a specific value.
Definition: clock_lwm_registry.cpp:104
Clock_lwm_registry(std::size_t clock_capacity=8192, Scheduler_clock_psi psi_params={})
Construct the clock - initializes the internal task registry Since we use spin lock in this implement...
Definition: clock_lwm_registry.h:92
Time_point_t now() const override
Get the current value of the LWM.
Definition: clock_lwm_registry.cpp:29
Task_registry_multi< Task_id, Task_state > m_executed_registry
Registry of executed tasks.
Definition: clock_lwm_registry.h:133
Time_point_t start_time() const override
Get start time of this clock - the first LWM value (0)
Definition: clock_lwm_registry.cpp:33
std::atomic< Time_point_t > m_current_lwm
Current LWM value.
Definition: clock_lwm_registry.h:135
bool tick(Task_id task_id, Time_point_t) override
Tick performed on the clock when task finishes.
Definition: clock_lwm_registry.cpp:46
bool add_time(Task_id task_id, Time_point_t) override
Registers a task to execute at specific LWM.
Definition: clock_lwm_registry.cpp:37
Interface for clock implementations scheduler uses to schedule tasks.
Definition: scheduler_clock.h:52
uint64_t Time_point_t
Definition: scheduler_clock.h:54
This template class provides a concurrent registry for tasks that handles hash conflicts by allowing ...
Definition: task_registry_multi.h:74
Definition: base_dependency_tracker.h:41
This structure is used to represent a registered task state and update LWM.
Definition: clock_lwm_registry.h:124
bool started
Task has started.
Definition: clock_lwm_registry.h:126
bool finished
Task has finished.
Definition: clock_lwm_registry.h:128
Scheduler_clock instrumentation parameters, packed into this structure to simplify construction of a ...
Definition: scheduler_clock_psi.h:38