Fix the Apache Bench Workloads Plugin
Change-Id: Idfa92de45a457569ff37fe92b8c5e314f55870df
This commit is contained in:
parent
38090ccafe
commit
6a804b679d
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
sudo yum -y update
|
sudo yum clean all
|
||||||
sudo yum install -y httpd
|
sudo yum install -y httpd
|
||||||
sudo systemctl enable httpd
|
sudo systemctl enable httpd
|
||||||
sudo systemctl start httpd
|
sudo systemctl start httpd
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from rally.common import sshutils
|
from rally.common import sshutils
|
||||||
from rally_openstack import consts
|
from rally_openstack import consts
|
||||||
from rally_openstack.scenarios.vm import utils as vm_utils
|
from rally_openstack.scenarios.vm import utils as vm_utils
|
||||||
@ -105,7 +104,7 @@ class BrowbeatApacheBench(vm_utils.VMScenario,
|
|||||||
LOG.info("Waiting for the load balancer to be active")
|
LOG.info("Waiting for the load balancer to be active")
|
||||||
self.octavia.wait_for_loadbalancer_prov_status(lb)
|
self.octavia.wait_for_loadbalancer_prov_status(lb)
|
||||||
time.sleep(90)
|
time.sleep(90)
|
||||||
lb_id = lb["loadbalancer"]["id"]
|
lb_id = lb_id = lb["id"]
|
||||||
listener_args = {
|
listener_args = {
|
||||||
"name": self.generate_random_name(),
|
"name": self.generate_random_name(),
|
||||||
"loadbalancer_id": lb_id,
|
"loadbalancer_id": lb_id,
|
||||||
@ -124,11 +123,12 @@ class BrowbeatApacheBench(vm_utils.VMScenario,
|
|||||||
"timeout_tcp_inspect": 0,
|
"timeout_tcp_inspect": 0,
|
||||||
}
|
}
|
||||||
LOG.info("Creating a listener")
|
LOG.info("Creating a listener")
|
||||||
listener = self.octavia.listener_create(**listener_args)
|
listener = self.octavia.listener_create(
|
||||||
|
json={"listener": listener_args})
|
||||||
time.sleep(30)
|
time.sleep(30)
|
||||||
LOG.info("Creating a pool")
|
LOG.info("Creating a pool")
|
||||||
pool = self.octavia.pool_create(
|
pool = self.octavia.pool_create(
|
||||||
lb_id=lb["loadbalancer"]["id"],
|
lb_id=lb["id"],
|
||||||
protocol=protocol,
|
protocol=protocol,
|
||||||
lb_algorithm=lb_algorithm,
|
lb_algorithm=lb_algorithm,
|
||||||
listener_id=listener["listener"]["id"],
|
listener_id=listener["listener"]["id"],
|
||||||
@ -150,11 +150,11 @@ class BrowbeatApacheBench(vm_utils.VMScenario,
|
|||||||
LOG.info("Adding member : {} to the pool".format(client_ip))
|
LOG.info("Adding member : {} to the pool".format(client_ip))
|
||||||
self.octavia.member_create(
|
self.octavia.member_create(
|
||||||
pool["id"],
|
pool["id"],
|
||||||
**member_args)
|
json={"member": member_args})
|
||||||
time.sleep(30)
|
time.sleep(30)
|
||||||
# execute command, stdout will have infomation
|
# execute command, stdout will have infomation
|
||||||
time.sleep(90)
|
time.sleep(90)
|
||||||
lb_ip = lb["loadbalancer"]["vip_address"]
|
lb_ip = lb["vip_address"]
|
||||||
lb_ip += "/"
|
lb_ip += "/"
|
||||||
LOG.info("Load balancer IP: {}".format(lb_ip))
|
LOG.info("Load balancer IP: {}".format(lb_ip))
|
||||||
cmd = "ab -n {} -c {} {}".format(total_requests, concurrency_level, lb_ip)
|
cmd = "ab -n {} -c {} {}".format(total_requests, concurrency_level, lb_ip)
|
||||||
@ -165,6 +165,6 @@ class BrowbeatApacheBench(vm_utils.VMScenario,
|
|||||||
self.add_output(
|
self.add_output(
|
||||||
additive={"title": "ApacheBench Stats",
|
additive={"title": "ApacheBench Stats",
|
||||||
"description": "ApacheBench Scenario",
|
"description": "ApacheBench Scenario",
|
||||||
"chart_plugin": "Gbps",
|
"chart_plugin": "StatsTable",
|
||||||
"label": "Gbps",
|
"label": "Gbps",
|
||||||
"data": report})
|
"data": report})
|
||||||
|
Loading…
Reference in New Issue
Block a user