1 Star 0 Fork 0

zhangjungang/beats

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
testing.go 688 Bytes
Copy Edit Raw Blame History
package mongodb
import "os"
// Helper functions for testing mongodb metricsets.
// GetEnvHost returns the hostname of the Mongodb server to use for testing.
// It reads the value from the MONGODB_HOST environment variable and returns
// 127.0.0.1 if it is not set.
func GetEnvHost() string {
host := os.Getenv("MONGODB_HOST")
if len(host) == 0 {
host = "127.0.0.1"
}
return host
}
// GetEnvPort returns the port of the Mongodb server to use for testing.
// It reads the value from the MONGODB_PORT environment variable and returns
// 27017 if it is not set.
func GetEnvPort() string {
port := os.Getenv("MONGODB_PORT")
if len(port) == 0 {
port = "27017"
}
return port
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangjungang/beats.git
git@gitee.com:zhangjungang/beats.git
zhangjungang
beats
beats
v5.5.1

Search