Debian Codegraph @

agent.go

raw symbols SCIP
1 package newrelic_platform_go
2
3 import (
4 "log"
5 "os"
6 )
7
8 type Agent struct {
9 Host string `json:"host"`
10 Version string `json:"version"`
11 Pid int `json:"pid"`
12 }
13
14 func NewAgent(Version string) *Agent {
15 agent := &Agent{
16 Version: Version,
17 }
18 return agent
19 }
20
21 func (agent *Agent) CollectEnvironmentInfo() {
22 var err error
23 agent.Pid = os.Getpid()
24 if agent.Host, err = os.Hostname(); err != nil {
25 log.Fatalf("Can not get hostname: %#v \n", err)
26 }
27 }