nighthawk

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrGRPCDialCode        = "1000"
	ErrInvalidEndpointCode = "1001"
	ErrResponseNilCode     = "1002"
)

Variables

View Source
var (
	ErrInvalidEndpoint = errors.NewDefault(ErrInvalidEndpointCode, "Endpoint is unavailable or endpoint is unreachable")
	ErrResponseNil     = errors.NewDefault(ErrResponseNilCode, "Response is nil from the generator")
)

Functions

func ErrGRPCDial

func ErrGRPCDial(err error) error

func Transform

func Transform(res *nighthawk_client.ExecutionResponse, typ string) ([]byte, error)

Types

type AddressFamily added in v1.0.2

type AddressFamily struct {
	Value string `json:"value"`
}

type Client

type Client struct {
	Handler nighthawk_client.NighthawkServiceClient
	// contains filtered or unexported fields
}

Client holds the nighthawk client information

func New

func New(opts Options) (*Client, error)

New creates a new instance of the nighthawk client connection

func (*Client) Close

func (c *Client) Close() error

Close closes the client connection

type Counter added in v1.0.2

type Counter struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type ExperimentalH1ConnectionReuseStrategy added in v1.0.2

type ExperimentalH1ConnectionReuseStrategy struct {
	Value string `json:"value"`
}

type FailurePredicates added in v1.0.2

type FailurePredicates struct {
	BenchmarkPoolConnectionFailure string `json:"benchmark.pool_connection_failure"`
	BenchmarkHTTP4Xx               string `json:"benchmark.http_4xx"`
	BenchmarkHTTP5Xx               string `json:"benchmark.http_5xx"`
	RequestsourceUpstreamRq5Xx     string `json:"requestsource.upstream_rq_5xx"`
}

type Options

type Options struct {
	ServerHost string
	ServerPort int32
}

Options argument for customizing the client

type OutputFormat added in v1.0.2

type OutputFormat struct {
	Value string `json:"value"`
}

type Percentile added in v1.0.2

type Percentile struct {
	Percentile int    `json:"percentile"`
	Count      string `json:"count"`
	Duration   string `json:"duration"`
}

type RequestOption added in v1.0.2

type RequestOption struct {
	RequestMethod  string                  `json:"request_method"`
	RequestHeaders []*v3.HeaderValueOption `json:"request_headers"`
}

type Result added in v1.0.2

type Result struct {
	Name              string      `json:"name"`
	Statistics        []Statistic `json:"statistics"`
	Counters          []Counter   `json:"counters"`
	ExecutionDuration string      `json:"execution_duration"`
	ExecutionStart    time.Time   `json:"execution_start"`
}

type SequencerIdleStrategy added in v1.0.2

type SequencerIdleStrategy struct {
	Value string `json:"value"`
}

type Statistic added in v1.0.2

type Statistic struct {
	Count       string       `json:"count"`
	ID          string       `json:"id"`
	Percentiles []Percentile `json:"percentiles"`
	Mean        string       `json:"mean,omitempty"`
	Pstdev      string       `json:"pstdev,omitempty"`
	Min         string       `json:"min,omitempty"`
	Max         string       `json:"max,omitempty"`
	RawMean     int          `json:"raw_mean,omitempty"`
	RawPstdev   int          `json:"raw_pstdev,omitempty"`
	RawMin      string       `json:"raw_min,omitempty"`
	RawMax      string       `json:"raw_max,omitempty"`
}

type TransformOptions added in v1.0.2

type TransformOptions struct {
	RequestsPerSecond                     int                                    `json:"requests_per_second"`
	Connections                           int                                    `json:"connections"`
	Duration                              string                                 `json:"duration"`
	Timeout                               string                                 `json:"timeout"`
	H2                                    bool                                   `json:"h2"`
	Concurrency                           string                                 `json:"concurrency"`
	Verbosity                             *Verbosity                             `json:"verbosity"`
	OutputFormat                          *OutputFormat                          `json:"output_format"`
	AddressFamily                         *AddressFamily                         `json:"address_family"`
	RequestOptions                        *RequestOption                         `json:"request_options"`
	SequencerIdleStrategy                 *SequencerIdleStrategy                 `json:"sequencer_idle_strategy"`
	ExperimentalH1ConnectionReuseStrategy *ExperimentalH1ConnectionReuseStrategy `json:"experimental_h1_connection_reuse_strategy"`
	TerminationPredicates                 struct {
	} `json:"termination_predicates"`
	FailurePredicates                    *FailurePredicates    `json:"failure_predicates"`
	Labels                               []interface{}         `json:"labels"`
	StatsSinks                           []interface{}         `json:"stats_sinks"`
	PrefetchConnections                  bool                  `json:"prefetch_connections"`
	BurstSize                            *wrappers.UInt32Value `json:"burst_size"`
	MaxPendingRequests                   int                   `json:"max_pending_requests"`
	MaxActiveRequests                    int                   `json:"max_active_requests"`
	MaxRequestsPerConnection             int64                 `json:"max_requests_per_connection"`
	URI                                  string                `json:"uri"`
	Trace                                string                `json:"trace"`
	OpenLoop                             bool                  `json:"open_loop"`
	ExperimentalH2UseMultipleConnections bool                  `json:"experimental_h2_use_multiple_connections"`
	NighthawkService                     string                `json:"nighthawk_service"`
	SimpleWarmup                         bool                  `json:"simple_warmup"`
	StatsFlushInterval                   int                   `json:"stats_flush_interval"`
	LatencyResponseHeaderName            string                `json:"latency_response_header_name"`
}

type TransformResult added in v1.0.2

type TransformResult struct {
	Options   *TransformOptions `json:"options"`
	Results   []Result          `json:"results"`
	Version   *v3.BuildVersion  `json:"version"`
	Timestamp string            `json:"timestamp"`
}

type Verbosity added in v1.0.2

type Verbosity struct {
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL