Skip to content

Latest commit

 

History

History
8 lines (7 loc) · 2.63 KB

README.md

File metadata and controls

8 lines (7 loc) · 2.63 KB

Implementation notes

  • This project provides an HTTP "file" reader implementation of the IReportReader interface. It loads benchmark reports in JSON format from a webserver. The webserver can be configured using the Readers.JsonFileReader.BaseURI config setting (normally read from appsettings.json), and otherwise defaults to the webserver the PrimeView app is loaded from. Which files it loads (or attempts to) depends on a number of other settings:
    • If the Readers.JsonFileReader.IsS3Bucket config setting is set to "true", the aforementioned base URI is loaded and expected to be a ListBucketResult XML document that lists the files in the bucket. Those files are then retrieved and parsed as reports. If an error occurs while reading or parsing the bucket contents document, the application defaults to the behaviour mentioned in the third point. If reading the bucket file list is successful but an HTTP error occurs when reading or parsing one of the report files, the file in question is skipped, but reading continues.
    • If the Readers.JsonFileReader.Index config setting is present, the index file it specifies (which should contain a JSON array of file names) is read first, after which the files included in that file are retrieved. If an error occurs while reading or parsing the index, the application defaults to the behaviour mentioned in the next point. If reading the index is successful but an HTTP error occurs when reading one of the report files in the index list, the file in question is skipped, but reading continues.
    • In all other cases, report files are read from the the data directory on the webserver. It starts with loading report1.json, then loads report2.json, and so on, until it receives an HTTP error on the request for a report<number>.json file.
  • The supported JSON format is the one generated by the benchmark tool in the Primes repository, when the FORMATTER=json variable is used, with one optional extension: in the metadata object, a string "user" property can be added to indicate the user who generated the report.
  • The ExtensionMethods class includes a GetStableHashCode method that provides what it says on the tin. This is used to make sure that hash codes of Report JSON blobs loaded from the report<number>.json files remain the same across different builds of the PrimeView solution('s projects). This greatly simplifies testing if the Report.ID field is derived from the report's JSON text, which is a fallback if it is not provided otherwise.