Documentation ¶
Index ¶
Constants ¶
const ( // StatusOK means the latest run in test was within the threshold StatusOK = Status("ok") // StatusFail means the latest run in test was not within the threshold StatusFail = Status("fail") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketList ¶
BucketList is a slice of buckets
func (*BucketList) Scan ¶
func (bl *BucketList) Scan(src interface{}) error
Scan converts database value to a struct
type Detail ¶
type Detail struct { Model Report *Report `json:"-"` // Run id ReportID uint `json:"reportID" gorm:"type:integer REFERENCES reports(id) ON DELETE CASCADE;not null"` runner.ResultDetail }
Detail represents a report detail
func (*Detail) BeforeSave ¶
BeforeSave is called by GORM before save
func (*Detail) UnmarshalJSON ¶
UnmarshalJSON for Detail
type Histogram ¶
type Histogram struct { Model ReportID uint `json:"reportID" gorm:"type:integer REFERENCES reports(id) ON DELETE CASCADE;not null"` Report *Report `json:"-"` Buckets BucketList `json:"buckets" gorm:"type:TEXT"` }
Histogram represents a histogram
type LatencyDistributionList ¶
type LatencyDistributionList []*runner.LatencyDistribution
LatencyDistributionList is a slice of LatencyDistribution pointers
func (*LatencyDistributionList) Scan ¶
func (ld *LatencyDistributionList) Scan(src interface{}) error
Scan converts database value to a struct
type Model ¶
type Model struct { // The id ID uint `json:"id" gorm:"primary_key"` // The creation time CreatedAt time.Time `json:"createdAt"` // The updated time UpdatedAt time.Time `json:"updatedAt"` }
Model base model definition. Copy of gorm.Model with custom tags
type Options ¶
type Options struct { Model Report *Report `json:"-"` // Run id ReportID uint `json:"reportID" gorm:"type:integer REFERENCES reports(id) ON DELETE CASCADE;not null"` Info *OptionsInfo `json:"info,omitempty" gorm:"type:TEXT"` }
Options represents a report detail
type OptionsInfo ¶
OptionsInfo represents the report options
func (*OptionsInfo) Scan ¶
func (o *OptionsInfo) Scan(src interface{}) error
Scan converts database value to an Options struct
type Project ¶
type Project struct { Model Name string `json:"name" gorm:"not null"` Description string `json:"description"` Status Status `json:"status" gorm:"not null"` }
Project represents a project
func (*Project) BeforeCreate ¶
BeforeCreate is a GORM hook called when a model is created
func (*Project) BeforeSave ¶
BeforeSave is a GORM hook called when a model is created or updated
func (*Project) BeforeUpdate ¶
BeforeUpdate is a GORM hook called when a model is updated
type Report ¶
type Report struct { Model ProjectID uint `json:"projectID" gorm:"type:integer REFERENCES projects(id) ON DELETE CASCADE;not null"` Project *Project `json:"-"` Name string `json:"name,omitempty"` EndReason string `json:"endReason,omitempty"` Date time.Time `json:"date"` Count uint64 `json:"count"` Total time.Duration `json:"total"` Average time.Duration `json:"average"` Fastest time.Duration `json:"fastest"` Slowest time.Duration `json:"slowest"` Rps float64 `json:"rps"` Status Status `json:"status" gorm:"not null"` ErrorDist StringIntMap `json:"errorDistribution,omitempty" gorm:"type:TEXT"` StatusCodeDist StringIntMap `json:"statusCodeDistribution,omitempty" gorm:"type:TEXT"` LatencyDistribution LatencyDistributionList `json:"latencyDistribution" gorm:"type:TEXT"` Tags StringStringMap `json:"tags,omitempty" gorm:"type:TEXT"` }
Report represents a project
func (*Report) BeforeSave ¶
BeforeSave is called by GORM before save
type Status ¶
type Status string
Status represents a status of a project or record
func StatusFromString ¶
StatusFromString creates a Status from a string
type StringIntMap ¶
StringIntMap is a map of string keys to int values
func (*StringIntMap) Scan ¶
func (m *StringIntMap) Scan(src interface{}) error
Scan converts database value to a map
type StringStringMap ¶
StringStringMap is a map of string keys to int values
func (*StringStringMap) Scan ¶
func (m *StringStringMap) Scan(src interface{}) error
Scan converts database value to a map