diff --git a/ASP.NET/Controllers/ImageController.cs b/ASP.NET/Controllers/ImageController.cs index 8a4aa15..2e3a039 100644 --- a/ASP.NET/Controllers/ImageController.cs +++ b/ASP.NET/Controllers/ImageController.cs @@ -31,7 +31,7 @@ namespace TCC.Controllers return File(blurredImageStream, "image/png"); } - [HttpGet("load-image")] + [HttpGet("load-small-image")] public async Task GetSimpleImage() { return File(ImageService.GetSimpleImage(), "image/png"); diff --git a/ASP.NET/Dockerfile b/ASP.NET/Dockerfile index 1ed48d2..b1d57a5 100644 --- a/ASP.NET/Dockerfile +++ b/ASP.NET/Dockerfile @@ -12,13 +12,13 @@ RUN dotnet restore RUN dotnet build -c Release -o out RUN cd out && \ - wget https://files.ivanch.me/api/public/dl/QFCLgtrG/simpleimage.png && \ - wget https://files.ivanch.me/api/public/dl/E0VLgWbx/bigimage.png && \ + wget https://files.ivanch.me/api/public/dl/Dj0gkp-m/small-image.png && \ + wget https://files.ivanch.me/api/public/dl/FqHEPM1Q/big-image.png && \ wget https://files.ivanch.me/api/public/dl/nTAYqZwD/video.mp4 && \ rm -rf runtimes && \ mkdir -p ./static && \ - cp simpleimage.png ./static && \ - cp bigimage.png ./static && \ + mv small-image.png ./static && \ + mv big-image.png ./static && \ mv video.mp4 ./static # Build runtime image diff --git a/ASP.NET/ImageHelper.cs b/ASP.NET/ImageHelper.cs index 650a6a9..df0b189 100644 --- a/ASP.NET/ImageHelper.cs +++ b/ASP.NET/ImageHelper.cs @@ -9,8 +9,8 @@ namespace tcc_app static ImageHelper() { - SimpleImage = File.ReadAllBytes("static/simpleimage.png"); - BigImage = File.ReadAllBytes("static/bigimage.png"); + SimpleImage = File.ReadAllBytes("static/small-image.png"); + BigImage = File.ReadAllBytes("static/big-image.png"); } } } diff --git a/scripts/graph.py b/scripts/graph.py index 4b04eb2..6a82475 100644 --- a/scripts/graph.py +++ b/scripts/graph.py @@ -35,11 +35,11 @@ def plot_resource_graph(x_data, y_data, title, x_label, y_label, filename): ax.set_xlabel(x_label) ax.set_ylabel(y_label) ax.set_title(title) - ax.set_xticks(x + width, requests) + ax.set_xticks(x + (width/2), requests) ax.legend(loc='upper left', ncols=len(resource.items())) ax.set_ylim(0, 100) - plt.savefig(f'resources_{filename}.png') + plt.savefig(f'{filename}.png') plt.clf() plt.close('all') @@ -77,11 +77,13 @@ def get_resource_data(filename): def generate_req_graph(filename, framework_name, endpoint_name): x, y = get_data(filename) - new_filename = filename.replace('.txt', '').replace('.csv', '') + filename = filename.split('/')[-1] + new_filename = filename.replace('.csv', '') plot_graph(x, y, f'{framework_name} - {endpoint_name}', 'Número de requisições', 'Requisições por segundo', new_filename) def generate_resource_graph(filename, framework_name, endpoint_name): x, y = get_resource_data(filename) - new_filename = filename.replace('.txt', '').replace('.csv', '') + filename = filename.split('/')[-1] + new_filename = filename.replace('.csv', '') plot_resource_graph(x, y, f'{framework_name} - {endpoint_name}', 'Uso de recursos', 'Uso (%)', new_filename) \ No newline at end of file