From 9cbcb17529de0f9caa627e23f51873877920f56d Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Fri, 13 Dec 2024 18:48:11 +0400 Subject: [PATCH] cicd: fixed failing pipelines - workaround possible /sys/fs/cgroup issue - add test mertric files for Postgres 16 and 17 --- github-actions-tests/mamonsu_build.sh | 7 +- github-actions-tests/metrics.sh | 4 +- .../sources/metrics-linux-16.txt | 131 ++++++++++++++++++ .../sources/metrics-linux-17.txt | 117 ++++++++++++++++ 4 files changed, 255 insertions(+), 4 deletions(-) create mode 100644 github-actions-tests/sources/metrics-linux-16.txt create mode 100644 github-actions-tests/sources/metrics-linux-17.txt diff --git a/github-actions-tests/mamonsu_build.sh b/github-actions-tests/mamonsu_build.sh index 137e0729..777f9038 100644 --- a/github-actions-tests/mamonsu_build.sh +++ b/github-actions-tests/mamonsu_build.sh @@ -42,8 +42,9 @@ if [ "${OS%:*}" = "centos" ]; then make rpm sudo rpm -i ./mamonsu*.rpm cat /mamonsu/github-actions-tests/sources/agent_3.5.9.conf > /etc/mamonsu/agent.conf - systemctl daemon-reload - systemctl restart mamonsu + # ensuring mamonsu can actually start + sudo su -s /bin/bash -c "mamonsu bootstrap --user postgres" mamonsu + /etc/init.d/mamonsu restart sleep 5 echo && echo && echo "mamonsu version:" mamonsu --version @@ -65,6 +66,8 @@ elif [ "${OS%:*}" = "ubuntu" ]; then make deb sudo dpkg -i ./mamonsu*.deb cat /mamonsu/github-actions-tests/sources/agent_3.5.9.conf > /etc/mamonsu/agent.conf + # ensuring mamonsu can actually start + sudo su -s /bin/bash -c "mamonsu bootstrap --user postgres" mamonsu service mamonsu restart sleep 5 echo && echo && echo "mamonsu version:" diff --git a/github-actions-tests/metrics.sh b/github-actions-tests/metrics.sh index a4ebf630..5ea66946 100644 --- a/github-actions-tests/metrics.sh +++ b/github-actions-tests/metrics.sh @@ -60,12 +60,12 @@ END sleep 120 # read metric for specific version -while read metric; do +for metric in $(cat ${METRICS_FILE}); do GREP=$( mamonsu agent metric-get ${metric} | grep "pgsql\|sys\|mamonsu" ) if [ -z "$GREP" ]; then echo "---> ERROR: Cannot found metric $metric" exit 11 fi -done <"${METRICS_FILE}" +done echo && echo diff --git a/github-actions-tests/sources/metrics-linux-16.txt b/github-actions-tests/sources/metrics-linux-16.txt new file mode 100644 index 00000000..fa72080f --- /dev/null +++ b/github-actions-tests/sources/metrics-linux-16.txt @@ -0,0 +1,131 @@ +mamonsu.memory.rss[max] +mamonsu.plugin.errors[] +mamonsu.plugin.keepalive[] +pgsql.archive_command[archived_files] +pgsql.archive_command[count_files_to_archive] +pgsql.archive_command[failed_trying_to_archive] +pgsql.archive_command[size_files_to_archive] +pgsql.autovacuum.count[] +pgsql.autovacuum.utilization[] +pgsql.bgwriter[buffers_alloc] +pgsql.bgwriter[buffers_backend] +pgsql.bgwriter[buffers_backend_fsync] +pgsql.bgwriter[buffers_checkpoint] +pgsql.bgwriter[buffers_clean] +pgsql.bgwriter[maxwritten_clean] +pgsql.blocks[hit] +pgsql.blocks[read] +pgsql.checkpoint[checkpoint_sync_time] +pgsql.checkpoint[count_timed] +pgsql.checkpoint[count_wal] +pgsql.checkpoint[write_time] +pgsql.connections[active] +pgsql.connections[disabled] +pgsql.connections[fastpath_function_call] +pgsql.connections[idle] +pgsql.connections[idle_in_transaction] +pgsql.connections[idle_in_transaction_aborted] +pgsql.connections[max_connections] +pgsql.connections[other] +pgsql.connections[total] +pgsql.connections[waiting] +pgsql.database.discovery[] +pgsql.database.bloating_tables[mamonsu_test_db] +pgsql.database.bloating_tables[postgres] +pgsql.database.invalid_indexes[mamonsu_test_db] +pgsql.database.invalid_indexes[postgres] +pgsql.database.max_age[mamonsu_test_db] +pgsql.database.max_age[postgres] +pgsql.database.size[mamonsu_test_db] +pgsql.database.size[postgres] +pgsql.events[checksum_failures] +pgsql.events[conflicts] +pgsql.events[deadlocks] +pgsql.events[xact_rollback] +pgsql.memory_leak_diagnostic.count_diff[] +pgsql.memory_leak_diagnostic.msg_text[] +pgsql.oldest[transaction_time] +pgsql.oldest[xid_age] +pgsql.ping[] +pgsql.pg_locks[accessexclusive] +pgsql.pg_locks[accessshare] +pgsql.pg_locks[exclusive] +pgsql.pg_locks[rowexclusive] +pgsql.pg_locks[rowshare] +pgsql.pg_locks[share] +pgsql.pg_locks[sharerowexclusive] +pgsql.pg_locks[shareupdateexclusive] +pgsql.parallel[queries] +pgsql.prepared.count +pgsql.prepared.oldest +pgsql.relation.size[] +pgsql.relation.size[mamonsu_test_db.mamonsu.config] +pgsql.relation.size[postgres.pg_catalog.pg_class] +pgsql.replication.non_active_slots[] +pgsql.replication_lag[sec] +pgsql.replication_lag[sec] +pgsql.stat[dirty_bytes] +pgsql.stat[other_time] +pgsql.stat[read_bytes] +pgsql.stat[read_time] +pgsql.stat[wal_bytes] +pgsql.stat[wal_fpi] +pgsql.stat[wal_records] +pgsql.stat[write_bytes] +pgsql.stat[write_time] +pgsql.stat_info[dealloc] +pgsql.stat_info[stats_reset] +pgsql.temp[bytes] +pgsql.temp[files] +pgsql.transactions[committed] +pgsql.tuples[deleted] +pgsql.tuples[fetched] +pgsql.tuples[inserted] +pgsql.tuples[returned] +pgsql.tuples[updated] +pgsql.uptime[] +pgsql.wal.buffers_full[] +pgsql.wal.count[] +pgsql.wal.fpi.count[] +pgsql.wal.records.count[] +pgsql.wal.sync_time[] +pgsql.wal.write[] +pgsql.wal.write_time[] +system.cpu[idle] +system.cpu[iowait] +system.cpu[irq] +system.cpu[nice] +system.cpu[softirq] +system.cpu[system] +system.cpu[user] +system.disk.discovery[] +system.disk.all_read[] +system.disk.all_write[] +system.disk.all_read_b[] +system.disk.all_write_b[] +system.la[1] +system.memory[active] +system.memory[available] +system.memory[buffers] +system.memory[cached] +system.memory[committed] +system.memory[inactive] +system.memory[mapped] +system.memory[page_tables] +system.memory[slab] +system.memory[swap] +system.memory[swap_cache] +system.memory[total] +system.memory[vmalloc_used] +system.memory[unused] +system.memory[used] +system.net.discovery[] +system.open_files[] +system.processes[blocked] +system.processes[forkrate] +system.processes[running] +system.vfs.discovery[] +system.vfs.free[/] +system.vfs.percent_free[/] +system.vfs.percent_inode_free[/] +system.vfs.used[/] diff --git a/github-actions-tests/sources/metrics-linux-17.txt b/github-actions-tests/sources/metrics-linux-17.txt new file mode 100644 index 00000000..38630dc2 --- /dev/null +++ b/github-actions-tests/sources/metrics-linux-17.txt @@ -0,0 +1,117 @@ +mamonsu.memory.rss[max] +mamonsu.plugin.errors[] +mamonsu.plugin.keepalive[] +pgsql.archive_command[archived_files] +pgsql.archive_command[count_files_to_archive] +pgsql.archive_command[failed_trying_to_archive] +pgsql.archive_command[size_files_to_archive] +pgsql.autovacuum.count[] +pgsql.autovacuum.utilization[] +pgsql.bgwriter[buffers_alloc] +pgsql.bgwriter[buffers_clean] +pgsql.bgwriter[maxwritten_clean] +pgsql.blocks[hit] +pgsql.blocks[read] +pgsql.checkpoint[checkpoint_sync_time] +pgsql.checkpoint[count_timed] +pgsql.checkpoint[count_wal] +pgsql.checkpoint[write_time] +pgsql.connections[active] +pgsql.connections[disabled] +pgsql.connections[fastpath_function_call] +pgsql.connections[idle] +pgsql.connections[idle_in_transaction] +pgsql.connections[idle_in_transaction_aborted] +pgsql.connections[max_connections] +pgsql.connections[other] +pgsql.connections[total] +pgsql.connections[waiting] +pgsql.database.discovery[] +pgsql.database.bloating_tables[mamonsu_test_db] +pgsql.database.bloating_tables[postgres] +pgsql.database.invalid_indexes[mamonsu_test_db] +pgsql.database.invalid_indexes[postgres] +pgsql.database.max_age[mamonsu_test_db] +pgsql.database.max_age[postgres] +pgsql.database.size[mamonsu_test_db] +pgsql.database.size[postgres] +pgsql.events[checksum_failures] +pgsql.events[conflicts] +pgsql.events[deadlocks] +pgsql.events[xact_rollback] +pgsql.memory_leak_diagnostic.count_diff[] +pgsql.memory_leak_diagnostic.msg_text[] +pgsql.oldest[transaction_time] +pgsql.oldest[xid_age] +pgsql.ping[] +pgsql.pg_locks[accessexclusive] +pgsql.pg_locks[accessshare] +pgsql.pg_locks[exclusive] +pgsql.pg_locks[rowexclusive] +pgsql.pg_locks[rowshare] +pgsql.pg_locks[share] +pgsql.pg_locks[sharerowexclusive] +pgsql.pg_locks[shareupdateexclusive] +pgsql.parallel[queries] +pgsql.prepared.count +pgsql.prepared.oldest +pgsql.relation.size[] +pgsql.relation.size[mamonsu_test_db.mamonsu.config] +pgsql.relation.size[postgres.pg_catalog.pg_class] +pgsql.replication.non_active_slots[] +pgsql.replication_lag[sec] +pgsql.replication_lag[sec] +pgsql.temp[bytes] +pgsql.temp[files] +pgsql.transactions[committed] +pgsql.tuples[deleted] +pgsql.tuples[fetched] +pgsql.tuples[inserted] +pgsql.tuples[returned] +pgsql.tuples[updated] +pgsql.uptime[] +pgsql.wal.buffers_full[] +pgsql.wal.count[] +pgsql.wal.fpi.count[] +pgsql.wal.records.count[] +pgsql.wal.sync_time[] +pgsql.wal.write[] +pgsql.wal.write_time[] +system.cpu[idle] +system.cpu[iowait] +system.cpu[irq] +system.cpu[nice] +system.cpu[softirq] +system.cpu[system] +system.cpu[user] +system.disk.discovery[] +system.disk.all_read[] +system.disk.all_write[] +system.disk.all_read_b[] +system.disk.all_write_b[] +system.la[1] +system.memory[active] +system.memory[available] +system.memory[buffers] +system.memory[cached] +system.memory[committed] +system.memory[inactive] +system.memory[mapped] +system.memory[page_tables] +system.memory[slab] +system.memory[swap] +system.memory[swap_cache] +system.memory[total] +system.memory[vmalloc_used] +system.memory[unused] +system.memory[used] +system.net.discovery[] +system.open_files[] +system.processes[blocked] +system.processes[forkrate] +system.processes[running] +system.vfs.discovery[] +system.vfs.free[/] +system.vfs.percent_free[/] +system.vfs.percent_inode_free[/] +system.vfs.used[/]