Пример #1
0
// NewClient instantiates and returns a new client
func NewClient(token string) *Client {

	ds := &Client{
		statsFrequency: 60,
		statsUrl:       deferclient.ApiBase + "/stats/create",
		GrabGC:         true,
		GrabMem:        true,
		GrabGR:         true,
		GrabCgo:        true,
		GrabFd:         true,
		GrabHTTP:       true,
		Verbose:        false,
		Token:          token,
		environment:    "production",
		appGroup:       "default",
		noPost:         false,
	}

	ds.BaseClient = deferclient.NewDeferPanicClient(token)
	ds.BaseClient.Environment = ds.environment
	ds.BaseClient.AppGroup = ds.appGroup
	ds.BaseClient.NoPost = ds.noPost

	return ds
}
Пример #2
0
// NewClient instantiates and returns a new client
func NewClient(token string) *Client {

	ds := &Client{
		kvUrl:       deferclient.ApiBase + "/kvs/create",
		Token:       token,
		environment: "production",
		appGroup:    "default",
	}

	ds.BaseClient = deferclient.NewDeferPanicClient(ds.Token)
	ds.BaseClient.Environment = ds.environment
	ds.BaseClient.AppGroup = ds.appGroup

	return ds
}