aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-09-17 09:37:14 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-09-18 23:08:03 -0400
commitdb1a3056296ea3ed13c5a425cf1f11602b43a6c7 (patch)
tree3e3ad60bb4dbdee1a37e10cb10cb3dc2f10b334c /include
parent0f95b43e2d3853995106c5c6aa55bf92f63fb331 (diff)
downloadstasis-db1a3056296ea3ed13c5a425cf1f11602b43a6c7.tar.gz
Add pool summary and elapsed time output
* Add get_task_duration() * Add get_pool_show_summary() * Add signaled_by member to MultiProcessingTask * Add time_data member to MultiProcessingTask for duration tracking
Diffstat (limited to 'include')
-rw-r--r--include/multiprocessing.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/multiprocessing.h b/include/multiprocessing.h
index 4e89722..2356403 100644
--- a/include/multiprocessing.h
+++ b/include/multiprocessing.h
@@ -15,9 +15,14 @@ struct MultiProcessingTask {
pid_t pid; ///< Program PID
pid_t parent_pid; ///< Program PID (parent process)
int status; ///< Child process exit status
+ int signaled_by; ///< Last signal received, if any
char ident[255]; ///< Identity of the pool task
char log_file[255]; ///< Path to stdout/stderr log file
char parent_script[PATH_MAX]; ///< Path to temporary script executing the task
+ struct {
+ struct timespec t_start;
+ struct timespec t_stop;
+ } time_data; ///< Wall-time counters
};
struct MultiProcessingPool {
@@ -104,6 +109,13 @@ struct MultiProcessingTask *mp_task(struct MultiProcessingPool *pool, const char
int mp_pool_join(struct MultiProcessingPool *pool, size_t jobs, size_t flags);
/**
+ * Show summary of pool tasks
+ *
+ * @pararm pool a pointer to MultiProcessingPool
+ */
+void mp_pool_show_summary(struct MultiProcessingPool *pool);
+
+/**
* Release resources allocated by mp_pool_init()
*
* @param a pointer to MultiProcessingPool