make metadata indexing optional

while indexing the rally results to ES make the metadata indexing
optional.

now we can remove the metadata field in browbeat-config.yml and
disable the metadata indexing.

Change-Id: I68fcf4153f79bc321d920203525fea228fa0e996
This commit is contained in:
Masco
2024-10-07 13:25:19 +05:30
parent 58f4d9316b
commit 11c80c02b3
3 changed files with 16 additions and 18 deletions

View File

@@ -73,9 +73,7 @@ class Elastic(object):
return json_data return json_data
def combine_metadata(self, result): def combine_metadata(self, result):
if (self.config['elasticsearch']['metadata_files'] is not None and meta = self.config['elasticsearch'].get('metadata_files', []) or []
len(self.config['elasticsearch']['metadata_files']) > 0):
meta = self.config['elasticsearch']['metadata_files']
for _meta in meta: for _meta in meta:
try: try:
with open(_meta['file']) as jdata: with open(_meta['file']) as jdata:

View File

@@ -62,7 +62,7 @@ mapping:
required: True required: True
metadata_files: metadata_files:
type: seq type: seq
required: True required: False
sequence: sequence:
- type: map - type: map
mapping: mapping:

View File

@@ -70,7 +70,7 @@ class Tools(object):
workloads.run_workload(copy.deepcopy(workload), run_iteration) workloads.run_workload(copy.deepcopy(workload), run_iteration)
def check_metadata(self): def check_metadata(self):
meta = self.config['elasticsearch']['metadata_files'] meta = self.config['elasticsearch'].get('metadata_files', []) or []
for _meta in meta: for _meta in meta:
if not os.path.isfile(_meta['file']): if not os.path.isfile(_meta['file']):
self.logger.info( self.logger.info(