Skip to content

Commit

Permalink
Update probe interval
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Qiu <[email protected]>
  • Loading branch information
wenqiq committed Feb 23, 2024
1 parent 9664031 commit a7cd85c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/performance/framework/client_pod/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func Update(ctx context.Context, kClient kubernetes.Interface, ns, clientDaemonS
containers = append(containers, corev1.Container{
Name: containerName,
Image: "busybox",
Command: []string{"/bin/sh", "-c", fmt.Sprintf("server=%s; output_file=\"ping_log.txt\"; if [ ! -e \"$output_file\" ]; then touch \"$output_file\"; fi; last_status=\"unknown\"; last_change_time=$(date +%%s); while true; do status=$(nc -vz -w 1 \"$server\" %s > /dev/null && echo \"up\" || echo \"down\"); current_time=$(date +%%s); time_diff=$((current_time - last_change_time)); if [ \"$status\" != \"$last_status\" ]; then echo \"Status changed from $last_status to $status after ${time_diff} seconds\"; echo \"Status changed from $last_status to $status after ${time_diff} seconds\" >> \"$output_file\"; last_change_time=$current_time; last_status=$status; fi; sleep 0.3; done\n", server, port)},
Command: []string{"/bin/sh", "-c", fmt.Sprintf("server=%s; output_file=\"ping_log.txt\"; if [ ! -e \"$output_file\" ]; then touch \"$output_file\"; fi; last_status=\"unknown\"; last_change_time=$(date +%%s); while true; do status=$(nc -vz -w 1 \"$server\" %s > /dev/null && echo \"up\" || echo \"down\"); current_time=$(date +%%s); time_diff=$((current_time - last_change_time)); if [ \"$status\" != \"$last_status\" ]; then echo \"$(date) Status changed from $last_status to $status after ${time_diff} seconds\"; echo \"$(date) Status changed from $last_status to $status after ${time_diff} seconds\" >> \"$output_file\"; last_change_time=$current_time; last_status=$status; fi; sleep 0.1; done\n", server, port)},
ImagePullPolicy: corev1.PullIfNotPresent,
Env: []corev1.EnvVar{
{
Expand Down
6 changes: 3 additions & 3 deletions test/performance/framework/service/scale_up.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ func ScaleUp(ctx context.Context, kubeConfig *rest.Config, cs kubernetes.Interfa
for i, ns := range nss {

klog.InfoS("Scale up Services", "Namespace", ns)
for _, svc := range generateService(ns, numPerNs) {
for j, svc := range generateService(ns, numPerNs) {
if ipv6 {
ipFamily := corev1.IPv6Protocol
svc.Spec.IPFamilies = []corev1.IPFamily{ipFamily}
}
if err := utils.DefaultRetry(func() error {
clusterIP := startSvcCIDR + strconv.Itoa(i+1)
clusterIP := startSvcCIDR + strconv.Itoa(i*numPerNs+j+1)

var podList *corev1.PodList
podList, err = cs.CoreV1().Pods(ns).List(ctx, metav1.ListOptions{})
Expand All @@ -137,7 +137,7 @@ func ScaleUp(ctx context.Context, kubeConfig *rest.Config, cs kubernetes.Interfa
fromPod := podList.Items[testPodIndex]
testPodIndex++

if err = workload_pod.Update(ctx, cs, fromPod.Namespace, fromPod.Name, []string{fmt.Sprintf("%s:%d", clusterIP, 80)}, workload_pod.ScaleClientPodProbeContainerName); err != nil {
if err = workload_pod.Update(ctx, cs, fromPod.Namespace, fromPod.Name, []string{fmt.Sprintf("%s:%d", clusterIP, 80)}, workload_pod.ScaleTestPodProbeContainerName); err != nil {
klog.ErrorS(err, "Update test Pod failed")
}
klog.InfoS("Update test Pod to check Service", "ClusterIP", clusterIP)
Expand Down
3 changes: 2 additions & 1 deletion test/performance/framework/workload_pod/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

const (
ScaleClientPodProbeContainerName = "antrea-scale-test-client-pod-probe"
ScaleTestPodProbeContainerName = "antrea-scale-test-pod-probe"
)

func Update(ctx context.Context, kClient kubernetes.Interface, namespace, podName string, probes []string, containerName string) error {
Expand All @@ -37,7 +38,7 @@ func Update(ctx context.Context, kClient kubernetes.Interface, namespace, podNam
containers = append(containers, corev1.Container{
Name: containerName,
Image: "busybox",
Command: []string{"/bin/sh", "-c", fmt.Sprintf("server=%s; output_file=\"ping_log.txt\"; if [ ! -e \"$output_file\" ]; then touch \"$output_file\"; fi; last_status=\"unknown\"; last_change_time=$(date +%%s); while true; do status=$(nc -vz -w 1 \"$server\" %s > /dev/null && echo \"up\" || echo \"down\"); current_time=$(date +%%s); time_diff=$((current_time - last_change_time)); if [ \"$status\" != \"$last_status\" ]; then echo \"Status changed from $last_status to $status after ${time_diff} seconds\"; echo \"Status changed from $last_status to $status after ${time_diff} seconds\" >> \"$output_file\"; last_change_time=$current_time; last_status=$status; fi; sleep 0.3; done\n", server, port)},
Command: []string{"/bin/sh", "-c", fmt.Sprintf("server=%s; output_file=\"ping_log.txt\"; if [ ! -e \"$output_file\" ]; then touch \"$output_file\"; fi; last_status=\"unknown\"; last_change_time=$(date +%%s); while true; do status=$(nc -vz -w 1 \"$server\" %s > /dev/null && echo \"up\" || echo \"down\"); current_time=$(date +%%s); time_diff=$((current_time - last_change_time)); if [ \"$status\" != \"$last_status\" ]; then echo \"$(date) Status changed from $last_status to $status after ${time_diff} seconds\"; echo \"$(date) Status changed from $last_status to $status after ${time_diff} seconds\" >> \"$output_file\"; last_change_time=$current_time; last_status=$status; fi; sleep 0.1; done\n", server, port)},
ImagePullPolicy: corev1.PullIfNotPresent,
Env: []corev1.EnvVar{
{
Expand Down

0 comments on commit a7cd85c

Please sign in to comment.