From 9dd9c2ec2e0e0f34db95d9650ea253c147f8c7d3 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 11 Jan 2022 00:19:35 +0100 Subject: zfs/syncoid: add duration of job to prometheus metrics --- roles/storage/zfs/syncoid/templates/syncoid_pull.j2 | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'roles/storage/zfs/syncoid/templates/syncoid_pull.j2') diff --git a/roles/storage/zfs/syncoid/templates/syncoid_pull.j2 b/roles/storage/zfs/syncoid/templates/syncoid_pull.j2 index ab6c3116..d54683c5 100644 --- a/roles/storage/zfs/syncoid/templates/syncoid_pull.j2 +++ b/roles/storage/zfs/syncoid/templates/syncoid_pull.j2 @@ -16,6 +16,12 @@ if [ -n "$1" ]; then shift fi +if [ -n "$RUNTIME_DIRECTORY" ]; then + if [ ! -e "$RUNTIME_DIRECTORY/start" ]; then + date +"%s" > "$RUNTIME_DIRECTORY/start" + fi +fi + /usr/sbin/syncoid --sshoption "UserKnownHostsFile=/var/lib/syncoid/ssh.knownhosts" --sshoption "HashKnownHosts=no" --sshkey "/var/lib/syncoid/id_ssh_ed25519" --no-sync-snap --compress zstd-fast "$@" "$src_host:$src_path" "$dest_path" ret=$? -- cgit v1.2.3