【问题标题】:Logging and replaying RealityServer Web Services requests记录和重放 RealityServer Web 服务请求
【发布时间】:2015-08-05 09:11:12
【问题描述】:

我正在尝试诊断我的 RealityServer 应用程序的问题,但是使用我的应用程序用户界面手动重现问题变得非常耗时。

有什么方法可以记录和重放 RealityServer 接收到的 JSON-RPC Web 服务命令,这样我就可以在不使用应用程序用户界面的情况下重现我的问题?

【问题讨论】:

    标签: 3d json-rpc realityserver


    【解决方案1】:

    RealityServer 提供了两种监控请求的工具。您可能对这种情况感兴趣的主要插件是 RealityServer 附带的 Commandlog 插件,但默认情况下是禁用的。您需要编辑您的 realityserver.conf 文件并取消注释相关行。这是文件的相关部分:

    # 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>
    

    如上所述,启用此状态处理程序会将所有 JSON-RPC 请求记录到一个特殊的 Python 文件中。然后你可以像这样运行这个文件:

    python replay.py 127.0.0.1:8080
    

    这会将记录的命令序列发送到正在运行的 RealityServer。命令将与录制的命令完全相同,但不包括时间,因此将尽可能快地播放。如果您的问题对时间敏感,您可能需要使用其他方法来捕获和重放数据。

    注意: RealityServer 在启动时会覆盖 replay.py 文件,因此如果您希望在启动之间保留该文件,则必须将该文件复制到另一个名称。如果您使用脚本自动重启 RealityServer,则需要注意包含一个复制文件的步骤。

    如果您希望记录所有 HTTP 请求而不仅仅是 JSON-RPC 请求,您还可以添加以下 realityserver.conf 选项:

    http_log access.log
    

    这将以 Apache Log 格式记录所有请求,这对于与支持该格式的工具一起使用很有用。可以在here 找到完整的 RealityServer 配置选项列表。

    【讨论】:

      【解决方案2】:

      要么用你选择的任何编程语言为它编写你自己的程序,要么试试Fiddler。 Fiddler 可以记录 HTTP 会话并重放它们。

      【讨论】:

        猜你喜欢
        • 2013-02-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-03-11
        • 2011-11-02
        • 2011-02-25
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多