dongpingwu8378 2017-09-28 10:00
浏览 284
已采纳

Xhprof / xhgui:xhgui - 要插入的文档包含无效键:键不能包含“。”

I'm trying to setup Xhgui with Xhprof. I followed the github instructions (https://github.com/perftools/xhgui), but this error message keeps appearing in error logs :

"xhgui - document to insert contains invalid key: keys cannot contain ".": "main()==>load..."

Looks like mongoDB can't use dots in keys, but yet Xhgui is trying to do that.

Is there a way do disable this limitation in mongoDB ? Or to fix this bug in Xhgui ?

  • 写回答

1条回答 默认 最新

  • dpprx26000 2017-11-29 08:50
    关注

    https://github.com/perftools/xhgui/issues/209#issuecomment-339281276

    For anyone experiencing this issue, I was able to make it work by adding the following snippet of code to xhgui/external/header.php right before ignore_user_abort(true); call. Not sure how correct is this and if it could affect anything else, but it did the trick for me.

        $profile = [];
        foreach($data['profile'] as $key => $value) {
            $profile[strtr($key, ['.' => '_'])] = $value;
        }
        $data['profile'] = $profile;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?