Skip to content
This repository was archived by the owner on Jun 26, 2024. It is now read-only.

Commit 2003872

Browse files
authored
Added metadata with performance kpi data upload (#1363)
1 parent a71357e commit 2003872

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

test/performance/collect-kpi.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ NS_PREFIX=${NS_PREFIX:-entanglement}
1616

1717
SBO_METRICS=$(find $METRICS -type f -name 'pod-info.service-binding-operator-*.csv')
1818

19+
SBO_VERSION=$(make operator-version --no-print-directory)
20+
OPENSHIFT_RELEASE=$(oc version -o yaml | yq e '.openshiftVersion')
21+
OPENSHIFT_VERSION=$(oc version -o yaml | yq e '.openshiftVersion' | grep -oP '^\d{1,2}.\d{1,2}.\d{1,2}')
22+
RUN_TYPE=${RUN_TYPE:-default}
23+
PULL_NUMBER=${PULL_NUMBER:-n/a}
24+
PULL_PULL_SHA=${PULL_PULL_SHA:-n/a}
25+
1926
SCENARIOS="nosb-inv nosb-val sb-inc sb-inv sb-val"
2027
#SCENARIOS="nosb-val"
2128

@@ -52,3 +59,11 @@ for scenario in $SCENARIOS; do
5259
cat $output >>$kpi_yaml
5360
done
5461
done
62+
63+
echo "execution_timestamp: $(date +%F\ %T)" >>$kpi_yaml
64+
echo "sbo_version: $SBO_VERSION" >>$kpi_yaml
65+
echo "openshift_version: $OPENSHIFT_VERSION" >>$kpi_yaml
66+
echo "openshift_release: $OPENSHIFT_RELEASE" >>$kpi_yaml
67+
echo "run_type: $RUN_TYPE" >>$kpi_yaml
68+
echo "pull_number: $PULL_NUMBER" >> $kpi_yaml
69+
echo "commit_id: ${PULL_PULL_SHA}" >> $kpi_yaml

test/performance/upload_data.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,16 @@ def read_metric_data(file_name):
9898
""" Read from the metrics file and construct the document """
9999
with open(file_name, encoding="utf-8") as file_d:
100100
content = yaml.load(file_d, Loader=yaml.FullLoader)
101-
kpi_data = content['kpi']
101+
102+
kpi_data = content['kpi']
103+
execution_timestamp = content['execution_timestamp']
104+
sbo_version = content['sbo_version']
105+
openshift_version = content['openshift_version']
106+
openshift_release = content['openshift_release']
107+
run_type = content['run_type']
108+
pull_number = content['pull_number']
109+
commit_id = content['commit_id']
110+
102111
for data in kpi_data:
103112
if data['name'] == 'usage':
104113
for metric in data['metrics']:
@@ -117,7 +126,14 @@ def read_metric_data(file_name):
117126
'memory_average_threshold': get_average_threshold_mem(),
118127
'memory_maximum_threshold': get_maximum_threshold_mem(),
119128
'cpu_average_threshold': get_average_threshold_cpu(),
120-
'cpu_maximum_threshold': get_maximum_threshold_cpu()}
129+
'cpu_maximum_threshold': get_maximum_threshold_cpu(),
130+
'run_type': run_type,
131+
'pull_number': pull_number,
132+
'commit_id': commit_id,
133+
'execution_timestamp': execution_timestamp,
134+
'sbo_version': sbo_version,
135+
'openshift_version': openshift_version,
136+
'openshift_release': openshift_release}
121137

122138

123139
def generate_id():

0 commit comments

Comments
 (0)