Documentation ¶
Overview ¶
Package results contains server results
Index ¶
- type File
- func (fp *File) AppendClientMeasurement(measurement model.Measurement)
- func (fp *File) AppendServerMeasurement(measurement model.Measurement)
- func (fp *File) Close() error
- func (fp *File) EndTest()
- func (fp *File) SetMetadata(metadata metadata)
- func (fp *File) StartTest()
- func (fp *File) WriteResult(result interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { // Writer is the gzip writer instance Writer *gzip.Writer // Fp is the underlying file Fp *os.File // UUID is the UUID of this subtest UUID string // Data contains metadata about the complete measurement. Data *model.ArchivalData }
File is the file where we save measurements.
func OpenFor ¶
func OpenFor(request *http.Request, conn *websocket.Conn, datadir string, what spec.SubtestKind) (*File, error)
OpenFor opens the results file and writes into it the results metadata based on the query string. Returns the results file on success. Returns an error in case of failure. The request argument is used to get the query string containing the metadata. The conn argument is used to retrieve the local and the remote endpoints addresses. The "datadir" argument specifies the directory on disk to write the data into and the what argument should indicate whether this is a spec.SubtestDownload or a spec.SubtestUpload ndt7 measurement.
func (*File) AppendClientMeasurement ¶
func (fp *File) AppendClientMeasurement(measurement model.Measurement)
AppendClientMeasurement saves the |measurement| for archival data.
func (*File) AppendServerMeasurement ¶
func (fp *File) AppendServerMeasurement(measurement model.Measurement)
AppendServerMeasurement saves the |measurement| for archival data.
func (*File) SetMetadata ¶
func (fp *File) SetMetadata(metadata metadata)
SetMetadata writes |metadata| on the measurements file.
func (*File) WriteResult ¶
WriteResult serializes |result| as JSON.