Logging and replaying RealityServer web service requests

I am trying to diagnose a problem with my RealityServer application, however it becomes very time consuming for the user to manually use problems using the application user interface.

Is there a way to register and play back the JSON-RPC Web Services commands that RealityServer receives so that I can reproduce my problems without using the application user interface?

+5
source share
2 answers

RealityServer provides two tools for controlling requests. The main one, which you are probably interested in, is the Commandlog plugin, which comes with RealityServer but is disabled by default. You need to edit the realityserver.conf file and uncomment the corresponding lines. Here is the relevant part of the file:

# uncomment below to enable the command logging state handler. # this will record every JSON-RPC command received during a RealityServer # session into a python script which can later be replayed to re-run the # session. this can be useful for tracking down bugs. # note that when enabled this will overwrite the replay.py file every # time RealityServer starts so you must ensure you make a copy of any # file you wish to keep. The file is created in the working directory, # not the RealityServer root. <url .*> state Commandlog_state_handler </url> 

As described, this state handler will write all JSON-RPC requests to a special Python file. Then you can run this file as follows:

 python replay.py 127.0.0.1:8080 

Then a sequence of recorded commands will be sent to the running RealityServer. The teams will be exactly the same as the recorded ones, but will not include the time, so they will play as quickly as possible. If your problem is time sensitive, you may need to use an alternative method for collecting and reproducing data.

NOTE. RealityServer overwrites the replay.py file at startup, so you must copy the file to a different name if you want to save it between runs. If you use a script to automatically restart RealityServer, you will need to take care to take a step to copy the file.

If you want to register all HTTP requests, not just JSON-RPC requests, you can also add the following realityserver.conf parameter:

 http_log access.log 

This will log all requests in the Apache log format, which may be useful for use with tools that support this format. A complete list of RealityServer configuration options can be found here .

+4
source

Either write your own program in any programming language of your choice, or try Fiddler . Fiddler can record and play HTTP sessions.

+1
source

All Articles