diff --git a/.gitignore b/.gitignore index 278bb12..459a142 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ bin obj *.png -*.csv \ No newline at end of file +*.csv +*.jpg +*.mp4 \ No newline at end of file diff --git a/ASP.NET/Dockerfile b/ASP.NET/Dockerfile index ff81a83..5aeda6e 100644 --- a/ASP.NET/Dockerfile +++ b/ASP.NET/Dockerfile @@ -18,7 +18,11 @@ WORKDIR /App RUN apt update && apt install wget -y && \ wget https://files.ivanch.me/api/public/dl/QFCLgtrG/simpleimage.png && \ wget https://files.ivanch.me/api/public/dl/E0VLgWbx/bigimage.png && \ - rm -rf runtimes + wget https://files.ivanch.me/api/public/dl/nTAYqZwD/video.mp4 && \ + rm -rf runtimes && \ + cp simpleimage.png ./static && \ + cp bigimage.png ./static && \ + mv video.mp4 ./static COPY --from=build-env /App/out . diff --git a/ASP.NET/Program.cs b/ASP.NET/Program.cs index 1a6b4d7..9f17c17 100644 --- a/ASP.NET/Program.cs +++ b/ASP.NET/Program.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.Extensions.FileProviders; using TCC.Services; namespace TCC @@ -21,6 +22,11 @@ namespace TCC var app = builder.Build(); + app.UseStaticFiles(new StaticFileOptions + { + FileProvider = new PhysicalFileProvider(Path.Combine(builder.Environment.ContentRootPath, "static")), + RequestPath = "/static" + }); app.MapControllers(); app.Run(); diff --git a/ASP.NET/Properties/launchSettings.json b/ASP.NET/Properties/launchSettings.json index c972bd3..5b073a0 100644 --- a/ASP.NET/Properties/launchSettings.json +++ b/ASP.NET/Properties/launchSettings.json @@ -14,7 +14,7 @@ "dotnetRunMessages": true, "launchBrowser": false, "launchUrl": "weatherforecast", - "applicationUrl": "http://0.0.0.0:5100", + "applicationUrl": "http://0.0.0.0:9090", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/ASP.NET/static/nginx.html b/ASP.NET/static/nginx.html new file mode 100644 index 0000000..0ceac88 --- /dev/null +++ b/ASP.NET/static/nginx.html @@ -0,0 +1,33 @@ + + +
++ If you see this page, the nginx web server is successfully installed and + working. Further configuration is required. +
+ +
+ For online documentation and support please refer to
+ nginx.org.
+ Commercial support is available at
+ nginx.com.
+
Thank you for using nginx.
+ + \ No newline at end of file diff --git a/scripts/graph.py b/scripts/graph.py index c81e09d..0ad4f1c 100644 --- a/scripts/graph.py +++ b/scripts/graph.py @@ -26,8 +26,9 @@ def getData(filename): def generateGraph(filename, framework_name, endpoint_name): x, y = getData(filename) - new_filename = ".".join(filename.split('.')[:-1]) + + new_filename = filename.replace('.txt', '').replace('.csv', '') plot_graph(x, y, f'{framework_name} - {endpoint_name}', 'Number of requests', 'Requests per second', new_filename) if __name__ == '__main__': - generateGraph('data.txt', 'ASP.NET', 'test') + generateGraph('data.txt', 'Teste', 'endpoint') diff --git a/scripts/testes.py b/scripts/testes.py index c38f0c3..2c085be 100644 --- a/scripts/testes.py +++ b/scripts/testes.py @@ -4,30 +4,36 @@ import time import sys import os from graph import generateGraph +from math import floor if len(sys.argv) != 2 or sys.argv[1] == '-h' or sys.argv[1] == '--help': print("Usage: python testes.py