Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse output's an array when there is only a single Json Object #13

Open
johnaohara opened this issue Jul 19, 2022 · 1 comment
Open
Labels
question Further information is requested

Comments

@johnaohara
Copy link
Member

johnaohara commented Jul 19, 2022

Given the following rule;

---
name: wrk2
path: "wrk2-(?<runtimeName>[^\\./]+)-jvm-(?<txRate>[^\\./]+).log"
nest: "wrk2.${{runtimeName}}.${{txRate}}"
asText: 
  - name: centile50
    pattern: "50.000%\\s*(?<centile50:String>\\d+\\.\\d+m?)s"
    eat: Line
  - name: centile99999
    pattern: "99.999%\\s*(?<centile99999:String>\\d+\\.\\d+m?)s"
    eat: Line
  - name: reqSec
    pattern: "^Requests/sec:\\s*(?<reqSec>\\d+\\.\\d+)"
    eat: Line
---

And file wrk2-quarkus-jvm-2000.log with contents;

Running 30s test @ http://localhost:8080/api
  16 threads and 400 connections
...
  Latency Distribution (HdrHistogram - Recorded Latency)
 50.000%    1.04ms
 75.000%    1.32ms
 90.000%    1.66ms
 99.000%    2.17ms
 99.900%    3.07ms
 99.990%    5.57ms
 99.999%   13.47ms
100.000%   13.47ms
...
  59892 requests in 30.00s, 65.17MB read
Requests/sec:   1996.32
Transfer/sec:      2.17MB

The output Json nested under wrk2.quarkus.2000 is a Json Array with a single object;

{
  "wrk2": {
    "quarkus": {
      "2000": [ 
        {
          "centile50": "9.00",
          "centile99999": "15.34",
          "reqSec": 8595.75
        }
      ]
    }
  }
}

Is there currently a way of outputting this as a Json Object, such that the output is;

{
  "wrk2": {
    "quarkus": {
      "2000": {
        "centile50": "9.00",
        "centile99999": "15.34",
        "reqSec": 8595.75
      }
    }
  }
}
@johnaohara johnaohara added the question Further information is requested label Jul 19, 2022
@johnaohara
Copy link
Member Author

Added a temp hack to yaup to get round this : johnaohara/yaup@d2a2813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant