procstat

package
v0.0.0-...-ffba3ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Copyright 2016 Staples, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Meta

func Meta() *plugin.PluginMeta

Meta returns information about the plugin for the snap agent

Types

type Pid

type Pid interface {
	GetPids() ([]int32, error)
	MarkFailed()
	GetName() string
}

Pid queries for the pids configured for metrics collection

type Process

type Process interface {
	GetStats() (map[string]interface{}, error)
	GetName() string
}

Process acceses information through the /proc file system to return metrics on a process

func NewProcess

func NewProcess(pid int32, processName string) (Process, error)

NewProcess returns a new process object

type Procstat

type Procstat struct {
	// contains filtered or unexported fields
}

Procstat defines procstat type

func New

func New() *Procstat

New returns a procstat plugin

func (*Procstat) CollectMetrics

func (p *Procstat) CollectMetrics(metricTypes []plugin.MetricType) ([]plugin.MetricType, error)

CollectMetrics returns metrics from gopsutil

func (*Procstat) GetConfigPolicy

func (p *Procstat) GetConfigPolicy() (*cpolicy.ConfigPolicy, error)

GetConfigPolicy returns a ConfigPolicy

func (*Procstat) GetMetricTypes

func (p *Procstat) GetMetricTypes(cfg plugin.ConfigType) (mts []plugin.MetricType, err error)

GetMetricTypes returns the metric types exposed by gopsutil

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL