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

cambios html merge #8

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM python:3

WORKDIR /usr/app

COPY . .

RUN python -m pip install --upgrade pip
RUN pip install -r requirements.txt

CMD [ "python", "manage.py", "makemigrations" ]
CMD [ "python", "manage.py", "migrate" ]
CMD [ "python", "manage.py", "runserver", "0.0.0.0:8080" ]
139 changes: 68 additions & 71 deletions Jmeter-test/Load-tests.jmx
Original file line number Diff line number Diff line change
@@ -1,50 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="4.0" jmeter="4.0 r1823414">
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.6.3">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan">
<boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="GET Group" enabled="true">
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="GET Group">
<intProp name="ThreadGroup.num_threads">50</intProp>
<intProp name="ThreadGroup.ramp_time">10</intProp>
<boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller">
<stringProp name="LoopController.loops">1</stringProp>
<boolProp name="LoopController.continue_forever">false</boolProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">10</stringProp>
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="GET Request" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">172.10.10.10</stringProp>
<stringProp name="HTTPSampler.port">8082</stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/measurements/</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="GET Request">
<stringProp name="HTTPSampler.domain">35.241.37.211</stringProp>
<stringProp name="HTTPSampler.port">80</stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.path">/variables/</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="Variables definidas por el Usuario">
<collectionProp name="Arguments.arguments"/>
</elementProp>
</HTTPSamplerProxy>
<hashTree>
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
Expand Down Expand Up @@ -80,7 +69,7 @@
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="SummaryReport" testclass="ResultCollector" testname="Summary Report" enabled="true">
<ResultCollector guiclass="SummaryReport" testclass="ResultCollector" testname="Summary Report">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
Expand Down Expand Up @@ -116,7 +105,7 @@
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="Graph Results" enabled="true">
<ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="Graph Results">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
Expand Down Expand Up @@ -154,68 +143,76 @@
<hashTree/>
</hashTree>
</hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="POST Group" enabled="true">
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="POST Group">
<intProp name="ThreadGroup.num_threads">25</intProp>
<intProp name="ThreadGroup.ramp_time">10</intProp>
<boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller">
<stringProp name="LoopController.loops">1</stringProp>
<boolProp name="LoopController.continue_forever">false</boolProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">10</stringProp>
<stringProp name="ThreadGroup.ramp_time">10</stringProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="POST Request" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="POST Request">
<stringProp name="HTTPSampler.domain">35.241.37.211</stringProp>
<stringProp name="HTTPSampler.port">80</stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.path">/variablecreate/</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp>
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="Variables definidas por el Usuario">
<collectionProp name="Arguments.arguments">
<elementProp name="variable" elementType="HTTPArgument">
<elementProp name="Name" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">1</stringProp>
<stringProp name="Argument.value">Nombre 1</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">variable</stringProp>
<stringProp name="Argument.name">Name</stringProp>
</elementProp>
<elementProp name="value" elementType="HTTPArgument">
<elementProp name="Lastname" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">22.1</stringProp>
<stringProp name="Argument.value">Lastname 1</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">value</stringProp>
<stringProp name="Argument.name">Lastname</stringProp>
</elementProp>
<elementProp name="unit" elementType="HTTPArgument">
<elementProp name="Country" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">C</stringProp>
<stringProp name="Argument.value">Colombia</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">unit</stringProp>
<stringProp name="Argument.name">Country</stringProp>
</elementProp>
<elementProp name="place" elementType="HTTPArgument">
<elementProp name="City" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">ML500</stringProp>
<stringProp name="Argument.value">Bogota</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">place</stringProp>
<stringProp name="Argument.name">City</stringProp>
</elementProp>
<elementProp name="Phone" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">123456789</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">Phone</stringProp>
</elementProp>
<elementProp name="Mail" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value">[email protected]</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
<boolProp name="HTTPArgument.use_equals">true</boolProp>
<stringProp name="Argument.name">Mail</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain">172.10.10.10</stringProp>
<stringProp name="HTTPSampler.port">8082</stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/measurementcreate/</stringProp>
<stringProp name="HTTPSampler.method">POST</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">true</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<hashTree>
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
Expand Down Expand Up @@ -251,7 +248,7 @@
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="SummaryReport" testclass="ResultCollector" testname="Summary Report" enabled="true">
<ResultCollector guiclass="SummaryReport" testclass="ResultCollector" testname="Summary Report">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
Expand Down Expand Up @@ -287,7 +284,7 @@
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
<ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="Graph Results" enabled="true">
<ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="Graph Results">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
Expand Down
4 changes: 2 additions & 2 deletions measurements/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ class MeasurementForm(forms.ModelForm):
class Meta:
model = Measurement
fields = [
'variable',
#'variable',
'value',
'unit',
'place',
#'dateTime',
]

labels = {
'variable' : 'Variable',
#'variable' : 'Variable',
'value' : 'Value',
'unit' : 'Unit',
'place' : 'Place',
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion measurements/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from variables.models import Variable

class Measurement(models.Model):
variable = models.ForeignKey(Variable, on_delete=models.CASCADE, default=None)
#variable = models.ForeignKey(Solicitud, on_delete=models.CASCADE, default=None)
value = models.FloatField(null=True, blank=True, default=None)
unit = models.CharField(max_length=50)
place = models.CharField(max_length=50)
Expand Down
10 changes: 5 additions & 5 deletions measurements/templates/Measurement/measurementCreate.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{% extends 'base.html' %}
{% block content %}
<form method="POST">
{% extends 'base.html' %}
{% block content %}
<form method="POST">
{% csrf_token %}
<br>
{{ form.as_p }}
{{ form.as_p }}
<button type="submit" class="btn btn-success waves-effect waves-light">Create</button>
<button type="button" class="btn btn-primary waves-effect waves-light"
onClick=" window.location.href='/measurements' ">Back
</button>
</form>
</form>
{% endblock %}
8 changes: 4 additions & 4 deletions monitoring/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'name_db',
'USER': 'user_db',
'PASSWORD': 'user_password',
'HOST': 'localhost',
'NAME': 'monitoring_db',
'USER': 'monitoring_user',
'PASSWORD': 'isis2503',
'HOST': '10.128.0.2',
'PORT': '',
}
}
Expand Down
Binary file added monitoring/static/media/bienvenida.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified monitoring/static/media/logo.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed monitoring/static/media/monitor.png
Binary file not shown.
21 changes: 9 additions & 12 deletions monitoring/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,42 +20,39 @@

<nav class="navbar navbar-light bg-light">
<a class="navbar-brand" href="/">
Monitoring App
Banco De Los Alpes
</a>
</nav>


<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="/variables/">Variables</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/measurements/">Measurements</a>
<a class="nav-link" href="/variables/">Solicita tu tarjeta de crédito</a>
</li>
</ul>

</div>
</nav>


<main>
<main>
<div class="container" style="min-height: 580px;">
{% block content %}
{% endblock %}
{% block content %}
{% endblock %}
</div>
</main>
</main>

</body>

<!-- Footer -->
<footer style="background-color: #D8D8D8; position: relative; bottom: 0; width: 100%; height: 100px;">

<div style="padding: 30px">
<div style="float: left; width: 400px;" >ISIS-2503 Arquitectura y Diseño de Software</div>
<div style="float: right; width: 220px;" >Universidad de los Andes</div>
<div style="float: left; width: 400px;" >Eleva tu banca con Banco de los Alpes</div>
<div style="float: right; width: 220px;" >SuperStakeHolders</div>
<br>
<div style="float: left; width: 400px;" ><i>Iván David Alfonso Díaz</i></div>
<div style="float: left; width: 400px;" ><i>Solicita tu tarjeta y se parte de la familia ALpes</i></div>
</div>
<br>

Expand Down
2 changes: 1 addition & 1 deletion monitoring/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% block content %}

<div style=" display: flex; align-items: center; justify-content: center;" class="login-box auth0-box before">
<img style="width:80%; " src="/static/media/monitor.png" />
<img style="width:80%; " src="/static/media/bienvenida.png" />
</div>

{% endblock %}
1 change: 1 addition & 0 deletions monitoring/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
path('', views.index),
path('', include('measurements.urls')),
path('', include('variables.urls')),
path('health-check/', views.healthCheck)
]
6 changes: 5 additions & 1 deletion monitoring/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
from django.shortcuts import render
from django.http import HttpResponse

def index(request):
return render(request, 'index.html')
return render(request, 'index.html')

def healthCheck(request):
return HttpResponse('ok')
Loading