Skip to content

Commit

Permalink
Merge pull request #106 from observIQ/container/influx-loadgen
Browse files Browse the repository at this point in the history
InfluxDB: Load generation container
  • Loading branch information
algchoo authored Nov 10, 2023
2 parents da5aba3 + f3d046c commit 5ef8a34
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- "aerospike-benchmark"
- "apache-activemq-loadgen"
- "prestodb-loadgen"
- "influxdb-loadgen"
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
16 changes: 16 additions & 0 deletions container/influxdb-loadgen/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM debian:stable-slim

RUN apt-get update && \
apt-get install -y wget unzip && \
wget https://github.com/influxdata/influxdb2-sample-data/archive/refs/heads/master.zip && \
unzip master.zip && \
wget https://dl.influxdata.com/influxdb/releases/influxdb2-client-2.7.3-linux-amd64.tar.gz && \
tar -xvf influxdb2-client-2.7.3-linux-amd64.tar.gz && \
mv influx /usr/local/bin

WORKDIR /
COPY loadgen.sh /
RUN chmod +x /loadgen.sh

ENTRYPOINT [ "/loadgen.sh" ]

27 changes: 27 additions & 0 deletions container/influxdb-loadgen/loadgen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Create a config
influx config create --config-name sample-config --host-url http://influxdb-sample-app:80 --org influxdata --token nrlukwAn13XLMIlYeDTg7g47T28cEG4P --active

# Create buckets
influx bucket create --name loadgen-0
influx bucket create --name loadgen-1

# Write data to buckets
influx write --bucket loadgen-0 --file /influxdb2-sample-data-master/air-sensor-data/air-sensor-data.lp
influx write --bucket loadgen-1 --file /influxdb2-sample-data-master/bitcoin-price-data/currentprice.lp
influx write --bucket loadgen-0 --file /influxdb2-sample-data-master/noaa-ndbc-data/latest-observations.lp
influx write --bucket loadgen-1 --file /influxdb2-sample-data-master/bird-migration-data/bird-migration.line
influx write --bucket loadgen-0 --file /influxdb2-sample-data-master/usgs-earthquake-data/all_week.lp

# Query data from buckets for 5m
end=$((SECONDS+300))
while [ $SECONDS -lt $end ]
do
influx query 'from(bucket:"loadgen-0") |> range(start:-1h)'
influx query 'from(bucket:"loadgen-1") |> range(start:-1h)'
done

# Delete buckets
influx bucket delete --name loadgen-0
influx bucket delete --name loadgen-1

0 comments on commit 5ef8a34

Please sign in to comment.