From 03ca0ba335d9ca6b17dfec89ad0de7b3e5883ae0 Mon Sep 17 00:00:00 2001 From: Igor Santos Date: Fri, 15 Sep 2023 17:25:45 -0300 Subject: [PATCH] chore(monitoring): remove unused snippet codes --- app/requirements.txt | 1 - deploy/docker-compose.yml | 64 +++++++++++++++++++-------------------- deploy/prometheus.yml | 9 ------ locustfile.py | 21 +++++++++++-- 4 files changed, 51 insertions(+), 44 deletions(-) delete mode 100644 deploy/prometheus.yml diff --git a/app/requirements.txt b/app/requirements.txt index e4688fb2..b0c725c2 100644 --- a/app/requirements.txt +++ b/app/requirements.txt @@ -18,4 +18,3 @@ whitenoise svglib reportlab django-social-share -django-redis \ No newline at end of file diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index c3985f37..a992a6ca 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -22,41 +22,41 @@ services: - traefik.http.routers.cms.tls.certresolver=myresolver - traefik.http.routers.cms.rule=${TRAEFIK_ROUTERS_RULE:-"HostRegexp(`cms.staging.bonde.org`)"} - prometheus: - image: prom/prometheus - restart: 'no' - user: root - volumes: - - prometheus_data:/prometheus - - ./prometheus_data/prometheus.yml:/etc/prometheus/prometheus.yml - labels: - - traefik.enable=true - - traefik.http.services.prometheus.loadbalancer.server.port=9090 - - traefik.http.routers.prometheus.tls=true - - traefik.http.routers.prometheus.tls.certresolver=myresolver + # prometheus: + # image: prom/prometheus + # restart: 'no' + # user: root + # volumes: + # - prometheus_data:/prometheus + # # - ./prometheus.yml:/etc/prometheus/prometheus.yml + # labels: + # - traefik.enable=true + # - traefik.http.services.prometheus.loadbalancer.server.port=9090 + # - traefik.http.routers.prometheus.tls=true + # - traefik.http.routers.prometheus.tls.certresolver=myresolver - grafana: - image: grafana/grafana - user: root - environment: - GF_INSTALL_PLUGINS: "grafana-clock-panel,grafana-simple-json-datasource" - restart: 'no' - volumes: - - grafana_data:/var/lib/grafana - depends_on: - - prometheus - labels: - - traefik.enable=true - - traefik.http.services.grafana.loadbalancer.server.port=3000 - - traefik.http.routers.grafana.tls=true - - traefik.http.routers.grafana.tls.certresolver=myresolver + # grafana: + # image: grafana/grafana + # user: root + # environment: + # GF_INSTALL_PLUGINS: "grafana-clock-panel,grafana-simple-json-datasource" + # restart: 'no' + # volumes: + # - grafana_data:/var/lib/grafana + # depends_on: + # - prometheus + # labels: + # - traefik.enable=true + # - traefik.http.services.grafana.loadbalancer.server.port=3000 + # - traefik.http.routers.grafana.tls=true + # - traefik.http.routers.grafana.tls.certresolver=myresolver networks: default: name: bonde -volumes: - prometheus_data: - driver: local - grafana_data: - driver: local \ No newline at end of file +# volumes: +# prometheus_data: +# driver: local +# grafana_data: +# driver: local diff --git a/deploy/prometheus.yml b/deploy/prometheus.yml deleted file mode 100644 index ff848ffd..00000000 --- a/deploy/prometheus.yml +++ /dev/null @@ -1,9 +0,0 @@ -global: - scrape_interval: 15s - evaluation_interval: 15s - -scrape_configs: - - job_name: django - metrics_path: '/monitoring/metrics' - static_configs: - - targets: ['cms.staging.bonde.org'] diff --git a/locustfile.py b/locustfile.py index 920ce296..e776e4f9 100644 --- a/locustfile.py +++ b/locustfile.py @@ -1,6 +1,23 @@ from locust import HttpUser, task -class HelloWorldUser(HttpUser): +class SimulateRequestOverUser(HttpUser): + @task - def hello_world(self): + def index(self): + self.client.get("/") + + @task + def list(self): self.client.get("/candidaturas/") + + @task + def admin(self): + self.client.get("/admin") + + @task + def not_found(self): + self.client.get("/not_found/asdasdasd") + + @task + def form(self): + self.client.get("/candidaturas/cadastro/") \ No newline at end of file