Skip to content

Commit

Permalink
Merge pull request #137 from Arquisoft/108-realizar-test-de-carga
Browse files Browse the repository at this point in the history
Añadidos tests de carga
  • Loading branch information
CANCI0 authored Apr 24, 2024
2 parents d82787d + 6bb0fc5 commit fc02c70
Show file tree
Hide file tree
Showing 119 changed files with 171,229 additions and 0 deletions.
700 changes: 700 additions & 0 deletions gatling/WIQ_es1a-load-test.java

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions gatling/gatling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Tests de carga con Gatling

1,164 changes: 1,164 additions & 0 deletions gatling/loadtest/index.html

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions gatling/loadtest/js/all_sessions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions gatling/loadtest/js/assertions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<testsuite name="WIQ_es1a load test" tests="0" errors="0" failures="0" time="0">

</testsuite>
7 changes: 7 additions & 0 deletions gatling/loadtest/js/bootstrap.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions gatling/loadtest/js/ellipsis.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function parentId(name) {
return "parent-" + name;
}

function isEllipsed(name) {
const child = document.getElementById(name);
const parent = document.getElementById(parentId(name));
const emptyData = parent.getAttribute("data-content") === "";
const hasOverflow = child.clientWidth < child.scrollWidth;

if (hasOverflow) {
if (emptyData) {
parent.setAttribute("data-content", name);
}
} else {
if (!emptyData) {
parent.setAttribute("data-content", "");
}
}
}

function ellipsedLabel ({ name, parentClass = "", childClass = "" }) {
const child = "<span onmouseover='isEllipsed(\"" + name + "\")' id='" + name + "' class='ellipsed-name " + childClass + "'>" + name + "</span>";

return "<span class='" + parentClass + "' id='" + parentId(name) + "' data-toggle='popover' data-placement='right' data-container='body' data-content=''>" + child + "</span>";
}
137 changes: 137 additions & 0 deletions gatling/loadtest/js/gatling.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
/*
* Copyright 2011-2024 GatlingCorp (https://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function ($) {
$.fn.expandable = function () {
var scope = this;

this.find('.expand-button:not([class*=hidden])').addClass('collapse').on('click', function () {
var $this = $(this);

if ($this.hasClass('expand'))
$this.expand(scope);
else
$this.collapse(scope);
});

this.find('.expand-all-button').on('click', function () {
$(this).expandAll(scope);
});

this.find('.collapse-all-button').on('click', function () {
$(this).collapseAll(scope);
});

this.collapseAll(this);

return this;
};

$.fn.expand = function (scope, recursive) {
return this.each(function () {
var $this = $(this);

if (recursive) {
scope.find('*[data-parent=' + $this.attr('id') + ']').find('.expand-button.expand').expand(scope, true);
scope.find('*[data-parent=' + $this.attr('id') + ']').find('.expand-button.expand').expand(scope, true);
}

if ($this.hasClass('expand')) {
$('*[data-parent=' + $this.attr('id') + ']').toggle(true);
$this.toggleClass('expand').toggleClass('collapse');
}
});
};

$.fn.expandAll = function (scope) {
$('*[data-parent=ROOT]').find('.expand-button.expand').expand(scope, true);
$('*[data-parent=ROOT]').find('.expand-button.collapse').expand(scope, true);
};

$.fn.collapse = function (scope) {
return this.each(function () {
var $this = $(this);

scope.find('*[data-parent=' + $this.attr('id') + '] .expand-button.collapse').collapse(scope);
scope.find('*[data-parent=' + $this.attr('id') + ']').toggle(false);
$this.toggleClass('expand').toggleClass('collapse');
});
};

$.fn.collapseAll = function (scope) {
$('*[data-parent=ROOT]').find('.expand-button.collapse').collapse(scope);
};

$.fn.sortable = function (target) {
var table = this;

this.find('thead .sortable').on('click', function () {
var $this = $(this);

if ($this.hasClass('sorted-down')) {
var desc = false;
var style = 'sorted-up';
}
else {
var desc = true;
var style = 'sorted-down';
}

$(target).sortTable($this.attr('id'), desc);

table.find('thead .sortable').removeClass('sorted-up sorted-down');
$this.addClass(style);

return false;
});

return this;
};

$.fn.sortTable = function (col, desc) {
function getValue(line) {
var cell = $(line).find('.' + col);

if (cell.hasClass('value'))
var value = cell.text();
else
var value = cell.find('.value').text();

return parseFloat(value);
}

function sortLines (lines, group) {
var notErrorTable = col.search("error") == -1;
var linesToSort = notErrorTable ? lines.filter('*[data-parent=' + group + ']') : lines;

var sortedLines = linesToSort.sort(function (a, b) {
return desc ? getValue(b) - getValue(a): getValue(a) - getValue(b);
}).toArray();

var result = [];
$.each(sortedLines, function (i, line) {
result.push(line);
if (notErrorTable)
result = result.concat(sortLines(lines, $(line).attr('id')));
});

return result;
}

this.find('tbody').append(sortLines(this.find('tbody tr').detach(), 'ROOT'));

return this;
};
})(jQuery);
77 changes: 77 additions & 0 deletions gatling/loadtest/js/global_stats.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"name": "All Requests",
"numberOfRequests": {
"total": 70868,
"ok": 61744,
"ko": 9124
},
"minResponseTime": {
"total": 45,
"ok": 45,
"ko": 147
},
"maxResponseTime": {
"total": 60017,
"ok": 59967,
"ko": 60017
},
"meanResponseTime": {
"total": 2367,
"ok": 1073,
"ko": 11121
},
"standardDeviation": {
"total": 7681,
"ok": 4883,
"ko": 14455
},
"percentiles1": {
"total": 148,
"ok": 108,
"ko": 8156
},
"percentiles2": {
"total": 209,
"ok": 189,
"ko": 10014
},
"percentiles3": {
"total": 12583,
"ok": 4327,
"ko": 60001
},
"percentiles4": {
"total": 49258,
"ok": 27140,
"ko": 60012
},
"group1": {
"name": "t < 800 ms",
"htmlName": "t < 800 ms",
"count": 57690,
"percentage": 81
},
"group2": {
"name": "800 ms <= t < 1200 ms",
"htmlName": "t >= 800 ms <br> t < 1200 ms",
"count": 147,
"percentage": 0
},
"group3": {
"name": "t >= 1200 ms",
"htmlName": "t >= 1200 ms",
"count": 3907,
"percentage": 6
},
"group4": {
"name": "failed",
"htmlName": "failed",
"count": 9124,
"percentage": 13
},
"meanNumberOfRequestsPerSecond": {
"total": 279.00787401574803,
"ok": 243.08661417322836,
"ko": 35.92125984251968
}
}
Loading

0 comments on commit fc02c70

Please sign in to comment.