mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-24 22:43:05 +00:00
tests: metrics: Move metrics specific function to metrics gha-run.sh
`compress_metrics_results_dir()` is only used by the metrics GHA. Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
3ffd48bc16
commit
bd08d745f4
@ -241,20 +241,6 @@ function restart_containerd_service() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# @path_results: path to the input metric-results folder
|
|
||||||
# @tarball_fname: path and filename to the output tarball
|
|
||||||
function compress_metrics_results_dir()
|
|
||||||
{
|
|
||||||
local path_results="${1:-results}"
|
|
||||||
local tarball_fname="${2:-}"
|
|
||||||
|
|
||||||
[ -z "${tarball_fname}" ] && die "Missing the tarball filename or the path to save the tarball results is incorrect."
|
|
||||||
[ ! -d "${path_results}" ] && die "Missing path to the results folder."
|
|
||||||
|
|
||||||
cd "${path_results}" && tar -czf "${tarball_fname}" *.json && cd -
|
|
||||||
info "tarball generated: ${tarball_fname}"
|
|
||||||
}
|
|
||||||
|
|
||||||
function create_symbolic_links() {
|
function create_symbolic_links() {
|
||||||
local KATA_HYPERVISOR="${1}"
|
local KATA_HYPERVISOR="${1}"
|
||||||
|
|
||||||
|
@ -26,6 +26,20 @@ function install_checkmetrics() {
|
|||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# @path_results: path to the input metric-results folder
|
||||||
|
# @tarball_fname: path and filename to the output tarball
|
||||||
|
function compress_metrics_results_dir()
|
||||||
|
{
|
||||||
|
local path_results="${1:-results}"
|
||||||
|
local tarball_fname="${2:-}"
|
||||||
|
|
||||||
|
[ -z "${tarball_fname}" ] && die "Missing the tarball filename or the path to save the tarball results is incorrect."
|
||||||
|
[ ! -d "${path_results}" ] && die "Missing path to the results folder."
|
||||||
|
|
||||||
|
cd "${path_results}" && tar -czf "${tarball_fname}" *.json && cd -
|
||||||
|
info "tarball generated: ${tarball_fname}"
|
||||||
|
}
|
||||||
|
|
||||||
function check_metrics() {
|
function check_metrics() {
|
||||||
local cm_base_file="${checkmetrics_config_dir}/checkmetrics-json-${KATA_HYPERVISOR}-kata-metric8.toml"
|
local cm_base_file="${checkmetrics_config_dir}/checkmetrics-json-${KATA_HYPERVISOR}-kata-metric8.toml"
|
||||||
checkmetrics --debug --percentage --basefile "${cm_base_file}" --metricsdir "${results_dir}"
|
checkmetrics --debug --percentage --basefile "${cm_base_file}" --metricsdir "${results_dir}"
|
||||||
|
Loading…
Reference in New Issue
Block a user