-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclusterMetric.sh
More file actions
executable file
·48 lines (44 loc) · 1.24 KB
/
clusterMetric.sh
File metadata and controls
executable file
·48 lines (44 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
if [ "$#" -ne 1 ]
then
echo "Usage: clusterMetric.sh <deploymentId>"
exit 1
fi
DEPLOYER_URL="localhost"
WORKLOAD_PROFILER_URL=$(curl -s $DEPLOYER_URL:7777/v1/deployments/$1/services | jq '.data' | jq 'with_entries(select(.key=="workload-profiler"))' | jq '.[].publicUrl')
WORKLOAD_PROFILER_URL=${WORKLOAD_PROFILER_URL//\"/}
APP_NAME="resource-worker-service"
curl -XPOST -H "Content-Type:application/json" \
$WORKLOAD_PROFILER_URL/clusterMetrics/apps/$APP_NAME \
--data @<(cat <<EOF
{
"loadTesters": [
{
"slowCookerController" : {
"calibrate" : {
"step": 5,
"initialConcurrency": 40,
"runsPerIntensity": 3
},
"appLoad": {
"url": "http://resource-worker-0.default:7998/run",
"qps": 5,
"data": "@/etc/request_bodies",
"method": "POST",
"totalRequests": 100000
},
"loadTime": "30s"
},
"name": "slow-cooker"
}
],
"benchmarks" : [
{
"name": "cpu",
"intensity": 10
}
],
"duration": "30s"
}
EOF
)