[autotest] test can output graph name when calling output_perf_value

Previously, if we want to group several perf measurements together
to be displayed on the same graph, we need to specify the mapping
information in perf_dashbaord_config.json. However, some tests
like telemetry_Benchmarks output many metrics. We would end up
with a very huge config file if we specify them all. It would require
much efforts if those metrics change in the future.
This change is to allow test to output graph names dynamically.

1) output_perf_value now takes a new arg 'graph'. This value is
written to the json file perf_measurements.
2) a new column 'graph' is added to the database table
   tko_iteration_perf_value.
3) the tko parser is modified to store the value of 'graph' from
   perf_measurements to the database.
4) perf_uploader is modified to upload a perf measurement to the
   specific graph if 'graph' is set.

Example:
Previously, if we wanted to specify group "metric1" and "metric2"
to the same graph "metricGroupA", and group "metric3" and "metric4"
to "metricGroupB", the json needed to look like:
{
  “autotest_name”: “myTest”,
  “master_name”: “myMaster”,
  “dashboard_test_name”: “myCoolTest”
  “graphs”: [
    {
      “graph_name”: “metricGroupA”,
      “descriptions”: [“metric1”, “metric2”]
    },
    {
      “graph_name”: “metricGroupB”,
      “descriptions”: [“metric3”, “metric4”]
    },

  ]
}
After this change list lands, the json file will not
take "graphs" configuration. It will look like.
{
  “autotest_name”: “myTest”,
  “master_name”: “myMaster”,
  “dashboard_test_name”: “myCoolTest”
}
Meanwhile, the test should call
output_perf_value(description="metric1", units=.., higher_is_better=..,
                  graph='metricGroupA')
output_perf_value(description="metric2", units=.., higher_is_better=..,
                  graph='metricGroupA')
output_perf_value(description="metric3", units=.., higher_is_better=..,
                  graph='metricGroupB')
output_perf_value(description="metric4", units=.., higher_is_better=..,
                  graph='metricGroupB')

BUG=chromium:315274
TEST=1) Verified all unit tests passed: version_1_unittest.py,
        perf_uploader_unittest.py
     2) Modify perf_uploader.py to use staging perf dashboard server
        _DASHBOARD_UPLOAD_URL =
                'https://chrome-perf.googleplex.com/add_point'
        Modify platform_BootPerfServer to output graph name.
        Invoked platform_BootPerfServer from local AFE.
        Verify that the perf_measurements file have the graph name.
        Verify that the data was displayed correctly in the dashboard.
     3) python migrate.py sync 82, to verify column 'graph' get created
        python migrate.py sync 81, to verify column 'graph' is dropped
DEPLOY=migrate (/usr/local/autotest/database$ python migrate.py sync 82)

Change-Id: I0b746f4ab3162eb7ba4aefa12294b7a60e326513
Reviewed-on: https://chromium-review.googlesource.com/176575
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Commit-Queue: Fang Deng <fdeng@chromium.org>
Tested-by: Fang Deng <fdeng@chromium.org>
6 files changed