Documentation ¶
Overview ¶
Remote API to trigger load tests package (REST API).
Index ¶
- Constants
- Variables
- func AddHandlers(mux *http.ServeMux, uiPath, datadir string)
- func AddRun(ro *periodic.RunnerOptions) int64
- func DataList() (dataList []string)
- func Error(w http.ResponseWriter, msg ErrorReply)
- func FormValue(r *http.Request, json map[string]interface{}, key string) string
- func GetConfigAtPath(path string, data []byte) (map[string]interface{}, error)
- func GetDataDir() string
- func RESTRunHandler(w http.ResponseWriter, r *http.Request)
- func RESTStatusHandler(w http.ResponseWriter, r *http.Request)
- func RESTStopHandler(w http.ResponseWriter, r *http.Request)
- func RemoveRun(id int64)
- func Run(w http.ResponseWriter, r *http.Request, jd map[string]interface{}, ...)
- func SaveJSON(name string, json []byte) string
- func SendTSVDataIndex(urlPrefix string, w http.ResponseWriter)
- func SetDataDir(datadir string)
- func StopByRunID(runid int64) int
- type ErrorReply
Constants ¶
const (
ModeGRPC = "grpc"
)
Variables ¶
var ( // Default percentiles when not otherwise specified. DefaultPercentileList []float64 )
Functions ¶
func AddHandlers ¶
AddHandlers adds the REST Api handlers for run, status and stop. uiPath must end with a /.
func AddRun ¶
func AddRun(ro *periodic.RunnerOptions) int64
func DataList ¶
func DataList() (dataList []string)
DataList returns the .json files/entries in data dir.
func Error ¶
func Error(w http.ResponseWriter, msg ErrorReply)
Error writes serialized ErrorReply to the writer.
func FormValue ¶
FormValue gets the value from the query arguments/url parameter or from the provided map (json data).
func GetConfigAtPath ¶
GetConfigAtPath deserializes the bytes as JSON and extracts the map at the given path (only supports simple expression: . is all the json .foo.bar.blah will extract that part of the tree.
func GetDataDir ¶
func GetDataDir() string
func RESTRunHandler ¶
func RESTRunHandler(w http.ResponseWriter, r *http.Request)
RESTRunHandler is api version of UI submit handler.
func RESTStatusHandler ¶
func RESTStatusHandler(w http.ResponseWriter, r *http.Request)
RESTStatusHandler will print the state of the runs.
func RESTStopHandler ¶
func RESTStopHandler(w http.ResponseWriter, r *http.Request)
RESTStopHandler is the api to stop a given run by runid or all the runs if unspecified/0.
func Run ¶
func Run(w http.ResponseWriter, r *http.Request, jd map[string]interface{}, runner, url string, ro periodic.RunnerOptions, httpopts *fhttp.HTTPOptions, )
Run executes the run (can be called async or not, writer is nil for async mode).
func SendTSVDataIndex ¶
func SendTSVDataIndex(urlPrefix string, w http.ResponseWriter)
format for gcloud transfer https://cloud.google.com/storage/transfer/create-url-list
func SetDataDir ¶
func SetDataDir(datadir string)
func StopByRunID ¶
StopByRunID stops all the runs if passed 0 or the runid provided.
Types ¶
type ErrorReply ¶
ErrorReply is returned on errors.