Perfomatic:API: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 84: Line 84:
  }
  }


               
=== Get test runs (data) ===               
* '''/api/test/runs?testid=''testid''&branchid=''branchid''&osid=''osid''''' - returns test runs for a specific testid buildid and osid, default date limit is 4 weeks, sorted by date descending
* http://graphs.mozilla.org/api/test/runs?testid=TESTID&branchid=BRANCHID&machineid=MACHINEID
* returns test runs for a specific test, build and machine, default date limit is 4 weeks, sorted by date descending
** Data is sent in a compressed form due to the large amount of information
** Data is sent in a compressed form due to the large amount of information
** Indexes:
** Indexes:
Line 107: Line 108:
     ]
     ]
  }
  }
* '''/api/test/''testid''/runs/''testRunId''''' - returns test run information for a specific testRunId
 
=== Get test run information ===
* /api/test/runs/?testrun=TESTRUNID - returns test run information for a specific testRunId
** Example response
** Example response
  {
  {
Line 130: Line 133:
  }
  }


* '''/api/test/''testid''/runs/''testRunId''/values''' - returns test run results for a specific testRunId
=== Test run values (formerly discrete data) ===
* http://graphs.mozilla.org/api/test/runs/values?testrun=TESTRUNID
* returns test run results for a specific testRunId
** Example response
** Example response
  {
  {

Revision as of 03:01, 3 January 2009

The graph server API is a REST API with a JSON only response format.

Using getdata.cgi?

If you are, things are going to change.

The biggest change is how we store tests. Currently, a test id can give you test results in time:value intervals. In the new architecture a test id will only get you a description of that test, nothing more.

In order to get test data, you have to know the test AND build AND machine you want results for. The current architecture assumes this based on test id.

For example, let's assume you want test results for Tp3 tests. Querying graphs.mozilla.org/api/test gives you a list of tests by build and OS.

Documented endpoints

List tests

{
   'stat':'ok',
   'tests': [
            {
                'id':123,
                'name':'Tp3',
                'branch':
                {
                    'name':'1.9',
                    'id':3
                },
                'os':
                {
                    'name':'WinXP',
                    'id':2
                },
                'machine':
                {
                    'name':'qm-mini-ubuntu01 ',
                    'id':2
                }
            },
            {
                'id':23,
                'name':'Ts',
                'branch':
                {
                    'name':'1.9',
                    'id':3
                }
                'os':
                {
                    'name':'Vista',
                    'id':3
                }
                'machine':
                {
                    'name':'qm-mini-xp01',
                    'id':2
                }
            }
   ]
}

Get test

{
    'id':23,
    'name':'Ts',
    'branch':
    {
        'name':'1.9',
        'id':3
    },
    'os':
    {
        'name':'Vista',
        'id':3
    },
    'machine':
    {
        'name':'qm-mini-xp01',
        'id':2
    }
}

Get test runs (data)

{
  'stat':'ok',
  'test_runs': [
       [98, [23, '2007072704', '572a00c0e251'], 1208830929, 92.4, [['Something happened here', 988740]]],
       [99, [23, '2007072704', '572a00c0e251'], 1208834503, 87.3]
   ]
}

Get test run information

  • /api/test/runs/?testrun=TESTRUNID - returns test run information for a specific testRunId
    • Example response
{
   'stat':'ok',
   'testrun': {
       'id':98,
       'build': {
           'id':23,
           'build_id':'2007072704',
           'changeset':'572a00c0e251',
           'os':'Vista',
       },
       'date_run':1208830929,
       'average':92.4,
       'annotations': [
           {
              'note':'Something happened here',
              'bug_id':988740
           }
       ]
    }
}

Test run values (formerly discrete data)

{
   'stat':'ok',
   'values':[
       {
           'id':1,
           'value':22.3,
           'page':'www.yahoo.com'
       },
       {
           'id':3,
           'value':29.1,
           'page':'www.myspace.com'
       },
       {
           'id':1,
           'value':39.3,
           'page':'www.facebook.com'
       }
   ]
}

Error codes

  • Default error responses are as follows:
{
   'stat':'fail',
   'code':100,
   'message':'Test does not exist'
}