- 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 theReaders.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 aListBucketResult
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 loadingreport1.json
, then loadsreport2.json
, and so on, until it receives an HTTP error on the request for areport<number>.json
file.
- If the
- 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 aGetStableHashCode
method that provides what it says on the tin. This is used to make sure that hash codes ofReport
JSON blobs loaded from thereport<number>.json
files remain the same across different builds of the PrimeView solution('s projects). This greatly simplifies testing if theReport.ID
field is derived from the report's JSON text, which is a fallback if it is not provided otherwise.