Commit f4528d89 authored by Sergio Gonzalez Diaz's avatar Sergio Gonzalez Diaz
Browse files

Test influxdb

parent 9885edd3
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -26,19 +26,21 @@
build influx:
  stage: build
  script:
    - kubectl version
    - kubectl get all
    # - kubectl delete -f "manifests/monitoring.yaml"
    # - sleep 15
    # - kubectl get all
    - kubectl apply -f "manifests/monitoring.yaml"
    - sleep 60
    # - kubectl get all
    # - kubectl apply -f "manifests/influx.yaml"
    # - sleep 15
    # - kubectl version
    # - kubectl get all
    - curl -XGET "10.97.74.29:8086/health" 
    # - kubectl delete -f "manifests/influx.yaml"
    # # - kubectl delete -f "manifests/monitoring.yaml"
    # # - sleep 15
    # # - kubectl get all
    # - kubectl apply -f "manifests/monitoring.yaml"
    # - sleep 60
    # # - kubectl get all
    # # - kubectl apply -f "manifests/influx.yaml"
    # # - sleep 15
    # # - kubectl get all
    # - curl -XGET "10.97.74.29:8086/health" 
    # # - kubectl delete -f "manifests/influx.yaml"
    - cd ./src/monitoring/service
    - python3 test_influx.py

# test if the Docker image can be pulled from the gitlab registry
# test monitoring pull:
+7 −0
Original line number Diff line number Diff line
from influx_tools import *
from datetime import datetime

influx = Influx('10.97.74.29', 8086, 'teraflow', 'teraflow', 'monitoring')
influx.write_KPI(datetime.now(),1,1,101,1000)
results = influx.client.query('select * from samples;')
print(results.raw)
 No newline at end of file