diff --git a/Jenkinsfile b/Jenkinsfile index d9da820..39b37e7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,6 +8,9 @@ pipeline { copyArtifacts filter: 'ssr.txt', fingerprintArtifacts: true, projectName: 's421818-metrics', selector: lastSuccessful() copyArtifacts filter: 'wer.txt', fingerprintArtifacts: true, projectName: 's421818-metrics', selector: lastSuccessful() + sh('chmod 755 ./run.sh') + sh('chmod 755 ./diagrams.py') + sh('./run.sh') } } } diff --git a/diagrams.py b/diagrams.py new file mode 100644 index 0000000..4475d5c --- /dev/null +++ b/diagrams.py @@ -0,0 +1,43 @@ +import matplotlib.pyplot as plt +import sys +import re + +ssr = open("ssr.txt", "r") +wer = open("wer.txt", "r") + +reversedSSR = [] +for line in reversed(list(open("ssr.txt"))): + if (re.match('[0-9]+[\.]*[0-9]*\%', line)): + reversedSSR.append(line.replace('%','').replace('\n','')) + if (len(reversedSSR) >= 50): + break + +SSR = [] +for i in reversed(reversedSSR): + SSR.append(float(i)) + +reversedWER = [] +for line in reversed(list(open("wer.txt"))): + if (re.match('AVG: [0-9]+[\.]*[0-9]*\%', line)): + reversedWER.append(line.replace('%','').replace('\n','').replace('AVG: ','')) + if (len(reversedWER) >= 50): + break + +WER = [] +for i in reversed(reversedWER): + WER.append(float(i)) + + +plt.plot(SSR) +plt.xlabel('timeline') +plt.ylabel('ssr') +plt.savefig('ssr.png', dpi=800) +plt.close() + +plt.plot(WER) +plt.xlabel('timeline') +plt.ylabel('wer') +plt.savefig('wer.png', dpi=800) +plt.close() + + \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..996cea5 --- /dev/null +++ b/run.sh @@ -0,0 +1 @@ +python ./diagrams.py \ No newline at end of file diff --git a/ssr.png b/ssr.png new file mode 100644 index 0000000..0111a4d Binary files /dev/null and b/ssr.png differ diff --git a/wer.png b/wer.png new file mode 100644 index 0000000..3f58cf2 Binary files /dev/null and b/wer.png differ