Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
94d8be1
Add existing file
oam1809 Jul 7, 2017
5fee566
Add SpikeScript
oam1809 Jul 7, 2017
edc05fd
Add SpikeScript.conf
oam1809 Jul 7, 2017
88b3bf5
Add SpikeScript.sh
oam1809 Jul 7, 2017
b0b3284
test-Setup
oam1809 Jul 7, 2017
1c8a51a
test-Setup
oam1809 Jul 7, 2017
15ffb00
test-Setup
oam1809 Jul 7, 2017
c3ed07d
Script Updated
oam1809 Jul 7, 2017
0cc2e0b
conf file Updated
oam1809 Jul 7, 2017
59f6340
test server connection
oam1809 Jul 7, 2017
4267100
updated script
oam1809 Jul 7, 2017
71b05dc
retrieve-metrics
oam1809 Jul 7, 2017
762a455
retrieve metrics from server
oam1809 Jul 7, 2017
840cbc7
Push data to InfluxDB
oam1809 Jul 7, 2017
867b7c6
updated conf file
oam1809 Jul 7, 2017
cc77207
Create Make
oam1809 Jul 7, 2017
4f8bdd8
updated file
oam1809 Jul 7, 2017
08f8f90
updating Makefile
oam1809 Jul 10, 2017
325f4df
updated Makefile
oam1809 Jul 10, 2017
8adbbef
updated
oam1809 Jul 19, 2017
51a304a
updated
oam1809 Jul 19, 2017
742659c
updated
oam1809 Jul 19, 2017
e3a2ac4
updated
oam1809 Jul 19, 2017
b59c9fc
Test improvements + db name correction
Aug 2, 2017
6dc83d3
Add existing file
oam1809 Jul 7, 2017
744edff
Add SpikeScript
oam1809 Jul 7, 2017
479afec
Add SpikeScript.conf
oam1809 Jul 7, 2017
1e4976c
Add SpikeScript.sh
oam1809 Jul 7, 2017
3a5fc2a
test-Setup
oam1809 Jul 7, 2017
34f08a1
test-Setup
oam1809 Jul 7, 2017
dcbc346
test-Setup
oam1809 Jul 7, 2017
cdd601d
Script Updated
oam1809 Jul 7, 2017
4f1b785
conf file Updated
oam1809 Jul 7, 2017
ca1a0b3
test server connection
oam1809 Jul 7, 2017
e33fb92
updated script
oam1809 Jul 7, 2017
5538c90
retrieve-metrics
oam1809 Jul 7, 2017
94f511b
retrieve metrics from server
oam1809 Jul 7, 2017
168c293
Push data to InfluxDB
oam1809 Jul 7, 2017
2bbc2cc
updated conf file
oam1809 Jul 7, 2017
a1695b5
Create Make
oam1809 Jul 7, 2017
2ee6bd4
updated file
oam1809 Jul 7, 2017
b9e70f2
updating Makefile
oam1809 Jul 10, 2017
a9c60e8
updated Makefile
oam1809 Jul 10, 2017
a97b5b2
updated
oam1809 Jul 19, 2017
f14028a
updated
oam1809 Jul 19, 2017
787ab3c
updated
oam1809 Jul 19, 2017
336f38e
updated
oam1809 Jul 19, 2017
b5e1fa1
resolved merge conflicts
Aug 2, 2017
14bfaab
resolved conflict for 40-PushToInflux
Aug 2, 2017
f30e393
add test/SpikeScript/40-pushtoinflux.sh
Aug 2, 2017
722c2c0
demo
Aug 4, 2017
644753c
Dashboard corrections
Aug 4, 2017
eae2e63
Verbose wget.
mrrusof Aug 5, 2017
ec89267
Merge branch 'Demo' into 1-5-2-1-SpikeScript
oam1809 Aug 23, 2017
3ee167f
commit branch
oam1809 Aug 23, 2017
a24d37f
Delete 20-server-connection-test.sh.orig
oam1809 Aug 29, 2017
7f1f1de
Delete 40-pushtoinflux.sh.orig
oam1809 Aug 29, 2017
7bd2df9
Delete 50-verify-data.sh.orig
oam1809 Aug 29, 2017
a53eb77
Delete 90-teardown.sh.orig
oam1809 Aug 29, 2017
e3080e6
Delete Makefile.orig
oam1809 Aug 29, 2017
5f95626
Delete spike-script.conf.orig
oam1809 Aug 29, 2017
f378a97
Delete Makefile.orig
oam1809 Aug 29, 2017
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*~
*~
*.Ds_store
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ services:
before_install:
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- sudo useradd -s /bin/bash -p $(echo ssh_pass | openssl passwd -1 -stdin) ssh_user

script:
- make
- make clean
12 changes: 12 additions & 0 deletions 1-5-2-1-SpikeScript/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu:xenial

MAINTAINER [email protected]

RUN apt-get update && apt-get install -y openssh-server
RUN apt-get install -y curl
RUN apt-get install -y iproute2
RUN apt-get install -y sshpass
COPY SpikeScript.sh /
COPY SpikeScript.conf /
COPY start-and-initialize.sh /
CMD ["/start-and-initialize.sh"]
4 changes: 4 additions & 0 deletions 1-5-2-1-SpikeScript/SpikeScript.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
USERNAME="root"
PASSWORD="root"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use this file instead of configuring this variables in compose.

IPADDRESS="monitor_system"
HOST="influx_system"
50 changes: 50 additions & 0 deletions 1-5-2-1-SpikeScript/SpikeScript.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

end=$((SECONDS+2400000))
#
#need to add check if sysstat is installed.
#

source SpikeScript.conf
echo $USERNAME
echo $PASSWORD
echo $IPADDRESS
while [ $SECONDS -lt $end ]; do
##################
#get data from external server
##################

NOW=$(date +"%s")

MEMORY=$(sshpass -p "$PASSWORD" ssh -tt -o "StrictHostKeyChecking no" $USERNAME@$IPADDRESS free -m | awk 'NR==2{printf "%.2g", $3*100/$2 }')

CPU=$(sshpass -p "$PASSWORD" ssh -tt $USERNAME@$IPADDRESS top -bn1 | grep load | awk '{printf "%.2g", $(NF-2)}')

#For the following metrics, sysstat needs to be installed
DISKREADSEC=$(sshpass -p "$PASSWORD" ssh -tt $USERNAME@$IPADDRESS iostat -dx | tail -n 2 | awk '{ print $4; }')
DISKWRITESEC=$(sshpass -p "$PASSWORD" ssh -tt $USERNAME@$IPADDRESS iostat -dx | tail -n 2 | awk '{ print $5; }')

##################
#POST to InfluxDB
##################

#meaningful db name - spikescript

#POST CPU utilization to Influxdb
curl -i -XPOST 'http://'$HOST':8086/write?db=snapshot&precision=s' --data-binary 'cpu_load_short,host=server01,region=us-west value='$CPU' '$NOW''

#POST Memory utilization to Influxdb
curl -i -XPOST 'http://'$HOST':8086/write?db=snapshot&precision=s' --data-binary 'mem_load_short,host=server01,region=us-west value='$MEMORY' '$NOW''

#POST Disk read to Influxdb
curl -i -XPOST 'http://'$HOST':8086/write?db=snapshot&precision=s' --data-binary 'disk_read_short,host=server01,region=us-west value='$DISKREADSEC' '$NOW''

#POST Disk write to Influxdb
curl -i -XPOST 'http://'$HOST':8086/write?db=snapshot&precision=s' --data-binary 'disk_write_short,host=server01,region=us-west value='$DISKWRITESEC' '$NOW''

#printf "Memory\t\tDisk\t\tCPU\n"
#echo "$CPU $MEMORY $DISKWRITESEC"

sleep 10
done

4 changes: 4 additions & 0 deletions 1-5-2-1-SpikeScript/start-and-initialize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

#run spikescript
./SpikeScript.sh
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
all: test
all: test

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing space


test:
@for d in ./test/*; do \
echo TEST $$d; \
cd $$d; \
$(MAKE); \
cd -; \
done

.PHONY: all test
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Grafana dashboard for performance test measurements collected by JMeter.

You can start performance-tests-dashboard in regular or detached mode.

1. Regular mode
##### Regular mode
1. To start, execute `./start.sh`.
2. To stop, press Ctrl-C.
3. To clean stopped containers, execute `./stop.sh`.
2. Detached mode
##### Detached mode
1. To start, execute `./start.sh -d`.
2. To stop and clean containers, execute `./stop.sh`.

Expand Down
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
version: '3'

#do not change container names

services:
influxdb:
build: influxdb
container_name: influx_system
ports:
- 8086:8086
- 2003:2003
grafana:
build: grafana
container_name: grafana_system
ports:
- 3000:3000
depends_on:
- influxdb

monitor:
build: monitor
container_name: monitor_system

spike:
build: 1-5-2-1-SpikeScript
container_name: spike_system
depends_on:
- monitor

jmeter:
build: jmeter
container_name: jmeter_system

144 changes: 5 additions & 139 deletions grafana/performance-tests-dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "4.3.1"
"version": "4.4.1"
},
{
"type": "panel",
Expand All @@ -14,13 +14,7 @@
},
{
"type": "datasource",
"id": "influxdb-jmeter",
"name": "InfluxDB",
"version": "1.0.0"
},
{
"type": "datasource",
"id": "influxdb-test",
"id": "influxdb",
"name": "InfluxDB",
"version": "1.0.0"
},
Expand All @@ -40,7 +34,7 @@
"hideControls": false,
"id": null,
"links": [],
"refresh": false,
"refresh": "5s",
"rows": [
{
"collapse": false,
Expand Down Expand Up @@ -158,7 +152,7 @@
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "Average Rate",
"title": "Response Time",
"tooltip": {
"shared": true,
"sort": 0,
Expand Down Expand Up @@ -529,123 +523,6 @@
"title": "Dashboard Row",
"titleSize": "h6"
},
{
"collapse": false,
"height": 250,
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "influxdb-jmeter",
"fill": 1,
"id": 4,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"span": 12,
"stack": false,
"steppedLine": false,
"targets": [
{
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"linear"
],
"type": "fill"
}
],
"measurement": "jmeter.test.meanAT",
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": []
}
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "Active Users",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
]
}
],
"repeat": null,
"repeatIteration": null,
"repeatRowId": null,
"showTitle": false,
"title": "Dashboard Row",
"titleSize": "h6"
},
{
"collapse": false,
"height": 212,
Expand Down Expand Up @@ -881,17 +758,6 @@
"showTitle": false,
"title": "Dashboard Row",
"titleSize": "h6"
},
{
"collapse": false,
"height": 250,
"panels": [],
"repeat": null,
"repeatIteration": null,
"repeatRowId": null,
"showTitle": false,
"title": "Dashboard Row",
"titleSize": "h6"
}
],
"schemaVersion": 14,
Expand Down Expand Up @@ -931,5 +797,5 @@
},
"timezone": "browser",
"title": "Real Time Results",
"version": 15
"version": 0
}
10 changes: 8 additions & 2 deletions influxdb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ FROM influxdb:1.2

MAINTAINER [email protected]


RUN mkdir -p /workspace
COPY additional.conf /workspace
RUN cat /workspace/additional.conf >>/etc/influxdb/influxdb.conf


# Create databases
COPY start-and-initialize.sh /
CMD ["/start-and-initialize.sh"]
COPY start-and-initialize.sh /workspace
CMD ["/workspace/start-and-initialize.sh"]
12 changes: 12 additions & 0 deletions influxdb/additional.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[[graphite]]
enabled = true
bind-address = ":2003"
database = "jmeter"
retention-policy = ""
protocol = "tcp"
batch-size = 5000
batch-pending = 10
batch-timeout = "1s"
consistency-level = "one"
separator = "."
upd-read-buffer = 0
4 changes: 1 addition & 3 deletions influxdb/start-and-initialize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

influxd &

until influx -execute 'CREATE DATABASE jmeter'; do
until influx -execute 'CREATE DATABASE jmeter' && influx -execute 'CREATE DATABASE snapshot'; do
sleep 0.125;
done

influx -execute 'CREATE DATABASE snapshot'

wait
Loading