本文整理匯總了Golang中org/apache/htrace/client.Client.GetServerInfo方法的典型用法代碼示例。如果您正苦於以下問題:Golang Client.GetServerInfo方法的具體用法?Golang Client.GetServerInfo怎麽用?Golang Client.GetServerInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org/apache/htrace/client.Client
的用法示例。
在下文中一共展示了Client.GetServerInfo方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: printServerInfo
// Print information retrieved from an htraced server via /server/info
func printServerInfo(hcl *htrace.Client) int {
info, err := hcl.GetServerInfo()
if err != nil {
fmt.Println(err.Error())
return EXIT_FAILURE
}
fmt.Printf("HTraced server version %s (%s)\n", info.ReleaseVersion, info.GitVersion)
return EXIT_SUCCESS
}
示例2: TestClientGetServerInfo
func TestClientGetServerInfo(t *testing.T) {
htraceBld := &MiniHTracedBuilder{Name: "TestClientGetServerInfo",
DataDirs: make([]string, 2)}
ht, err := htraceBld.Build()
if err != nil {
t.Fatalf("failed to create datastore: %s", err.Error())
}
defer ht.Close()
var hcl *htrace.Client
hcl, err = htrace.NewClient(ht.ClientConf())
if err != nil {
t.Fatalf("failed to create client: %s", err.Error())
}
_, err = hcl.GetServerInfo()
if err != nil {
t.Fatalf("failed to call GetServerInfo: %s", err.Error())
}
}