Compare commits

..

No commits in common. "81abfe0c30f4d8a239ed40cb8bbd09d0eebeba8c" and "fc075422374539a2ac4cdf99d0a301d10eac29ab" have entirely different histories.

3 changed files with 8 additions and 13 deletions

View File

@ -34,11 +34,11 @@ namespace TCC.Controllers
[HttpGet("load-image")]
public async Task<IActionResult> GetSimpleImage()
{
var result = ImageService.GetSimpleImage();
//var result = ImageService.GetSimpleImage();
var result = System.IO.File.ReadAllBytes("simpleimage.png");
var imageStream = new MemoryStream();
result.Write(imageStream);
imageStream.Position = 0;
var imageStream = new byte[result.Length];
result.CopyTo(imageStream, 0);
return File(imageStream, "image/png");
}

View File

@ -7,8 +7,6 @@ def plot_graph(x, y, title, x_label, y_label, filename):
plt.ylabel(y_label)
plt.savefig(f'{filename}.png')
plt.clf()
def getData(filename):
lines = []
with open(filename, 'r') as f:
@ -26,8 +24,7 @@ def getData(filename):
def generateGraph(filename, framework_name, endpoint_name):
x, y = getData(filename)
new_filename = ".".join(filename.split('.')[:-1])
plot_graph(x, y, f'{framework_name} - {endpoint_name}', 'Number of requests', 'Requests per second', new_filename)
plot_graph(x, y, f'{framework_name} - {endpoint_name}', 'Number of requests', 'Requests per second', filename.split('.')[0])
if __name__ == '__main__':
generateGraph('data.txt', 'ASP.NET', 'test')

View File

@ -16,8 +16,7 @@ ENDPOINTS = [
'/image/load-image',
]
#num_requests = [10, 1000, 5000, 10_000, 50_000, 100_000, 500_000, 1_000_000]
num_requests = range(0, 50_000, 5000)
num_requests = [10, 1000, 5000, 10_000, 50_000, 100_000, 500_000, 1_000_000]
def send_request(url):
success = False
@ -42,7 +41,7 @@ def run_tests(endpoint):
if os.path.exists(filename):
os.remove(filename)
for num_request in num_requests:
for num_request in range(0, 50_000, 1000):
if num_request <= 0: continue
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
@ -66,5 +65,4 @@ def run_tests(endpoint):
time.sleep(3)
for endpoint in ENDPOINTS:
print(f"# {endpoint}")
run_tests(endpoint)