Exemplo n.º 1
0
    def __init__(self, node_selector=constants.SCALE_NODE_SELECTOR, **kwargs):
        """
        Initializer function

        """
        super().__init__(**kwargs)
        Postgresql.deploy(self)
        self._node_selector = node_selector
Exemplo n.º 2
0
    def __init__(self, **kwargs):
        """
        - Initializer function
        - Deploys Benchmark Operator

        """
        super().__init__(**kwargs)
        Postgresql.deploy(self)
Exemplo n.º 3
0
 def setup_postgresql(self, replicas, node_selector=None):
     # Node selector for postgresql
     pgsql_sset = templating.load_yaml(constants.PGSQL_STATEFULSET_YAML)
     if node_selector is not None:
         pgsql_sset["spec"]["template"]["spec"][
             "nodeSelector"] = node_selector
     if helpers.storagecluster_independent_check():
         pgsql_sset["spec"]["volumeClaimTemplates"][0]["metadata"][
             "annotations"][
                 "volume.beta.kubernetes.io/storage-class"] = constants.DEFAULT_EXTERNAL_MODE_STORAGECLASS_RBD
     Postgresql.setup_postgresql(self, replicas=replicas)
Exemplo n.º 4
0
 def _create_pgbench_benchmark(self,
                               replicas,
                               clients=None,
                               threads=None,
                               transactions=None,
                               scaling_factor=None,
                               timeout=None):
     Postgresql.create_pgbench_benchmark(self,
                                         replicas,
                                         clients=clients,
                                         threads=threads,
                                         transactions=transactions,
                                         scaling_factor=scaling_factor,
                                         timeout=timeout)
Exemplo n.º 5
0
    def validate_pgbench_perf(self, pgbench_pods):
        """
        Processing the pod output and prints latency,tps in
        table format for all the pods

        """
        pgbench_pods_output = Postgresql.validate_pgbench_run(self,
                                                              pgbench_pods,
                                                              print_table=True)
        tps_latency_table = PrettyTable()
        tps_latency_table.field_names = [
            "pod_name",
            "latency_avg",
            "lat_stddev",
            "tps_incl",
            "tps_excl",
        ]
        # Taking transaction per second and latency information
        for pgbench_pod_out in pgbench_pods_output:
            for pod_output in pgbench_pod_out[0]:
                for pod in pod_output.values():
                    tps_latency_table.add_row([
                        pgbench_pod_out[1],
                        pod["latency_avg"],
                        pod["lat_stddev"],
                        pod["tps_incl"],
                        pod["tps_excl"],
                    ])
        log.info("*********Latency and TPS*********")
        log.info(f"\n{tps_latency_table}\n")
Exemplo n.º 6
0
def pgsql(request):

    pgsql = Postgresql()

    def teardown():
        pgsql.cleanup()
    request.addfinalizer(teardown)
    return pgsql
Exemplo n.º 7
0
    def cleanup(self):
        # Cleanup postgresql
        Postgresql.cleanup(self)

        # Remove scale label and delete machineset
        delete_worker_node()
Exemplo n.º 8
0
 def _validate_pgbench_run(self, pgbench_pods, print_table=True):
     Postgresql.validate_pgbench_run(self, pgbench_pods, print_table=True)
Exemplo n.º 9
0
 def _get_pgbench_pods(self):
     Postgresql.get_pgbench_pods()
Exemplo n.º 10
0
 def _wait_for_pgbench_status(self, status, timeout=None):
     Postgresql.wait_for_postgres_status(self,
                                         status=status,
                                         timeout=timeout)
Exemplo n.º 11
0
 def apply_crd(self, crd):
     Postgresql.apply_crd(self, crd=crd)
Exemplo n.º 12
0
 def _cleanup(self):
     # Cleanup postgresql and pgbench pods
     Postgresql.cleanup(self)
Exemplo n.º 13
0
 def _setup_postgresql(self, replicas):
     Postgresql.setup_postgresql(self, replicas=replicas)