|
@@ -1,7 +1,69 @@
|
1
|
1
|
#!/bin/bash
|
|
2
|
+#
|
|
3
|
+# CBL : Curl Benchmark on Lodel
|
|
4
|
+#
|
|
5
|
+# Usage : $0 [HOSTNAME] [INSTANCE_LIST_FILE]
|
|
6
|
+#
|
|
7
|
+# Instance_list_file is expected to be a file containing instances name (1 per
|
|
8
|
+# line). Uses by default /tmp/lodel2_instance_list.txt
|
|
9
|
+#
|
|
10
|
+# Instances base URL are generated given the current webui implementation :
|
|
11
|
+# http://HOST/INSTANCE_NAME/
|
|
12
|
+#
|
|
13
|
+#
|
|
14
|
+# Scenario description :
|
|
15
|
+#
|
|
16
|
+# mass_creation instance_name iteration_count :
|
|
17
|
+# Create iteration_count time a random leobject in given instance_name
|
|
18
|
+# note : do note create relation between objects, only populate content
|
|
19
|
+#
|
|
20
|
+# step 1 : fetch all non abstract class name
|
|
21
|
+# step 2 : loop on creation (using bash function curl_opt_create_CLSNAME)
|
|
22
|
+# that return the POST fields (populated with random values)
|
|
23
|
+#
|
|
24
|
+# mass_deletion instance_name iteration_count :
|
|
25
|
+# Foreach non asbtracty class delete iteration_count time an object of
|
|
26
|
+# current class in current instance
|
|
27
|
+#
|
|
28
|
+# step 1 : fetch all non abstract class name
|
|
29
|
+# step 2 : loop on non abstract class name
|
|
30
|
+# step 3 : loop iteration_count time on deletion
|
|
31
|
+#
|
|
32
|
+# mass_link_edit instance_name iteration_count :
|
|
33
|
+# Foreach non abstract class make iteration_count time edition of an
|
|
34
|
+# object in current class
|
|
35
|
+# note : only implemented for Person for the moment
|
|
36
|
+# note : can maybe ask for invalid modifications
|
|
37
|
+#
|
|
38
|
+# step 1 : fetch all non abstract class name
|
|
39
|
+# step 2 : loop on non abstract class name
|
|
40
|
+# step 3 : depends on curent class :
|
|
41
|
+# - fetch all existing id of current class
|
|
42
|
+# - fetch all existing id in class that can be linked with
|
|
43
|
+# current class
|
|
44
|
+# step 4 : loop iteration_count time :
|
|
45
|
+# - choose a random id in current class
|
|
46
|
+# - choose random ids from linkable classes
|
|
47
|
+# - trigger edition using curl (with datas from the same
|
|
48
|
+# bash function than creation : curl_opt_create_CLSNAME)
|
|
49
|
+#
|
|
50
|
+# Current way to run scenarios :
|
|
51
|
+#
|
|
52
|
+# using the function run_bg_with_param FUNCTION_NAME INSTANCE_LIST_FILE *ARGS
|
|
53
|
+#
|
|
54
|
+# The function name can be one of the scenario functions
|
|
55
|
+# INSTANCE_LIST_FILE is the file containing instances list
|
|
56
|
+# *ARGS are args given as it to FUNCTION_NAME after the instance_name argument
|
|
57
|
+#
|
|
58
|
+# function call : FUN_NAME INSTANCE_NAME *ARGS
|
|
59
|
+#
|
|
60
|
+# The run_bg_with_param run a scenario in background for each instance allowing
|
|
61
|
+# to send a lot of request at the same time
|
|
62
|
+#
|
|
63
|
+#
|
2
|
64
|
|
3
|
65
|
usage() {
|
4
|
|
- echo "Usage : $0 [HOST] [INSTANCE_LIST_FILE]"
|
|
66
|
+ echo "Usage : $0 [HOSTNAME] [INSTANCE_LIST_FILE]"
|
5
|
67
|
exit
|
6
|
68
|
}
|
7
|
69
|
|
|
@@ -20,8 +82,6 @@ then
|
20
|
82
|
fi
|
21
|
83
|
mkdir -p $logdir
|
22
|
84
|
|
23
|
|
-random_word_file="/usr/share/dict/words"
|
24
|
|
-
|
25
|
85
|
#curl_options='--silent -o /dev/null -s -w %{http_code}:%{time_connect}:%{time_starttransfer}:%{time_total}\n'
|
26
|
86
|
curl_options='--silent -o /dev/null -s -w %{url_effective};%{http_code};%{time_connect};%{time_starttransfer};%{time_total}\n'
|
27
|
87
|
curl_debug_opt='-v -w %{url_effective};%{http_code};%{time_connect};%{time_starttransfer};%{time_total}\n'
|