krakjoe/stat

Invalid JSON

rawkode opened this issue · 4 comments

I'm seeing most rows return invalid JSON:

{"type": "memory", "request": {"pid": 1, "elapsed": 459.8017914020"method": "GET", "uri": "/favicon.ico"}, "elapsed": 462.8011108600, "memory": {"used": 0, "peak": 0}}

I've looked in the sample file and I see elapsed written in 2 places, but I am unsure what the exact cause of the bug is

This happens when using the built-in PHP webserver and a 404 request:

php -S 0.0.0.0:8080 index.php

and the browser request favicon.ico, which doesn't exist.

Sorry about the delay there :)

nebez commented

Closed because it's solved? Or is the solution to avoid using the PHP dev web server?

I'll submit a PR to update documentation if it's the second scenario. Would be nice to give future devs a heads up.

Sarke commented

I'm still seeing the invalid JSON:

{
  "type": "memory",
  "request": {
    "pid": 3501,
    "elapsed": 214.3085691649,
    "path": "/app/junk/stat/index.php",
    "method":GET", "uri":/"
  },
  "elapsed": 214.3087453218,
  "memory": {
    "used": 0,
    "peak": 0
  }
}