-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from observIQ/container/influx-loadgen
InfluxDB: Load generation container
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |