diff --git a/drivers/elastic.py b/drivers/elastic.py index 9b92506..0549c59 100644 --- a/drivers/elastic.py +++ b/drivers/elastic.py @@ -43,6 +43,7 @@ class Elastic_Testing(DB_Testing): driver.indices.delete(index=INDEX) def add_bulk(self, driver: Elasticsearch): + self.create_table(driver) for i in range(0, len(self.bulk_data), 1000): driver.bulk(index=INDEX, operations = '\n'.join(self.bulk_data[i:i+1000]), refresh=True) diff --git a/main.py b/main.py index 646a156..dfac1d3 100644 --- a/main.py +++ b/main.py @@ -22,8 +22,8 @@ def test_psql(): def test_elasticsearch(shards = 1): es = Elasticsearch( - 'https://127.0.0.1:9200', - api_key='RVAzeHpvOEJXTnUzZ2RiTkdWX2Q6TksySHBfaEFSWktoQmNPOFFSbm1DUQ==', + 'http://docker.tma.coe.int:9200', + api_key='YVE1VDA0OEI3c28wRGJYTUZkLW46OWFYSUQtQVhUcGVvTmlKdUtmS29Wdw==', verify_certs=False, # just to not create certificates ssl_show_warn=False ) diff --git a/plot-orodruin-opti.png b/plot-orodruin-opti.png index 6742eb1..5324314 100644 Binary files a/plot-orodruin-opti.png and b/plot-orodruin-opti.png differ diff --git a/utils/utils.py b/utils/utils.py index 3f5b3b4..394fa61 100644 --- a/utils/utils.py +++ b/utils/utils.py @@ -26,11 +26,11 @@ def time_func(name: str, function_name: str, x : Callable, repeat : Optional[int def preprocess_json(): - for x in range(0, 1): + for x in range(0, 10): with open('data.json', 'r') as f: data : dict = json.load(f) for d in data: x = Data_Thread() for k in d.keys(): x.__setattr__(k, d[k]) - Threads.append(x) \ No newline at end of file + Threads.append(x)