// NewPCPCounterVector creates a new instance of a PCPCounterVector.
// it requires a metric name and a set of instance names and values as a map.
// it can optionally accept a couple of strings as short and long descriptions
// of the metric.
// Internally it uses a PCP InstanceMetric with Int64Type, CounterSemantics and CountUnit.
NewPCPCounterVector creates a new instance of a PCPCounterVector.
it requires a metric name and a set of instance names and values as a map.
it can optionally accept a couple of strings as short and long descriptions
of the metric.
Internally it uses a PCP InstanceMetric with Int64Type, CounterSemantics and CountUnit.
// NewPCPCounterVector creates a new instance of a PCPCounterVector . // it requires a metric name and a set of instance names and values as a map . // it can optionally accept a couple of strings as short and long descriptions // of the metric . // Internally it uses a PCP InstanceMetric with Int64Type CounterSemantics and CountUnit .
func NewPCPCounterVector(values map[string]int64, name string, desc ...string) (*PCPCounterVector, error) {
	vals := make(Instances)
	for k, v := range values {
		vals[k] = v
	}
	im, err := generateInstanceMetric(vals, name, vals.Keys(), Int64Type, CounterSemantics, OneUnit, desc...)
	if err != nil {
		return nil, err
	}
	return &PCPCounterVector{im, sync.RWMutex{}}, nil
}
func NewPCPCounterVector ( values map [ string ] int64 , name string , desc ... string ) ( * PCPCounterVector , error ) { vals := make ( Instances ) for k , v := range values { vals [ k ] = v } im , err := generateInstanceMetric ( vals , name , vals . Keys ( ) , Int64Type , CounterSemantics , OneUnit , desc ... ) if err != nil { return nil , err } return & PCPCounterVector { im , sync . RWMutex { } } , nil }
NewPCPCounterVector creates a new instance of a PCPCounterVector.
NewPCPCounterVector creates a new instance of a PCPCounterVector .