Skip to content

Commit 0d86ae5

Browse files
[pgmoneta#1008] Expand backup Progress to include other workflow progress
1 parent 95c6a1e commit 0d86ae5

52 files changed

Lines changed: 2249 additions & 386 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

doc/CLI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ pgmoneta-cli ping
336336

337337
## progress
338338

339-
Get progress for a command.
339+
Get progress for a command. Requires `progress = on` in the configuration.
340340

341341
Command
342342

doc/PROMETHEUS.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,46 @@ Is there an active archiving for a server
755755
| :-------- | :---------- |
756756
| name | The server identifier |
757757

758+
## pgmoneta_progress_percentage
759+
760+
The workflow progress percentage (0-100) for a server
761+
762+
| Attribute | Description |
763+
| :-------- | :---------- |
764+
| name | The server identifier |
765+
| workflow | The current workflow type (e.g. Backup, Restore, Archive) |
766+
| phase | The current workflow phase name |
767+
768+
## pgmoneta_progress_elapsed_time
769+
770+
The elapsed seconds since the current workflow started
771+
772+
| Attribute | Description |
773+
| :-------- | :---------- |
774+
| name | The server identifier |
775+
| workflow | The current workflow type (e.g. Backup, Restore, Archive) |
776+
| phase | The current workflow phase name |
777+
778+
## pgmoneta_progress_total
779+
780+
The total units of work in the current workflow phase
781+
782+
| Attribute | Description |
783+
| :-------- | :---------- |
784+
| name | The server identifier |
785+
| workflow | The current workflow type (e.g. Backup, Restore, Archive) |
786+
| phase | The current workflow phase name |
787+
788+
## pgmoneta_progress_done
789+
790+
The units of work completed in the current workflow phase
791+
792+
| Attribute | Description |
793+
| :-------- | :---------- |
794+
| name | The server identifier |
795+
| workflow | The current workflow type (e.g. Backup, Restore, Archive) |
796+
| phase | The current workflow phase name |
797+
758798
## pgmoneta_current_wal_file
759799

760800
The current streaming WAL filename of a server

doc/manual/en/05-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ pgmoneta-cli ping
342342
343343
## progress
344344
345-
Get progress for a command.
345+
Get progress for a command. Requires `progress = on` in the configuration.
346346
347347
Command
348348

doc/manual/en/10-prometheus.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,46 @@ Indicates if a retention cleanup operation is currently in progress for a server
804804
| :-------- | :---------- | :----- |
805805
| name | The configured name/identifier for the PostgreSQL server. | 1: Retention cleanup is currently running, 0: No retention cleanup is currently running |
806806

807+
**pgmoneta_progress_percentage**
808+
809+
The workflow progress percentage (0-100) for a server.
810+
811+
| Attribute | Description |
812+
| :-------- | :---------- |
813+
| name | The configured name/identifier for the PostgreSQL server. |
814+
| workflow | The current workflow type (e.g. Backup, Restore, Archive). |
815+
| phase | The current workflow phase name. |
816+
817+
**pgmoneta_progress_elapsed_time**
818+
819+
The elapsed seconds since the current workflow started.
820+
821+
| Attribute | Description |
822+
| :-------- | :---------- |
823+
| name | The configured name/identifier for the PostgreSQL server. |
824+
| workflow | The current workflow type (e.g. Backup, Restore, Archive). |
825+
| phase | The current workflow phase name. |
826+
827+
**pgmoneta_progress_total**
828+
829+
The total units of work in the current workflow phase.
830+
831+
| Attribute | Description |
832+
| :-------- | :---------- |
833+
| name | The configured name/identifier for the PostgreSQL server. |
834+
| workflow | The current workflow type (e.g. Backup, Restore, Archive). |
835+
| phase | The current workflow phase name. |
836+
837+
**pgmoneta_progress_done**
838+
839+
The units of work completed in the current workflow phase.
840+
841+
| Attribute | Description |
842+
| :-------- | :---------- |
843+
| name | The configured name/identifier for the PostgreSQL server. |
844+
| workflow | The current workflow type (e.g. Backup, Restore, Archive). |
845+
| phase | The current workflow phase name. |
846+
807847
**pgmoneta_current_wal_file**
808848

809849
Shows the current WAL filename being streamed or processed for a server.

doc/manual/es/05-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ pgmoneta-cli ping
342342
343343
## progress
344344
345-
Obtener progreso para un comando.
345+
Obtener progreso para un comando de respaldo. Requiere `progress = on` en la configuración.
346346
347347
Comando
348348

doc/manual/es/10-prometheus.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,46 @@ Indica si una operación de limpieza de retención está actualmente en progreso
780780
| :-------- | :---------- | :----- |
781781
| name | El nombre/identificador configurado para el servidor PostgreSQL. | 1: Limpieza de retención está en ejecución, 0: Ninguna limpieza de retención está en ejecución |
782782

783+
**pgmoneta_progress_percentage**
784+
785+
El porcentaje de progreso del flujo de trabajo (0-100) para un servidor.
786+
787+
| Atributo | Descripción |
788+
| :-------- | :---------- |
789+
| name | El nombre/identificador configurado para el servidor PostgreSQL. |
790+
| workflow | El tipo de flujo de trabajo actual (p. ej. Backup, Restore, Archive). |
791+
| phase | El nombre de la fase del flujo de trabajo actual. |
792+
793+
**pgmoneta_progress_elapsed_time**
794+
795+
Los segundos transcurridos desde el inicio del flujo de trabajo actual.
796+
797+
| Atributo | Descripción |
798+
| :-------- | :---------- |
799+
| name | El nombre/identificador configurado para el servidor PostgreSQL. |
800+
| workflow | El tipo de flujo de trabajo actual (p. ej. Backup, Restore, Archive). |
801+
| phase | El nombre de la fase del flujo de trabajo actual. |
802+
803+
**pgmoneta_progress_total**
804+
805+
Las unidades de trabajo totales en la fase actual del flujo de trabajo.
806+
807+
| Atributo | Descripción |
808+
| :-------- | :---------- |
809+
| name | El nombre/identificador configurado para el servidor PostgreSQL. |
810+
| workflow | El tipo de flujo de trabajo actual (p. ej. Backup, Restore, Archive). |
811+
| phase | El nombre de la fase del flujo de trabajo actual. |
812+
813+
**pgmoneta_progress_done**
814+
815+
Las unidades de trabajo completadas en la fase actual del flujo de trabajo.
816+
817+
| Atributo | Descripción |
818+
| :-------- | :---------- |
819+
| name | El nombre/identificador configurado para el servidor PostgreSQL. |
820+
| workflow | El tipo de flujo de trabajo actual (p. ej. Backup, Restore, Archive). |
821+
| phase | El nombre de la fase del flujo de trabajo actual. |
822+
783823
**pgmoneta_current_wal_file**
784824

785825
Muestra el nombre de archivo WAL actual siendo transmitido o procesado para un servidor.

src/include/aes.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,11 @@ pgmoneta_decrypt(char* ciphertext, int ciphertext_length, char* password, size_t
137137
* @param d The directory
138138
* @param workers The optional workers
139139
* @param excludes The optional excludes
140+
* @param server The server index for progress tracking, or -1 to disable
140141
* @return 0 upon success, otherwise 1
141142
*/
142143
int
143-
pgmoneta_encrypt_directory(char* d, struct workers* workers, struct deque* excludes);
144+
pgmoneta_encrypt_directory(int server, char* d, struct workers* workers, struct deque* excludes);
144145

145146
/**
146147
* Clear the thread-local AES cache securely

src/include/backup.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,6 @@ pgmoneta_delete_backup(int client_fd, int srv, uint8_t compression, uint8_t encr
8181
int
8282
pgmoneta_get_max_rate(int server);
8383

84-
/**
85-
* Is progress enabled for a server
86-
* @param server The server
87-
* @return True if enabled, otherwise false
88-
*/
89-
bool
90-
pgmoneta_is_progress_enabled(int server);
91-
9284
/**
9385
* Is the backup valid ?
9486
* @param server The server

src/include/compression.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,12 @@ pgmoneta_compress_file(char* from, char* to, int type, struct workers* workers);
144144
* @param directory The directory path
145145
* @param type The compression type
146146
* @param workers Optional worker pool. If NULL, runs synchronously.
147+
* @param excludes Excluded file patterns
148+
* @param server The server index for progress tracking, or -1 to disable
147149
* @return 0 on success, otherwise 1
148150
*/
149151
int
150-
pgmoneta_compress_directory(char* directory, int type, struct workers* workers, struct deque* excludes);
152+
pgmoneta_compress_directory(int server, char* directory, int type, struct workers* workers, struct deque* excludes);
151153

152154
/**
153155
* Decompress a file using the appropriate decompression method.

src/include/management.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ extern "C" {
120120
#define MANAGEMENT_ARGUMENT_BACKUPS "Backups"
121121
#define MANAGEMENT_ARGUMENT_BACKUP_SIZE "BackupSize"
122122
#define MANAGEMENT_ARGUMENT_BIGGEST_FILE_SIZE "BiggestFileSize"
123-
#define MANAGEMENT_ARGUMENT_BYTES_DONE "BytesDone"
124-
#define MANAGEMENT_ARGUMENT_BYTES_TOTAL "BytesTotal"
125123
#define MANAGEMENT_ARGUMENT_CALCULATED "Calculated"
126124
#define MANAGEMENT_ARGUMENT_CASCADE "Cascade"
127125
#define MANAGEMENT_ARGUMENT_CHECKPOINT_HILSN "CheckpointHiLSN"
@@ -137,6 +135,7 @@ extern "C" {
137135
#define MANAGEMENT_ARGUMENT_DELTA "Delta"
138136
#define MANAGEMENT_ARGUMENT_DESTINATION_FILE "DestinationFile"
139137
#define MANAGEMENT_ARGUMENT_DIRECTORY "Directory"
138+
#define MANAGEMENT_ARGUMENT_DONE "Done"
140139
#define MANAGEMENT_ARGUMENT_ELAPSED "Elapsed"
141140
#define MANAGEMENT_ARGUMENT_ENCRYPTION "Encryption"
142141
#define MANAGEMENT_ARGUMENT_END_HILSN "EndHiLSN"
@@ -163,10 +162,12 @@ extern "C" {
163162
#define MANAGEMENT_ARGUMENT_ONLINE "Online"
164163
#define MANAGEMENT_ARGUMENT_ORIGINAL "Original"
165164
#define MANAGEMENT_ARGUMENT_OUTPUT "Output"
165+
#define MANAGEMENT_ARGUMENT_PERCENTAGE "Percentage"
166166
#define MANAGEMENT_ARGUMENT_POSITION "Position"
167167
#define MANAGEMENT_ARGUMENT_PGMONETA_FIPS "PgmonetaFips"
168168
#define MANAGEMENT_ARGUMENT_PRIMARY "Primary"
169-
#define MANAGEMENT_ARGUMENT_PROGRESS_STATE "BackupProgressState"
169+
#define MANAGEMENT_ARGUMENT_PROGRESS_STATE "ProgressState"
170+
#define MANAGEMENT_ARGUMENT_REMAINING "Remaining"
170171
#define MANAGEMENT_ARGUMENT_RESTART "Restart"
171172
#define MANAGEMENT_ARGUMENT_RESTORE_SIZE "RestoreSize"
172173
#define MANAGEMENT_ARGUMENT_RETENTION_DAYS "RetentionDays"
@@ -192,6 +193,7 @@ extern "C" {
192193
#define MANAGEMENT_ARGUMENT_TABLESPACE_NAME "TablespaceName"
193194
#define MANAGEMENT_ARGUMENT_TIME "Time"
194195
#define MANAGEMENT_ARGUMENT_TIMESTAMP "Timestamp"
196+
#define MANAGEMENT_ARGUMENT_TOTAL "Total"
195197
#define MANAGEMENT_ARGUMENT_TOTAL_SPACE "TotalSpace"
196198
#define MANAGEMENT_ARGUMENT_USED_SPACE "UsedSpace"
197199
#define MANAGEMENT_ARGUMENT_VALID "Valid"

0 commit comments

Comments
 (0)