diff --git a/dev/scripts/docker.sh b/dev/scripts/docker.sh index da8260f0c..1caf83667 100644 --- a/dev/scripts/docker.sh +++ b/dev/scripts/docker.sh @@ -14,4 +14,6 @@ function build_kubectl_bats() { echo "-----------------------------------------------------------------------------------------------------" cd "${DOCKERFILE_DIR}/kubectl-bats" && docker build -t "${KUBECTL_BATS_IMAGE}" . kind load docker-image "${KUBECTL_BATS_IMAGE}" -n "${CLUSTER_NAME}" + + log_time "build_kubectl_bats" } \ No newline at end of file diff --git a/dev/scripts/gateway.sh b/dev/scripts/gateway.sh index 5ac81f032..0817a2c10 100644 --- a/dev/scripts/gateway.sh +++ b/dev/scripts/gateway.sh @@ -21,6 +21,8 @@ function deploy_haproxy_ingress() { echo "HAProxy Ingress Controller is already installed" echo "" fi + + log_time "deploy_haproxy_ingress" } function destroy_haproxy_ingress() { @@ -40,6 +42,8 @@ function destroy_haproxy_ingress() { echo "HAProxy Ingress Controller is uninstalled" echo "" + + log_time "destroy_haproxy_ingress" } function deploy_gateway_api_crd() { @@ -81,6 +85,8 @@ function deploy_envoy_gateway_api() { fi get_gateway_status + + log_time "deploy_envoy_gateway_api" } function get_gateway_status() { @@ -116,6 +122,8 @@ function destroy_envoy_gateway_api() { echo "Envoy Gateway API is uninstalled" echo "" + + log_time "destroy_envoy_gateway_api" } function uninstall_crd() { @@ -129,6 +137,8 @@ function uninstall_crd() { kubectl delete crd "${name}" done fi + + log_time "uninstall_crd" } function expose_envoy_gateway_svc() { @@ -145,6 +155,8 @@ function expose_envoy_gateway_svc() { echo "Exposing Envoy Gateway Service: ${ENVOY_SERVICE} on ${local_port}:${gateway_port}" echo "-----------------------------------------------------------------------------------------------------" kubectl port-forward "svc/${ENVOY_SERVICE}" -n envoy-gateway-system "${local_port}":"${gateway_port}" & + + log_time "expose_envoy_gateway_svc" } function unexpose_envoy_gateway_svc() { @@ -157,6 +169,8 @@ function unexpose_envoy_gateway_svc() { echo "-----------------------------------------------------------------------------------------------------" kill "${GATEWAY_SVC_PID}" &>/dev/null || true fi + + log_time "unexpose_envoy_gateway_svc" } function test_http_route() { @@ -195,6 +209,8 @@ function test_http_route() { echo "-----------------------------------------------------------------------------------------------------" unexpose_envoy_gateway_svc || true kubectl delete -f "${GATEWAY_API_DIR}/http-debug.yaml" + + log_time "test_http_route" } function test_grpc_route() { @@ -232,6 +248,8 @@ function test_grpc_route() { echo "-----------------------------------------------------------------------------------------------------" unexpose_envoy_gateway_svc || true kubectl delete -f "${GATEWAY_API_DIR}/grpc-debug.yaml" + + log_time "test_grpc_route" } function test_tcp_route() { @@ -266,4 +284,6 @@ function test_tcp_route() { rm deleteme.txt unexpose_envoy_gateway_svc || true kubectl delete -f "${GATEWAY_API_DIR}/tcp-debug.yaml" + + log_time "test_tcp_route" } diff --git a/dev/scripts/telemetry.sh b/dev/scripts/telemetry.sh index 15a258300..310be5d24 100644 --- a/dev/scripts/telemetry.sh +++ b/dev/scripts/telemetry.sh @@ -18,6 +18,8 @@ function fetch-prometheus-operator-bundle() { [[ "${status}" != 0 ]] && rm "${PROMETHEUS_OPERATOR_YAML}" && echo "ERROR: Failed to fetch prometheus bundle" return "${status}" fi + + log_time "fetch-prometheus-operator-bundle" } function deploy-prometheus-operator() { @@ -36,6 +38,8 @@ function deploy-prometheus-operator() { echo "Prometheus operator CRD is already installed" echo "" fi + + log_time "deploy-prometheus-operator" } function destroy-prometheus-operator() { @@ -45,6 +49,8 @@ function destroy-prometheus-operator() { echo "-----------------------------------------------------------------------------------------------------" kubectl delete -f "${PROMETHEUS_OPERATOR_YAML}" sleep 10 + + log_time "destroy-prometheus-operator" } function deploy-prometheus() { @@ -77,6 +83,8 @@ function deploy-prometheus() { echo "Waiting for prometheus to be active (timeout 300s)..." kubectl wait --for=condition=Ready pods -l app.kubernetes.io/name=prometheus --timeout 300s -n "${NAMESPACE}" + + log_time "deploy-prometheus" } function destroy-prometheus() { @@ -89,6 +97,8 @@ function destroy-prometheus() { kubectl delete -f "${PROMETHEUS_RBAC_YAML}" || true kubectl delete clusterrolebindings prometheus || true sleep 5 + + log_time "destroy-prometheus" } function deploy-prometheus-example-app() { @@ -143,6 +153,8 @@ function deploy_grafana_tempo() { helm upgrade -f "${TELEMETRY_DIR}/grafana/grafana-values.yaml" --install grafana grafana/grafana echo "Waiting for grafana to be active (timeout 300s)..." kubectl wait --for=jsonpath='{.status.phase}'=Running pod -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana" --timeout=300s + + log_time "deploy_grafana_tempo" } function destroy_grafana_tempo() {