commit d5ad63e541908193ddb0827493476317fd3a9592 Author: Jelena Dokic Date: Wed Feb 12 12:39:01 2020 +0100 results table diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4029495 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/output \ No newline at end of file diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..d29715a --- /dev/null +++ b/Pipfile @@ -0,0 +1,14 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] + +[packages] +plotly = "*" +numpy = "*" +scipy = "*" + +[requires] +python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..c22bcbd --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,96 @@ +{ + "_meta": { + "hash": { + "sha256": "53ce4f271567869b3767a555f892d785cfc0ea880bc53ac577429707beff9a26" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.8" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "numpy": { + "hashes": [ + "sha256:1786a08236f2c92ae0e70423c45e1e62788ed33028f94ca99c4df03f5be6b3c6", + "sha256:17aa7a81fe7599a10f2b7d95856dc5cf84a4eefa45bc96123cbbc3ebc568994e", + "sha256:20b26aaa5b3da029942cdcce719b363dbe58696ad182aff0e5dcb1687ec946dc", + "sha256:2d75908ab3ced4223ccba595b48e538afa5ecc37405923d1fea6906d7c3a50bc", + "sha256:39d2c685af15d3ce682c99ce5925cc66efc824652e10990d2462dfe9b8918c6a", + "sha256:56bc8ded6fcd9adea90f65377438f9fea8c05fcf7c5ba766bef258d0da1554aa", + "sha256:590355aeade1a2eaba17617c19edccb7db8d78760175256e3cf94590a1a964f3", + "sha256:70a840a26f4e61defa7bdf811d7498a284ced303dfbc35acb7be12a39b2aa121", + "sha256:77c3bfe65d8560487052ad55c6998a04b654c2fbc36d546aef2b2e511e760971", + "sha256:9537eecf179f566fd1c160a2e912ca0b8e02d773af0a7a1120ad4f7507cd0d26", + "sha256:9acdf933c1fd263c513a2df3dceecea6f3ff4419d80bf238510976bf9bcb26cd", + "sha256:ae0975f42ab1f28364dcda3dde3cf6c1ddab3e1d4b2909da0cb0191fa9ca0480", + "sha256:b3af02ecc999c8003e538e60c89a2b37646b39b688d4e44d7373e11c2debabec", + "sha256:b6ff59cee96b454516e47e7721098e6ceebef435e3e21ac2d6c3b8b02628eb77", + "sha256:b765ed3930b92812aa698a455847141869ef755a87e099fddd4ccf9d81fffb57", + "sha256:c98c5ffd7d41611407a1103ae11c8b634ad6a43606eca3e2a5a269e5d6e8eb07", + "sha256:cf7eb6b1025d3e169989416b1adcd676624c2dbed9e3bcb7137f51bfc8cc2572", + "sha256:d92350c22b150c1cae7ebb0ee8b5670cc84848f6359cf6b5d8f86617098a9b73", + "sha256:e422c3152921cece8b6a2fb6b0b4d73b6579bd20ae075e7d15143e711f3ca2ca", + "sha256:e840f552a509e3380b0f0ec977e8124d0dc34dc0e68289ca28f4d7c1d0d79474", + "sha256:f3d0a94ad151870978fb93538e95411c83899c9dc63e6fb65542f769568ecfa5" + ], + "index": "pypi", + "version": "==1.18.1" + }, + "plotly": { + "hashes": [ + "sha256:a19ed783bcf094e6207b3699ab261465bf3c7d299403678801de634bf17e2559", + "sha256:bb5271f648913cf330a0de4ede3084cda848f8ad8b080330a0678e1b21df97b0" + ], + "index": "pypi", + "version": "==4.5.0" + }, + "retrying": { + "hashes": [ + "sha256:08c039560a6da2fe4f2c426d0766e284d3b736e355f8dd24b37367b0bb41973b" + ], + "version": "==1.3.3" + }, + "scipy": { + "hashes": [ + "sha256:00af72998a46c25bdb5824d2b729e7dabec0c765f9deb0b504f928591f5ff9d4", + "sha256:0902a620a381f101e184a958459b36d3ee50f5effd186db76e131cbefcbb96f7", + "sha256:1e3190466d669d658233e8a583b854f6386dd62d655539b77b3fa25bfb2abb70", + "sha256:2cce3f9847a1a51019e8c5b47620da93950e58ebc611f13e0d11f4980ca5fecb", + "sha256:3092857f36b690a321a662fe5496cb816a7f4eecd875e1d36793d92d3f884073", + "sha256:386086e2972ed2db17cebf88610aab7d7f6e2c0ca30042dc9a89cf18dcc363fa", + "sha256:71eb180f22c49066f25d6df16f8709f215723317cc951d99e54dc88020ea57be", + "sha256:770254a280d741dd3436919d47e35712fb081a6ff8bafc0f319382b954b77802", + "sha256:787cc50cab3020a865640aba3485e9fbd161d4d3b0d03a967df1a2881320512d", + "sha256:8a07760d5c7f3a92e440ad3aedcc98891e915ce857664282ae3c0220f3301eb6", + "sha256:8d3bc3993b8e4be7eade6dcc6fd59a412d96d3a33fa42b0fa45dc9e24495ede9", + "sha256:9508a7c628a165c2c835f2497837bf6ac80eb25291055f56c129df3c943cbaf8", + "sha256:a144811318853a23d32a07bc7fd5561ff0cac5da643d96ed94a4ffe967d89672", + "sha256:a1aae70d52d0b074d8121333bc807a485f9f1e6a69742010b33780df2e60cfe0", + "sha256:a2d6df9eb074af7f08866598e4ef068a2b310d98f87dc23bd1b90ec7bdcec802", + "sha256:bb517872058a1f087c4528e7429b4a44533a902644987e7b2fe35ecc223bc408", + "sha256:c5cac0c0387272ee0e789e94a570ac51deb01c796b37fb2aad1fb13f85e2f97d", + "sha256:cc971a82ea1170e677443108703a2ec9ff0f70752258d0e9f5433d00dda01f59", + "sha256:dba8306f6da99e37ea08c08fef6e274b5bf8567bb094d1dbe86a20e532aca088", + "sha256:dc60bb302f48acf6da8ca4444cfa17d52c63c5415302a9ee77b3b21618090521", + "sha256:dee1bbf3a6c8f73b6b218cb28eed8dd13347ea2f87d572ce19b289d6fd3fbc59" + ], + "index": "pypi", + "version": "==1.4.1" + }, + "six": { + "hashes": [ + "sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a", + "sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c" + ], + "version": "==1.14.0" + } + }, + "develop": {} +} diff --git a/show.py b/show.py new file mode 100644 index 0000000..25a7ec1 --- /dev/null +++ b/show.py @@ -0,0 +1,119 @@ +from os import listdir + +import numpy as np +import plotly.graph_objects as go +from scipy.interpolate import interp1d + +thread = [] +fork = [] +read = [] +write = [] +mmap_munmap = [] +send = [] +recv = [] +page_fault = [] +filenames = [] + +for filename in listdir('output'): + filenames.append(filename) + with open('output/' + filename) as f: + content = f.readlines() + new_dict = dict() + for line in content[1:]: + new_dict[line.split(',')[0]] = int(line.split(',')[2]) + thread.append(new_dict['thread']) + fork.append(new_dict['fork']) + read.append(new_dict['read']) + write.append(new_dict['write']) + mmap_munmap.append(new_dict['mmap_munmap']) + send.append(new_dict['send']) + recv.append(new_dict['recv']) + page_fault.append(new_dict['page_fault']) + + +headerColor = 'grey' +rowEvenColor = 'lightgrey' +rowOddColor = 'white' + +colors = [ + 'rgb(0, 255, 0)', 'rgb(225, 255, 77)', 'rgb(212, 255, 77)', + 'rgb(255, 255, 51)', 'rgb(255, 255, 0)', 'rgb(212, 255, 0)', + 'rgb(255, 221, 51)', 'rgb(255, 102, 25)', 'rgb(255, 42, 0)' +] + +threadcolorfilter = interp1d([min(thread), max(thread)], [0, 8]) +threadcolor = [int(threadcolorfilter(x)) for x in thread] + +forkcolorfilter = interp1d([min(fork), max(fork)], [0, 8]) +forkcolor = [int(forkcolorfilter(x)) for x in fork] + +readcolorfilter = interp1d([min(read), max(read)], [0, 8]) +readcolor = [int(readcolorfilter(x)) for x in read] + +writecolorfilter = interp1d([min(write), max(write)], [0, 8]) +writecolor = [int(writecolorfilter(x)) for x in write] + +mmap_munmapcolorfilter = interp1d([min(mmap_munmap), max(mmap_munmap)], [0, 8]) +mmap_munmapcolor = [int(mmap_munmapcolorfilter(x)) for x in mmap_munmap] + +sendcolorfilter = interp1d([min(send), max(send)], [0, 8]) +sendcolor = [int(sendcolorfilter(x)) for x in send] + +recvcolorfilter = interp1d([min(recv), max(recv)], [0, 8]) +recvcolor = [int(recvcolorfilter(x)) for x in recv] + +page_faultcolorfilter = interp1d([min(page_fault), max(page_fault)], [0, 8]) +page_faultcolor = [int(page_faultcolorfilter(x)) for x in page_fault] + +fig = go.Figure( + data=[go.Table( + columnorder=[1, 2, 3, 4, 5, 6, 7, 8, 9], + columnwidth=[10, 4, 4, 4, 4, 4, 4, 4, 4], + header=dict( + values=[ + "filenames", + "thread", + "fork", + "read", + "write", + "mmap_munmap", + "send", + "recv", + "page_fault" + ], + line_color='darkslategray', + fill_color=headerColor, + align=['left', 'center'], + font=dict(color='white', size=13) + ), + cells=dict( + values=[ + filenames, + thread, + fork, + read, + write, + mmap_munmap, + send, + recv, + page_fault, + ], + line_color='darkslategray', + fill_color=[ + rowOddColor, + np.array(colors)[threadcolor], + np.array(colors)[forkcolor], + np.array(colors)[readcolor], + np.array(colors)[writecolor], + np.array(colors)[mmap_munmapcolor], + np.array(colors)[sendcolor], + np.array(colors)[recvcolor], + np.array(colors)[page_faultcolor], + ], + align=['left', 'center'], + font=dict(color='darkslategray', size=13) + ) + )] +) + +fig.show()