9b5b5eb6dee686263c4f7752685e33d77ddeea9c
[integration.git] / test / mocks / datafilecollector-testharness / dr-sim / README.md
1 ###Alternative to running python (as described below) on your machine, use the docker files.
2 1. Build docker container with ```docker build -t drsim_common:latest .```
3 2. Run the container ```docker-compose up```
4 3. For specific behavior of of the simulators, add arguments to the `command` entries in the `docker-compose.yml`.
5 For example `command: node dmaapDR.js --tc no_publish` . (No argument will assume '--tc normal'). Run `node dmaapDR.js --printtc`
6 and `node dmaapDR-redir.js --printtc` for details. 
7
8
9
10 1. install nodejs
11 2. install npm
12 Make sure that you run these commands in the application directory "dr-sim"
13 3. `npm install express`
14 4. `npm install argparse`
15 5. `node dmaapDR.js`   #keep it in the foreground, see item 3 in the above list for arg to the simulator
16 6. `node dmaapDR_redir.js`  #keep it in the foreground, see item 3 in the above list for arg to the simulator
17
18
19 The dmaapDR_redir server send callback to dmaapDR server to update the list of successfully published files.
20 As default, the ip for dmaapDR is set to work when running as container (using an ip address from the dfc_net docker network) . When running the servers from command line, set the env variable DR_SIM_IP=localhost
21
22 The simulator can be queried for statistics (use curl from cmd line or open in browser, curl used below):
23
24 DR
25
26 `curl localhost:3906/ctr_publish_query` - returns the number of publish queries
27
28 `curl localhost:3906/ctr_publish_query_published` - returns the number of responses where the files was published
29
30 `curl localhost:3906/ctr_publish_query_not_published` - returns the number of responses where the file was not published
31
32 `curl localhost:3906/ctr_publish_req` - returns the number of publish requests
33
34 `curl localhost:3906/ctr_publish_req_redirect` - returns the number of publish responses with redirect
35
36 `curl localhost:3906/ctr_publish_req_published` - returns the number of publish responses without redirect
37
38 `curl localhost:3906/ctr_published_files` - returns the number of unique published files
39
40 `curl localhost:3906/tc_info` - returns the tc name (argument on the command line)
41
42 `curl localhost:3906/execution_time` - returns the execution times in mm:ss
43
44 `curl localhost:3906/ctr_double_publish` - returns the number of double published files
45
46
47 DR REDIR
48
49 `curl localhost:3908/ctr_publish_requests` - returns the number of publish queries
50
51 `curl localhost:3908/ctr_publish_responses` - returns the number of publish responses
52
53 `curl localhost:3908/tc_info` - returns the tc name (argument on the command line)
54
55 `curl localhost:3908/execution_time` - returns the execution times in mm:ss
56
57 `curl localhost:3908/time_lastpublish` - returns the time (mm:ss) for the latest publish
58
59 `curl localhost:3908/dwl_volume` - returns the total received data volume of file data