[PATCH] D34584: Introduce new JSON import format

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 17:10:49 PDT 2017


MatzeB created this revision.
Herald added a subscriber: mcrosier.

This redesigns to get a new simpler import format for LNT. With plans to
use the same format for exporting.

- Go for lowercase keys without spaces.
- Drop Run/Info/tag: json itself is a schemaless format so it feels more natural without one. The LNT testsuite type is now determined by the submit URL used, or the '-s' commandline flag on the commandline. Both default to 'nts' if omitted.
- Drop the renaming where we would use different names for import ("info_key") than inside the lnt database. Just expect the lnt database names.
- Simplify the format by flattening Machine/Info into Machine and Run/Info into Run.

Previously:

  "Machine": {
    "name": "mymachine",
    "Info": {
      "hardware": "HAL 9000"
    }
  },
  "Run": {
    "Start Time": "2017-05-16 21:31:42",
    "End Time": "2017-05-16 21:31:42",
    "Info": {
      "__report_version__": "1",
      "tag": "nts",
      "run_order": "123456"
    }
  }

Now:

  "machine": {
    "name": "mymachine",
    "hardware": "HAL 9000"
  },
  "run": {
    "start_time": "2017-05-16 21:31:42",
    "end_time": "2017-05-16 21:31:42",
    "llvm_project_revision": "123456"
  }

- Reorganize test data, so we have 1 record for each tests containing all the metrics.
- Drop the "Info" record for tests (the v4db would refuse to take non-empty Info records anyway).
- Again no renaming of test metrics from "info_key" anymore.

Previously:

  "Tests": [
     { "Data": [ 7, 42 ],
       "Name": "nts.SingleSource/Benchmarks/Adobe-C++/functionobjects.compile",
       "Info": {}
     },
     { "Data": [ 13 ],
       "Name": "nts.SingleSource/Benchmarks/Adobe-C++/functionobjects.exec",
       "Info": {}
     },
     { "Data": [ 11 ],
       "Name": "nts.SingleSource/Benchmarks/Adobe-C++/functionobjects.exec",
       "Info": {}
     },
     { "Data": [ "49333a87d501b0aea2191830b66b5eec" ],
       "Name": "nts.SingleSource/Benchmarks/Adobe-C++/functionobjects.hash",
       "Info": {}
     }
  ]

Now:

  "test": [
      {
          "name": "SingleSource/Benchmarks/Adobe-C++/functionobjects",
          "compile_time": [ 7, 42 ],
          "execution_time": [ 13, 11 ],
          "hash": "49333a87d501b0aea2191830b66b5eec"
      }
  ]

- Implements upgrade logic for submissions in the old format
- I will submit a separate patch to remove the "info_key" columns from the LNT database.
- I will submit a separate patch to have the runtest tests submit in the new format.
- This has been discussed with Chris Matthews to make sure the new REST export APIs will spit out the same format, so users only need to learn one format and it becomes easier to move data around servers.


Repository:
  rL LLVM

https://reviews.llvm.org/D34584

Files:
  docs/importing_data.rst
  lnt/lnttool/import_data.py
  lnt/lnttool/main.py
  lnt/lnttool/viewcomparison.py
  lnt/server/db/migrations/upgrade_11_to_12.py
  lnt/server/db/testsuitedb.py
  lnt/server/db/v4db.py
  lnt/server/ui/views.py
  lnt/testing/__init__.py
  lnt/tests/builtintest.py
  lnt/tests/compile.py
  lnt/tests/nt.py
  lnt/tests/test_suite.py
  lnt/util/ImportData.py
  lnt/util/ServerUtil.py
  tests/lnttool/submit.py
  tests/server/db/ImportV4TestSuiteInstance.py
  tests/server/db/search.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34584.103808.patch
Type: text/x-patch
Size: 38759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170624/e3396eef/attachment-0001.bin>


More information about the llvm-commits mailing list