Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create load-test.js #234

Merged
merged 3 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions uniEmpleos/load-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import http from "k6/http"
import { sleep, check } from "k6"

export const options = {
scenarios: {
low_load: {
executor: "constant-vus",
vus: 100,
duration: "1m", // por ejemplo, 1 minuto
gracefulStop: "30s",
},
medium_load: {
executor: "constant-vus",
vus: 200,
duration: "1m", // por ejemplo, 1 minuto
startTime: "2m", // inicia después de que el primer escenario ha terminado
gracefulStop: "30s",
},
high_load: {
executor: "constant-vus",
vus: 400,
duration: "1m", // por ejemplo, 1 minuto
startTime: "3m", // inicia después de que el segundo escenario ha terminado
gracefulStop: "30s",
},
},
}

function login() {
const res = http.get("https://sage-palmier-936be2.netlify.app/login")
check(res, { "status was 200": (r) => r.status === 200 })
}

function signup() {
const res = http.get("https://sage-palmier-936be2.netlify.app/signup")
check(res, { "status was 200": (r) => r.status === 200 })
}

function homepage() {
const res = http.get("https://sage-palmier-936be2.netlify.app/")
check(res, { "status was 200": (r) => r.status === 200 })
}

export default function () {
// Genera un número aleatorio entre 1 y 3
const randomPage = Math.floor(Math.random() * 3) + 1

switch (randomPage) {
case 1:
login()
break
case 2:
signup()
break
case 3:
homepage()
break
default:
homepage()
break
}

sleep(1)
}
6 changes: 2 additions & 4 deletions uniEmpleos/src/components/InfoStudent/InfoStudent.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,15 @@

.pfpContainer {
width: calc(25% - 20px);
max-width: 80px;
max-height: 80px;
display: flex;
align-items: center;
}

.pfp {
border-radius: 10%;
background-color: transparent;
width: 100%;
height: 100%;
width: 80px;
height: 80px;
object-fit: cover;
object-position: center;
}
Expand Down
13 changes: 4 additions & 9 deletions uniEmpleos/src/components/Loader/Loader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,10 @@ const Loader = ({ size }) => {
]

return (
<div
className={style.loader}
style={{ width: `${size}px`, height: `${size}px` }}
>
<span className={style.loader__bar} style={customStyle[0]}></span>
<span className={style.loader__bar} style={customStyle[1]}></span>
<span className={style.loader__bar} style={customStyle[2]}></span>
<span className={style.loader__bar} style={customStyle[3]}></span>
<span className={style.loader__bar} style={customStyle[4]}></span>
<div className={style.threebody}>
<div className={style.threebody__dot} />
<div className={style.threebody__dot} />
<div className={style.threebody__dot} />
</div>
)
}
Expand Down
126 changes: 97 additions & 29 deletions uniEmpleos/src/components/Loader/Loader.module.css
Original file line number Diff line number Diff line change
@@ -1,35 +1,103 @@
.loader {
display: inline-flex;
align-items: center;
column-gap: 5px;
margin: 50px;
}

.loader__bar {
.threebody {
--uib-size: 50px;
--uib-speed: 0.8s;
--uib-color: #5D3FD3;
position: relative;
display: inline-block;
width: 15%;
height: 30%;
background-color: #000;
opacity: .5;
border-radius: 10px;
animation: scale-up 1000ms
var(--d) linear infinite;
}

.loader__bar:nth-child(even) {
height: 70%;
}

.loader__bar:nth-child(3) {
height: var(--uib-size);
width: var(--uib-size);
animation: spin78236 calc(var(--uib-speed) * 2.5) infinite linear;
}

.threebody__dot {
position: absolute;
height: 100%;
}

@keyframes scale-up {
25% {
opacity: 1;
scale: 1 1.5;
width: 30%;
}

.threebody__dot:after {
content: '';
position: absolute;
height: 0%;
width: 100%;
padding-bottom: 100%;
background-color: var(--uib-color);
border-radius: 50%;
}

.threebody__dot:nth-child(1) {
bottom: 5%;
left: 0;
transform: rotate(60deg);
transform-origin: 50% 85%;
}

.threebody__dot:nth-child(1)::after {
bottom: 0;
left: 0;
animation: wobble1 var(--uib-speed) infinite ease-in-out;
animation-delay: calc(var(--uib-speed) * -0.3);
}

.threebody__dot:nth-child(2) {
bottom: 5%;
right: 0;
transform: rotate(-60deg);
transform-origin: 50% 85%;
}

.threebody__dot:nth-child(2)::after {
bottom: 0;
left: 0;
animation: wobble1 var(--uib-speed) infinite
calc(var(--uib-speed) * -0.15) ease-in-out;
}

.threebody__dot:nth-child(3) {
bottom: -5%;
left: 0;
transform: translateX(116.666%);
}

.threebody__dot:nth-child(3)::after {
top: 0;
left: 0;
animation: wobble2 var(--uib-speed) infinite ease-in-out;
}

@keyframes spin78236 {
0% {
transform: rotate(0deg);
}

100% {
transform: rotate(360deg);
}
}

@keyframes wobble1 {
0%,
100% {
transform: translateY(0%) scale(1);
opacity: 1;
}

50% {
transform: translateY(-66%) scale(0.65);
opacity: 0.8;
}
}

@keyframes wobble2 {
0%,
100% {
transform: translateY(0%) scale(1);
opacity: 1;
}

50% {
scale: 1;
transform: translateY(66%) scale(0.65);
opacity: 0.8;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from "react"
import style from "./PublicProfileAdmin.module.css"
import { BiUser } from "react-icons/bi"
import { HiOutlineMailOpen } from "react-icons/hi"
import style from "./PublicProfileAdmin.module.css"
import Button from "../Button/Button"

const PublicProfileAdmin = ({
name,
lastName,
Expand Down Expand Up @@ -33,11 +34,11 @@ const PublicProfileAdmin = ({
<div className={style.suspendedContainer}>
<Button
label={suspended ? "Activar" : "Suspender"}
backgroundColor={suspended ? "#00FF00" : "#FF0000"}
backgroundColor={suspended ? "#00FF00" : "#707070"}
textColor="#FFFFFF"
onClick={funcSuspended}
/>
<Button
<Button
label="Eliminar"
backgroundColor="#FF0000"
textColor="#FFFFFF"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
width: calc(100% - 40px);
height: calc(100% - 40px);
color: #000;
gap: 10%;
gap: 20px;
padding: 20px;
}

.pfpContainer {
display: flex;
align-items: center;
justify-content: end;
height: 80%;
justify-content: center;
height: 500px;
width: 50%;
}

Expand Down Expand Up @@ -66,6 +66,7 @@

.mainContainer {
flex-direction: column;
padding-top: 20%;
}

.pfpContainer {
Expand Down
18 changes: 2 additions & 16 deletions uniEmpleos/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,15 @@ button {
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
filter: brightness(1.1);
}

.css-tj5bde-Svg {
display: none !important;
}



@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}

main {
width: 100%;
height: 100%;
}

Loading
Loading