Documentation ¶
Index ¶
- Constants
- Variables
- func Delay(delayTime string)
- func GetConfigBackends(stringPath ...string) (core.ConfigProvider, error)
- func GetTempChannelConfigFile(channelID string, peers []string) (string, error)
- func GetViperInstance(file string, configType string) (*viper.Viper, error)
- func InitLog(loggingLevel string)
- func InitializeMetrics(name string)
- func IterateFunc(base *Base, iterFunc func(iterationIndex int) error, sequential bool) (successCount uint64, failCount uint64, retErr error)
- func PromPush(r metrics.Registry, d time.Duration, instance_id string, test_id string, ...)
- func SetRoutineLimit(num int)
- func StopPush()
- func TrackCount(name string, increment int64)
- func TrackGauge(name string, value int64)
- func TrackTime(start time.Time, name string)
- func WithConfig(c Config)
- type Base
- func (p *Base) AddToGauge(g float64)
- func (p *Base) CurrentIter() int
- func (p *Base) CurrentRetry() int
- func (p *Base) DoMetrics(metricName string)
- func (p *Base) IncCount()
- func (p *Base) Next() int
- func (p *Base) NextRetry() int
- func (p *Base) PrintMetrics(name string)
- func (p *Base) ResetCurrentIter() int
- func (p *Base) ResetCurrentRetry() int
- func (p *Base) SetCurrentIter(currentIter int)
- func (p *Base) SetGauge(g float64)
- func (p *Base) SetIterationInterval(pattern string)
- func (p *Base) Wait()
- type Channel
- type Channels
- type Client
- type Config
- type ConnectionProfile
- type Cryptoconfig
- type Interval
- type Orderer
- type Organization
- type Organizations
- type Peer
- type PeerChannel
Constants ¶
const ( // global common parameters required by gosdk cli CONN_PROFILE = "connectionProfile" NAME = "name" // test name ITERATION_COUNT = "iterationCount" ITERATION_INTERVAL = "iterationInterval" DELAY_TIME = "delayTime" RETRY_COUNT = "retryCount" LOG_LEVEL = "logLevel" ADMIN = "Admin" USER = "User1" // BCCSP Default Configurations CONFIG_BCCSP = "config/config_crypto_bccsp.yaml" IGNORE_ERRORS = "ignoreErrors" CONCURRENCY_LIMIT = "concurrencyLimit" // in most cases users only need to config this param for cc invoke )
const ( MaxIdleConnections int = 20 RequestTimeout int = 5 SCRAPE_INTERVAL = 10 * time.Second )
const DEFAULT_ROUTINE_LIMIT = 500
const FIXED = 0
const PUSH_INTERVAL = 10 * time.Second // push metrics to graphite interval: seconds
const RANDOM = 1
const ROUTINE_UPPER_LIMIT = 2000
Variables ¶
var IGNORED_ERRORS = []string{"MVCC_READ_CONFLICT"}
var Logger *zap.Logger
Functions ¶
func GetConfigBackends ¶
func GetConfigBackends(stringPath ...string) (core.ConfigProvider, error)
GetConfigBackends gets the config backends from multiple configuration file
func GetTempChannelConfigFile ¶
GetTempChannelConfigFile will generate the temporary channel yaml file and return the file path
func InitializeMetrics ¶
func InitializeMetrics(name string)
func IterateFunc ¶
func IterateFunc(base *Base, iterFunc func(iterationIndex int) error, sequential bool) (successCount uint64, failCount uint64, retErr error)
return the number of successful execution and error(if any) sequential: false when iterFunc can be executed concurrently; true when iterFunc should be sequentially executed chaincode instantiate should be executed sequentially
func PromPush ¶
func PromPush(r metrics.Registry, d time.Duration, instance_id string, test_id string, addr *net.TCPAddr, metricsStopChan chan (struct{}))
PromPush is a blocking exporter function which reports metrics in r to a prometheus push gateway server located at addr, flushing them every d duration.
func SetRoutineLimit ¶
func SetRoutineLimit(num int)
func TrackCount ¶
func TrackGauge ¶
func WithConfig ¶
func WithConfig(c Config)
WithConfig is a blocking exporter function just like Graphite, but it takes a GraphiteConfig instead.
Types ¶
type Base ¶
type Base struct { InstanceID int IterationCount string RetryCount int CertRootDir string ConnectionProfile string Hostname string // contains filtered or unexported fields }
func (*Base) AddToGauge ¶
func (*Base) CurrentIter ¶
func (*Base) CurrentRetry ¶
func (*Base) PrintMetrics ¶
Print metrics summary into console and do clean up
func (*Base) ResetCurrentIter ¶
func (*Base) ResetCurrentRetry ¶
func (*Base) SetCurrentIter ¶
func (*Base) SetIterationInterval ¶
type Channel ¶
type Channel struct {
Peers map[string]PeerChannel `mapstructure:"peers"`
}
type Client ¶
type Client struct { Organization string `string:"organization"` Cryptoconfig Cryptoconfig `string:"cryptoconfig"` }
Client shows
type Config ¶
type Config struct { Addr *net.TCPAddr // Network address to connect to Registry metrics.Registry // Registry to be exported FlushInterval time.Duration // Flush interval DurationUnit time.Duration // Time conversion unit for durations InstanceId string // Instance identifier which normally maps to hostname TestId string // Test identifier Percentiles []float64 // Percentiles to export from timers and histograms // contains filtered or unexported fields }
Config provides a container with configuration parameters for the Graphite exporter
type ConnectionProfile ¶
type ConnectionProfile struct { Client Client `mapstructure:"client"` Orderers map[string]Orderer `mapstructure:"orderers"` Organizations map[string]Organization `mapstructure:"organizations"` Peers map[string]Peer `mapstructure:"peers"` Channels map[string]Channel `mapstructure:"channels"` }
ConnectionProfile shows
type Cryptoconfig ¶
type Cryptoconfig struct {
Path string `string:"Path"`
}
type Interval ¶
type Interval struct {
// contains filtered or unexported fields
}
func NewInterval ¶
type Organization ¶
type Organization struct { Mspid string `mapstructure:"mspid"` CryptoPath string `yaml:"cryptoPath,omitempty"` Peers []string `yaml:"peers,omitempty"` CertificateAuthorities []string `yaml:"certificateAuthorities,omitempty"` }
Organization shows
type Organizations ¶
type Organizations struct {
Organizations map[string]Organization `mapstructure:"organizations"`
}
Organization shows