From 69311bf8082471be45574c9a99b23e31e606669c Mon Sep 17 00:00:00 2001 From: maximesson Date: Fri, 30 Aug 2019 14:05:15 +0000 Subject: Updated README files and adaptation of consul/cbs config Change-Id: I81494f56978a3d0ff06ec0d66968f33f08114103 Issue-ID: DCAEGEN2-1719 Signed-off-by: maximesson --- .../datafilecollector-testharness/dr-sim/README.md | 172 ++++++++++++++++++--- 1 file changed, 148 insertions(+), 24 deletions(-) (limited to 'test/mocks/datafilecollector-testharness/dr-sim') diff --git a/test/mocks/datafilecollector-testharness/dr-sim/README.md b/test/mocks/datafilecollector-testharness/dr-sim/README.md index 9b5b5eb6d..a258ed46d 100644 --- a/test/mocks/datafilecollector-testharness/dr-sim/README.md +++ b/test/mocks/datafilecollector-testharness/dr-sim/README.md @@ -1,59 +1,183 @@ -###Alternative to running python (as described below) on your machine, use the docker files. +###Run DR simulators as docker container 1. Build docker container with ```docker build -t drsim_common:latest .``` 2. Run the container ```docker-compose up``` 3. For specific behavior of of the simulators, add arguments to the `command` entries in the `docker-compose.yml`. For example `command: node dmaapDR.js --tc no_publish` . (No argument will assume '--tc normal'). Run `node dmaapDR.js --printtc` -and `node dmaapDR-redir.js --printtc` for details. - +and `node dmaapDR-redir.js --printtc` for details or see further below for the list of possible arg to the simulator +###Run DR simulators and all other simulators as one group +See the README in the 'simulator-group' dir. +###Run DR simulators from cmd line 1. install nodejs 2. install npm Make sure that you run these commands in the application directory "dr-sim" 3. `npm install express` 4. `npm install argparse` -5. `node dmaapDR.js` #keep it in the foreground, see item 3 in the above list for arg to the simulator -6. `node dmaapDR_redir.js` #keep it in the foreground, see item 3 in the above list for arg to the simulator +5. `node dmaapDR.js` #keep it in the foreground, see below for a list for arg to the simulator +6. `node dmaapDR_redir.js` #keep it in the foreground, see below for a list for arg to the simulator + +###Arg to control the behavior of the simulators + +**DR** + + --tc tc_normal Normal case, query response based on published files. Publish respond with ok/redirect depending on if file is published or not.
+ --tc tc_none_published Query respond 'ok'. Publish respond with redirect.
+ --tc tc_all_published Query respond with filename. Publish respond with 'ok'.
+ --tc tc_10p_no_response 10% % no response for query and publish. Otherwise normal case.
+ --tc tc_10first_no_response 10 first queries and requests gives no response for query and publish. Otherwise normal case.
+ --tc tc_100first_no_response 100 first queries and requests gives no response for query and publish. Otherwise normal case.
+ --tc tc_all_delay_1s All responses delayed 1s (both query and publish).
+ --tc tc_all_delay_10s All responses delayed 10s (both query and publish).
+ --tc tc_10p_delay_10s 10% of responses delayed 10s, (both query and publish).
+ --tc tc_10p_error_response 10% error response for query and publish. Otherwise normal case.
+ --tc tc_10first_error_response 10 first queries and requests gives no response for query and publish. Otherwise normal case.
+ --tc tc_100first_error_response 100 first queries and requests gives no response for query and publish. Otherwise normal case.
+ + +**DR Redirect** + + --tc_normal Normal case, all files publish and DR updated.
+ --tc_no_publish Ok response but no files published.
+ --tc_10p_no_response 10% % no response (file not published).
+ --tc_10first_no_response 10 first requests give no response (files not published).
+ --tc_100first_no_response 100 first requests give no response (files not published).
+ --tc_all_delay_1s All responses delayed 1s, normal publish.
+ --tc_all_delay_10s All responses delayed 10s, normal publish.
+ --tc_10p_delay_10s 10% of responses delayed 10s, normal publish.
+ --tc_10p_error_response 10% error response (file not published).
+ --tc_10first_error_response 10 first requests give error response (file not published).
+ --tc_100first_error_response 100 first requests give error responses (file not published).
+ + +###Needed environment + +DR + + DRR_SIM_IP Set to host name of the DR Redirect simulator "drsim_redir" if running the simulators in a docker private network. Otherwise to "localhost" + DR_FEEDS A comma separated list of configured feednames and filetypes. Example "1:A,2:B:C" - Feed 1 for filenames beginning with A and feed2 for filenames beginning with B or C. + +`DRR_SIM_IP` is needed for the redirected publish request to be redirected to the DR redirect server. + +DR Redirect (DRR for short) + DR_SIM_IP Set to host name of the DR simulator "drsim" if running the simulators in a docker private network. Otherwise to "localhost" + DR_REDIR_FEEDS Same contentd as DR_FEEDS for DR. -The dmaapDR_redir server send callback to dmaapDR server to update the list of successfully published files. -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 +The DR Redirect server send callback to DR server to update the list of successfully published files. +When running as container (using an ip address from the `dfc_net` docker network) the env shall be set to 'drsim'. . When running the servers from command line, set the env variable `DR_SIM_IP=localhost` +###APIs for statistic readout The simulator can be queried for statistics (use curl from cmd line or open in browser, curl used below): DR -`curl localhost:3906/ctr_publish_query` - returns the number of publish queries -`curl localhost:3906/ctr_publish_query_published` - returns the number of responses where the files was published +`curl localhost:3906/` - returns 'ok' + +`curl localhost:3906/tc_info` - returns the tc id + +`curl localhost:3906/execution_time` - returns the execution time in the format mm_ss + +`curl localhost:3906/feeds` - returns the list of configured feeds + +`curl localhost:3906/ctr_publish_query` - returns the number of publish queries for all feeds + +`curl localhost:3906/feeds/ctr_publish_query` -returns a list of number of publish queries in each feed + +`curl localhost:3906/ctr_publish_query/` - returns the number of publish queries for a feed + +`curl localhost:3906/ctr_publish_query_published` - returns the number of query responses for all feeds where the files were published + +`curl localhost:3906/feeds/ctr_publish_query_published` - returns a list of the number of query responses for each feed where the files were published + +`curl localhost:3906/ctr_publish_query_published/` - returns the number of query responses for a feed where the files were published + +`curl localhost:3906/ctr_publish_query_not_published` - returns the number of query responses for all feed where the files were not published + +`curl localhost:3906/feeds/ctr_publish_query_not_published` - returns a list of the number of query responses for each feed where the files were not published + +`curl localhost:3906/ctr_publish_query_not_published/` - returns the number of query responses for a feed where the files were not published + +`curl localhost:3906/ctr_publish_req` - returns the number of publish requests for all feeds + +`curl localhost:3906/feeds/ctr_publish_req` - returns a list of the number of publish requests for each feed + +`curl localhost:3906/ctr_publish_req/` - returns the number of publish requests for feed + +`curl localhost:3906/ctr_publish_req_redirect` - returns the number of publish responses with redirect for all feeds + +`curl localhost:3906/feeds/ctr_publish_req_redirect` - returns a list of the number of publish responses with redirect for each feed + +`curl localhost:3906/ctr_publish_req_redirect/` - returns the number of publish responses with redirect for a feed + +`curl localhost:3906/ctr_publish_req_published` - returns the number of publish responses where files have been published (no redirect) for all feeds + +`curl localhost:3906/feeds/ctr_publish_req_published` - returns a list of the number of publish responses where files have been published (no redirect) for each feeds + +`curl localhost:3906/ctr_publish_req_published/` - returns the number of publish responses where files have been published (no redirect) for a feed + +`curl localhost:3906/ctr_published_files` - returns the number of published files for all feeds + +`curl localhost:3906/feeds/ctr_published_files` - returns a list of the number of published files for each feed + +`curl localhost:3906/ctr_published_files/` - returns the number of published files for a feed + +`curl localhost:3906/ctr_double_publish` - returns the number of double published files for all feeds + +`curl localhost:3906/feeds/ctr_double_publish` - returns a list of the number of double published files for each feed + +`curl localhost:3906/ctr_double_publish/` - returns a list of the number of double published files for a feed + +`curl localhost:3906/ctr_publish_query_bad_file_prefix` - returns the number of publish queries with bad file prefix for all feeds + +`curl localhost:3906/feeds/ctr_publish_query_bad_file_prefix` - returns a list of the number of publish queries with bad file prefix for each feed + +`curl localhost:3906/ctr_publish_query_bad_file_prefix/` - returns a list of the number of publish queries with bad file prefix for a feed + + +DR Redirect + + +`curl localhost:3908/` - returns 'ok' + +`curl localhost:3908/tc_info` - returns the tc id + +`curl localhost:3908/execution_time` - returns the execution time in the format mm:ss + +`curl localhost:3908/feeds` - returns the list of configured feeds + +`curl localhost:3908/speed` - returns the speed in published files per second + +`curl localhost:3908/ctr_publish_requests` - returns the number of publish requests for all feeds + +`curl localhost:3908/feeds/ctr_publish_requests` - returns a list of the number of publish requests for each feed -`curl localhost:3906/ctr_publish_query_not_published` - returns the number of responses where the file was not published +`curl localhost:3908/ctr_publish_requests/` - returns the number of publish requests for a feed -`curl localhost:3906/ctr_publish_req` - returns the number of publish requests +`curl localhost:3908/ctr_publish_requests_bad_file_prefix` - returns the number of publish requests with bad file prefix for all feeds -`curl localhost:3906/ctr_publish_req_redirect` - returns the number of publish responses with redirect +`curl localhost:3908/feeds/ctr_publish_requests_bad_file_prefix` - returns a list of the number of publish requests with bad file prefix for each feed -`curl localhost:3906/ctr_publish_req_published` - returns the number of publish responses without redirect +`curl localhost:3908/ctr_publish_requests_bad_file_prefix/` - returns the number of publish requests with bad file prefix for a feed -`curl localhost:3906/ctr_published_files` - returns the number of unique published files +`curl localhost:3908/ctr_publish_responses` - returns the number of publish responses for all feeds -`curl localhost:3906/tc_info` - returns the tc name (argument on the command line) +`curl localhost:3908/feeds/ctr_publish_responses` - returns a list of the number of publish responses for each feed -`curl localhost:3906/execution_time` - returns the execution times in mm:ss +`curl localhost:3908/ctr_publish_responses/` - returns the number of publish responses for a feed -`curl localhost:3906/ctr_double_publish` - returns the number of double published files +`curl localhost:3908/time_lastpublish` - returns the time of the last successful publish in the format mm:ss for any feed +`curl localhost:3908/feeds/time_lastpublish` - returns a list of the time of the last successful publish in the format mm:ss for each feed -DR REDIR +`curl localhost:3908/time_lastpublish/` - returns the time of the last successful publish in the format mm:ss for a feed -`curl localhost:3908/ctr_publish_requests` - returns the number of publish queries +`curl localhost:3908/dwl_volume` - returns the number of bytes of published files for all feeds -`curl localhost:3908/ctr_publish_responses` - returns the number of publish responses +`curl localhost:3908/feeds/dwl_volume` - returns a list of the number of bytes of the published files for each feed -`curl localhost:3908/tc_info` - returns the tc name (argument on the command line) +`curl localhost:3908/dwl_volume/` - returns the number of bytes of the published files for a feed -`curl localhost:3908/execution_time` - returns the execution times in mm:ss -`curl localhost:3908/time_lastpublish` - returns the time (mm:ss) for the latest publish -`curl localhost:3908/dwl_volume` - returns the total received data volume of file data -- cgit 1.2.3-korg