Documentation ¶
Overview ¶
Copyright © 2023 Filipe Oliveira hello@codeperf.io
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 © 2023 Filipe Oliveira hello@codeperf.io
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 © 2023 Filipe Oliveira hello@codeperf.io
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 ¶
const ( ReadPrimary int64 = 0 ReadSecondary = 1 )
readPreference int mapping
const ( CommandTypeRead int64 = 0 CommandTypeWrite = 1 )
readPreference int mapping
const Inf = rate.Limit(math.MaxFloat64)
Variables ¶
var CommandTypeLatenciesRead *hdrhistogram.Histogram
var CommandTypeLatenciesWrite *hdrhistogram.Histogram
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func RegisterDBCreator ¶
RegisterDBCreator registers a creator for the database
Types ¶
type DB ¶
type DB interface { // Read reads a record from the database and returns a map of each field/value pair. // table: The name of the table. // key: The record key of the record to read. // readPreference: route read operations to the primaries (0) or to the secondaries/replicas (1) // fields: The list of fields to read, nil|empty for reading all. Read(ctx context.Context, table string, key string, readPreference int64, fields []string) (map[string][]byte, error) // Insert inserts a record in the database. Any field/value pairs will be written into the // database. // table: The name of the table. // key: The record key of the record to insert. // numReplicas: number of replicas that acknowledged the insert. // numReplicasTimeout: timeout in milliseconds to ack. // values: A map of field/value pairs to insert in the record. Insert(ctx context.Context, table string, key string, numReplicas int64, numReplicasTimeout int64, values map[string][]byte) error }
DB is the layer to access the database to be benchmarked.
type DBCreator ¶
type DBCreator interface {
Create(p *properties.Properties) (DB, error)
}
DBCreator creates a database layer.
func GetDBCreator ¶
GetDBCreator gets the DBCreator for the database
type TestResult ¶
type TestResult struct { Metadata string `json:"Metadata"` Clients uint64 `json:"Clients"` MaxRps uint64 `json:"MaxRps"` RandomSeed int64 `json:"RandomSeed"` StartTime int64 `json:"StartTime"` EndTime int64 `json:"EndTime"` DurationMillis int64 `json:"DurationMillis"` // Populated after benchmark // Benchmark Totals Totals map[string]float64 `json:"Totals"` // Overall Rates OverallCommandRate []float64 `json:"OverallCommandRate"` EncodedWriteHistogram []byte `json:"EncodedWriteHistogram"` EncodedReadHistogram []byte `json:"EncodedReadHistogram"` // Overall Client Quantiles OverallClientLatencies map[string]map[string]float64 `json:"OverallClientLatencies"` // contains filtered or unexported fields }
func NewTestResult ¶
func NewTestResult(metadata string, clients uint64, maxRps uint64) *TestResult
func (*TestResult) FillDurationInfo ¶
func (*TestResult) SetUsedRandomSeed ¶
func (r *TestResult) SetUsedRandomSeed(seed int64) *TestResult