= Results Tracker - Implementation = The implementation of the [[LEP/ResultsTracker|Results Tracker]] is mostly concerned with storing and retrieving data, as opposed to exposing a web interface. So, the implementation emphasises sequence diagrams for interacting with the data and database schemas for representing the data internally. == Sequence Diagrams == This feature is concerned with interacting with the data which is expressed in the form of sequence diagrams defined below. === Submission Diagram === A submission consists of a session during which data is streamed from the client to the Results Tracker. {{attachment:ResultsTrackerSubmissionDiagram.png|Submission Diagram}} [[attachment:ResultsTrackerSubmissionDiagram.png|Dot file]] * As researched in [[http://cr3bits.wordpress.com/2009/06/29/streaming-test-results/|Streaming Test Results]], the interface should make it possible to submit results from the client in constant memory. === Report Diagram === The report diagram consists of the RESTful interface which will be exposed by the Results Tracker. * Assuming the Results Tracker becomes a core feature of Launchpad, it should be completely accessible through launchpadlib. == Database Schemas == This feature is also concerned with the models which will determine the extent of the data being stored. To make sure this data is at least complete, the database schemas are defined below. * Note that a double arrow indicates a many to many relationship which is usually expressed with a join table, but this clutters the schema. === Device Schema === The device schema must take special consideration to grow in respect to different system configurations rather than number of submissions. In other words, if the same system submits the same information repeatedly, this should not result any growth whatsoever. {{attachment:ResultsTrackerDeviceSchema.png|Device Schema}} [[attachment:ResultsTrackerDeviceSchema.dot|Dot file]] * The purpose of the Device''''''Group table is to normalize sets of devices which will be common across multiple submissions from similar system. * The distinction between the Device and Device''''''State tables is that the former provides information about standalone devices whereas the latter about connected devices which includes driver details and its relationship with other connected devices. * The parent_id column in the Device''''''State table represents a tree of device states as an adjacency list, see the following article for a [[http://explainextended.com/2009/09/24/adjacency-list-vs-nested-sets-postgresql/|comparison with nested sets]]. * The reason why the Device''''''Product and Device''''''Vendor tables are separated from the main Device table is not only to increase normalization but also to be updatable from authoritative locations for [[http://pciids.sourceforge.net/pci.ids.bz2|PCI ids]], [[http://www.linux-usb.org/usb.ids|USB ids]] and [[http://www-pc.uni-regensburg.de/hardware/TECHNIK/PCI_PNP/pnpid.txt|PNP ids]]. === Processor Schema === The processor schema should be distinguished from the device schema because a processor contains more specific information than consistently available across devices. {{attachment:ResultsTrackerProcessorSchema.png|Processor Schema}} [[attachment:ResultsTrackerProcessorSchema.dot|Dot file]] * The columns in the Processor table have been determined to be consistent across many architectures, including ARM. See the cpuinfo_resource script in Checkbox for more details. === Distribution Schema === This provides distribution specific information about the system being tested. {{attachment:ResultsTrackerDistributionSchema.png|Distribution Schema}} [[attachment:ResultsTrackerDistributionSchema.dot|Dot file]] * The content of the distribution tables can be provided from any LSB compliant system. See the lsb_resource script in Checkbox for more details. * Launchpad already contains the concept of a distribution series but should be extended to include the concept of a distribution release. The distinction is that a release contains descriptive information like "Ubuntu maverick (development branch)". === Test Schema === In addition to test results, the test schema also defines the necessary tables for test definitions. This is important so that some context about the test can be persisted within the same database as the corresponding result. {{attachment:ResultsTrackerTestSchema.png|Test Schema}} [[attachment:ResultsTrackerTestSchema.dot|Dot file]] * The value column in the Result table actually represents both a string column, for the output of a test, and a float column, for the measurement of a benchmark. * The value of the status column in the Result table is an enumeration of the [[http://cr3bits.wordpress.com/2009/06/23/test-result-codes/|Test Result Codes]] researched across several test suites: PASS, FAIL, UNINITIATED, UNRESOLVED, UNSUPPORTED, UNTESTED. * The reason why a Test Result does not contain a foreign key reference to a Test is to increase normalization. As an example, it can be quite common for tests to have essentially the same result consisting of a PASS status and not output. As another example, it can be quite common for a test version to be incremented while the result remains the same in most situations. * In order to link a Test Result to a Test, this can be accomplished by referencing the Submission for the same Test Identity values. See the Submission Schema for more details. === Submission Schema === The submission schema is where all the data streamed by the test client is stored. This not only consists of the test results but also resources from the system under test such as hardware devices and package releases. {{attachment:ResultsTrackerSubmissionSchema.png|Submission Schema}} [[attachment:ResultsTrackerSubmissionSchema.dot|Dot file]] * The project column in the Test Identity table provides a generic name inspired from the [[http://www.gridforum.org/documents/GFD.56.pdf|Job Submission Description Language (JSDL) Specification]] which can represent a suite in the context of a test. * The annotation column in the Test table provides a generic name, also inspired from the [[http://www.gridforum.org/documents/GFD.56.pdf|JSDL Specification]], which can represent various information. * The alias_id column in both the Submission and Attachment tables point to the reference returned by the Launchpad Librarian. === Session Schema === The session schema is where the state of the client is persisted when using the API for reporting purposes. {{attachment:ResultsTrackerSessionSchema.png|Session Schema}} [[attachment:ResultsTrackerSessionSchema.png|Dot file]]