本文整理汇总了Golang中github.com/cockroachdb/cockroach/pkg/acceptance/terrafarm.Farmer类的典型用法代码示例。如果您正苦于以下问题:Golang Farmer类的具体用法?Golang Farmer怎么用?Golang Farmer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Farmer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: queryCount
// queryCount returns the total SQL queries executed by the cluster.
func (cl continuousLoadTest) queryCount(f *terrafarm.Farmer) (float64, error) {
var client http.Client
var resp status.NodeStatus
host := f.Hostname(0)
if err := httputil.GetJSON(client, "http://"+host+":8080/_status/nodes/local", &resp); err != nil {
return 0, err
}
count, ok := resp.Metrics["sql.query.count"]
if !ok {
return 0, errors.New("couldn't find SQL query count metric")
}
return count, nil
}
开发者ID:BramGruneir,项目名称:cockroach,代码行数:14,代码来源:continuous_load_test.go
示例2: startLoad
func (cl continuousLoadTest) startLoad(f *terrafarm.Farmer) error {
if *flagCLTWriters > len(f.Nodes()) {
return errors.Errorf("writers (%d) > nodes (%d)", *flagCLTWriters, len(f.Nodes()))
}
// We may have to retry restarting the load generators, because CockroachDB
// might have been started too recently to start accepting connections.
started := make(map[int]bool)
return util.RetryForDuration(10*time.Second, func() error {
for i := 0; i < *flagCLTWriters; i++ {
if !started[i] {
if err := f.Start(i, cl.Process); err != nil {
return err
}
}
}
return nil
})
}
开发者ID:hvaara,项目名称:cockroach,代码行数:19,代码来源:continuous_load_test.go
示例3: assert
// assert fails the test if CockroachDB or the load generators are down.
func (cl continuousLoadTest) assert(t *testing.T, f *terrafarm.Farmer) {
f.Assert(t)
for _, host := range f.Nodes()[0:*flagCLTWriters] {
f.AssertState(t, host, cl.Process, "RUNNING")
}
}
开发者ID:hvaara,项目名称:cockroach,代码行数:7,代码来源:continuous_load_test.go
注:本文中的github.com/cockroachdb/cockroach/pkg/acceptance/terrafarm.Farmer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论