func New(base mb.BaseMetricSet) (mb.MetricSet, error) { dialInfo, err := mgo.ParseURL(base.HostData().URI) if err != nil { return nil, err } dialInfo.Timeout = base.Module().Config().Timeout return &MetricSet{ BaseMetricSet: base, dialInfo: dialInfo, }, nil }
// New create a new instance of the docker info MetricSet. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { logp.Warn("EXPERIMENTAL: The docker info metricset is experimental") config := docker.Config{} if err := base.Module().UnpackConfig(&config); err != nil { return nil, err } client, err := docker.NewDockerClient(base.HostData().URI, config) if err != nil { return nil, err } return &MetricSet{ BaseMetricSet: base, dockerClient: client, }, nil }
// New creates a new instance of the docker network MetricSet. func New(base mb.BaseMetricSet) (mb.MetricSet, error) { logp.Warn("EXPERIMENTAL: The docker network metricset is experimental") config := docker.Config{} if err := base.Module().UnpackConfig(&config); err != nil { return nil, err } client, err := docker.NewDockerClient(base.HostData().URI, config) if err != nil { return nil, err } return &MetricSet{ BaseMetricSet: base, dockerClient: client, netService: &NetService{ NetworkStatPerContainer: make(map[string]map[string]NetRaw), }, }, nil }
func NewMetricSet(base mb.BaseMetricSet) (mb.MetricSet, error) { fmt.Println("someapp-status url=", base.HostData().SanitizedURI) return &MetricSet{BaseMetricSet: base}, nil }