1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-28 20:02:00 +03:00

Use dedicated call and progress event for progress reporting in status

reporter interface.

Refs codership/wsrep-lib#174
This commit is contained in:
Alexey Yurchenko
2021-12-06 00:02:25 +02:00
parent 4565f7232f
commit 6fd1fdf690
4 changed files with 209 additions and 129 deletions

View File

@ -43,11 +43,19 @@ namespace wsrep
virtual ~reporter();
// indefinite progress value
static float constexpr indefinite = -1.0f;
void report_state(enum server_state::state state);
void report_state(enum server_state::state state,
float progress = indefinite);
/**
* Report progres in the form of a JSON string (all values integers):
* {
* "from": FROM, // from wsrep API state number
* "to": TO, // to wsrep API state number
* "total": TOTAL, // total work to do
* "done": DONE, // work already done
* "indefinite": INDEFINITE // indefinite value of work constant
* }
*/
void report_progress(const std::string& json);
enum log_level
{
@ -80,9 +88,9 @@ namespace wsrep
wsrep::mutex& mutex_;
std::string const file_name_;
std::string progress_;
char* template_;
substates state_;
float progress_;
bool initialized_;
typedef struct {