distribution/vendor/github.com/yvasiyarov/newrelic_platform_go/agent.go
Olivier Gambier 77e69b9cf3 Move to vendor
Signed-off-by: Olivier Gambier <olivier@docker.com>
2016-03-22 10:45:49 -07:00

27 lines
459 B
Go

package newrelic_platform_go
import (
"log"
"os"
)
type Agent struct {
Host string `json:"host"`
Version string `json:"version"`
Pid int `json:"pid"`
}
func NewAgent(Version string) *Agent {
agent := &Agent{
Version: Version,
}
return agent
}
func (agent *Agent) CollectEnvironmentInfo() {
var err error
agent.Pid = os.Getpid()
if agent.Host, err = os.Hostname(); err != nil {
log.Fatalf("Can not get hostname: %#v \n", err)
}
}