Kùzu C++ API
Loading...
Searching...
No Matches
progress_bar.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <mutex>
5
6#include "metric.h"
8
9namespace kuzu {
10namespace common {
11
12typedef std::unique_ptr<ProgressBarDisplay> (*progress_bar_display_create_func_t)();
13
19public:
21
22 static std::shared_ptr<ProgressBarDisplay> DefaultProgressBarDisplay();
23
25
26 void finishPipeline(uint64_t queryID);
27
28 void endProgress(uint64_t queryID);
29
30 void startProgress(uint64_t queryID);
31
32 void toggleProgressBarPrinting(bool enable);
33
34 void setShowProgressAfter(uint64_t showProgressAfter);
35
36 void updateProgress(uint64_t queryID, double curPipelineProgress);
37
38 void setDisplay(std::shared_ptr<ProgressBarDisplay> progressBarDipslay);
39
40 std::shared_ptr<ProgressBarDisplay> getDisplay() { return display; }
41
42 bool getProgressBarPrinting() const { return trackProgress; }
43
44private:
45 void resetProgressBar(uint64_t queryID);
46
47 void updateDisplay(uint64_t queryID, double curPipelineProgress);
48
49 bool shouldUpdateProgress() const;
50
51private:
52 uint32_t numPipelines;
53 uint32_t numPipelinesFinished;
54 std::mutex progressBarLock;
55 bool trackProgress;
56 std::unique_ptr<TimeMetric> queryTimer;
57 uint64_t showProgressAfter;
58 std::shared_ptr<ProgressBarDisplay> display;
59};
60
61} // namespace common
62} // namespace kuzu
Progress bar for tracking the progress of a pipeline. Prints the progress of each query pipeline and ...
Definition progress_bar.h:18
bool getProgressBarPrinting() const
Definition progress_bar.h:42
void updateProgress(uint64_t queryID, double curPipelineProgress)
void endProgress(uint64_t queryID)
std::shared_ptr< ProgressBarDisplay > getDisplay()
Definition progress_bar.h:40
void startProgress(uint64_t queryID)
void setShowProgressAfter(uint64_t showProgressAfter)
static std::shared_ptr< ProgressBarDisplay > DefaultProgressBarDisplay()
void setDisplay(std::shared_ptr< ProgressBarDisplay > progressBarDipslay)
void toggleProgressBarPrinting(bool enable)
void finishPipeline(uint64_t queryID)
std::unique_ptr< ProgressBarDisplay >(* progress_bar_display_create_func_t)()
Definition progress_bar.h:12
Definition alter_type.h:5