perf

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2022 The Dapr Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2022 The Dapr Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Opt added in v1.10.0

type Opt = func(*TestParameters)

func WithConnections added in v1.10.0

func WithConnections(connections int) Opt

WithConnections set the total client connections.

func WithDuration added in v1.10.0

func WithDuration(duration string) Opt

WithDuration sets the total test duration. accepts the time notation `1m`, `10s`, etc.

func WithPayload added in v1.10.0

func WithPayload(payload string) Opt

WithPayload sets the test payload.

func WithPayloadSize added in v1.10.0

func WithPayloadSize(sizeKB int) Opt

WithPayloadSize sets the test random payload size in KB.

func WithQPS added in v1.10.0

func WithQPS(qps int) Opt

WithQPS sets the test taget query per second.

type TestParameters

type TestParameters struct {
	QPS               int    `json:"qps"`
	ClientConnections int    `json:"clientConnections"`
	TargetEndpoint    string `json:"targetEndpoint"`
	TestDuration      string `json:"testDuration"`
	PayloadSizeKB     int    `json:"payloadSizeKB"`
	Payload           string `json:"payload"`
	StdClient         bool   `json:"stdClient"`
	Grpc              bool   `json:"grpc"`
	Dapr              string `json:"dapr"`
}

func Params added in v1.0.0

func Params(opts ...Opt) TestParameters

type TestReport added in v1.0.0

type TestReport struct {
	Results     []TestResult           `json:"Results"`
	TestName    string                 `json:"TestName"`
	GitHubSHA   string                 `json:"GitHubSHA,omitempty"`
	GitHubREF   string                 `json:"GitHubREF,omitempty"`
	GitHubRunID string                 `json:"GitHubRunID,omitempty"`
	Metrics     resourceMetrics        `json:"Metrics"`
	TestMetrics map[string]interface{} `json:"TestMetrics"`
}

func NewTestReport added in v1.0.0

func NewTestReport(results []TestResult, name string, sidecarUsage, appUsage *runner.AppUsage) *TestReport

func (*TestReport) SetTotalRestartCount added in v1.2.0

func (r *TestReport) SetTotalRestartCount(count int)

type TestResult

type TestResult struct {
	RunType           string    `json:"RunType"`
	Labels            string    `json:"Labels"`
	StartTime         time.Time `json:"StartTime"`
	RequestedQPS      string    `json:"RequestedQPS"`
	RequestedDuration string    `json:"RequestedDuration"`
	ActualQPS         float64   `json:"ActualQPS"`
	ActualDuration    int64     `json:"ActualDuration"`
	NumThreads        int       `json:"NumThreads"`
	Version           string    `json:"Version"`
	DurationHistogram struct {
		Count  int     `json:"Count"`
		Min    float64 `json:"Min"`
		Max    float64 `json:"Max"`
		Sum    float64 `json:"Sum"`
		Avg    float64 `json:"Avg"`
		StdDev float64 `json:"StdDev"`
		Data   []struct {
			Start   float64 `json:"Start"`
			End     float64 `json:"End"`
			Percent float64 `json:"Percent"`
			Count   int     `json:"Count"`
		} `json:"Data"`
		Percentiles []struct {
			Percentile float64 `json:"Percentile"`
			Value      float64 `json:"Value"`
		} `json:"Percentiles"`
	} `json:"DurationHistogram"`
	Exactly  int `json:"Exactly"`
	RetCodes struct {
		Num200 int `json:"200"`
		Num400 int `json:"400"`
		Num500 int `json:"500"`
	} `json:"RetCodes"`
	Sizes struct {
		Count  int     `json:"Count"`
		Min    int     `json:"Min"`
		Max    int     `json:"Max"`
		Sum    int     `json:"Sum"`
		Avg    float64 `json:"Avg"`
		StdDev float64 `json:"StdDev"`
		Data   []struct {
			Start   int     `json:"Start"`
			End     int     `json:"End"`
			Percent float64 `json:"Percent"`
			Count   int     `json:"Count"`
		} `json:"Data"`
		Percentiles interface{} `json:"Percentiles"`
	} `json:"Sizes"`
	HeaderSizes struct {
		Count  int     `json:"Count"`
		Min    int     `json:"Min"`
		Max    int     `json:"Max"`
		Sum    int     `json:"Sum"`
		Avg    float64 `json:"Avg"`
		StdDev float64 `json:"StdDev"`
		Data   []struct {
			Start   int     `json:"Start"`
			End     int     `json:"End"`
			Percent float64 `json:"Percent"`
			Count   int     `json:"Count"`
		} `json:"Data"`
		Percentiles interface{} `json:"Percentiles"`
	} `json:"HeaderSizes"`
	URL         string `json:"URL"`
	SocketCount int    `json:"SocketCount"`
	AbortOn     int    `json:"AbortOn"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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