LAVA Custom Test JSON File Parse Pattern Format

Asked by Ryan Barnett on 2012-07-12

I'm currently working on getting a custom test job (lmbench) implemented with LAVA. I'm currently stuck on trying to get LAVA to parse my results correctly. I'm currently not familiar with how I need to implement the regular expression in the .json file in order for lava to parse it correctly. The correct regular expression that works with python is as follows:


Here is my attempt at creating a json file to make my test work. The test runs fine and says it passes but it just isn't capturing the data I want. What do I need to do in order for the pattern to work correctly? Also is there any documentation on the format that this pattern needs to be in (since I haven't been able to find any)?

   "format": "Lava-Test Test Definition 1.0",
   "test_id": "lmbench",
   "run": {
      "steps": ["/usr/bin/python /root/ /root/test_metrics.csv"]
   "parse": {
      "pattern": "^(?P<test_case_id>\\w+)\\s+:\\s+(?P<measurement>[\\d\\.]+)\\s+:\\s+(?P<units>[^\\s]+)",
      "appendall": {
         "result": "pass"

Example output that LAVA captures

    2+0 records in
    2+0 records out
    read_throughput_64kB_blocks : 170.97 : MB/sec
    read_data_to_proc_throughput : 270.10 : MB/sec
    write_data_to_proc_throughput : 1303.54 : MB/sec
    write_latency_metric : 1.7994 : usec
    read_latency_metric : 1.1746 : usec
    open-close_latency_metric : 25.6473 : usec


Question information

English Edit question
Obsolete LAVA Test Edit question
No assignee Edit question
Solved by:
Michael Hudson-Doyle
Last query:
Last reply:
Ryan Barnett (ryanbarnett3) said : #1

So I may have panicked too soon since the the json file file for my test works with the pattern that I copied an pasted into this question:

   "pattern": "^(?P<test_case_id>\\w+)\\s+:\\s+(?P<measurement>[\\d\\.]+)\\s+:\\s+(?P<units>[^\\s]+)",

However, my question of what the format needs to be for this still exists since I had to figure this out through trial and error.

Ryan Barnett (ryanbarnett3) said : #3

Thanks Michael Hudson-Doyle, that solved my question.