// NewPCPCounter creates a new PCPCounter instance.
// It requires an initial int64 value and a metric name for construction.
// optionally it can also take a couple of description strings that are used as
// short and long descriptions respectively.
// Internally it creates a PCP SingletonMetric with Int64Type, CounterSemantics
// and CountUnit.
NewPCPCounter creates a new PCPCounter instance.
It requires an initial int64 value and a metric name for construction.
optionally it can also take a couple of description strings that are used as
short and long descriptions respectively.
Internally it creates a PCP SingletonMetric with Int64Type, CounterSemantics
and CountUnit.
// NewPCPCounter creates a new PCPCounter instance . // It requires an initial int64 value and a metric name for construction . // optionally it can also take a couple of description strings that are used as // short and long descriptions respectively . // Internally it creates a PCP SingletonMetric with Int64Type CounterSemantics // and CountUnit .
func NewPCPCounter(val int64, name string, desc ...string) (*PCPCounter, error) {
	d, err := newpcpMetricDesc(name, Int64Type, CounterSemantics, OneUnit, desc...)
	if err != nil {
		return nil, err
	}
	sm, err := newpcpSingletonMetric(val, d)
	if err != nil {
		return nil, err
	}
	return &PCPCounter{sm, sync.RWMutex{}}, nil
}
func NewPCPCounter ( val int64 , name string , desc ... string ) ( * PCPCounter , error ) { d , err := newpcpMetricDesc ( name , Int64Type , CounterSemantics , OneUnit , desc ... ) if err != nil { return nil , err } sm , err := newpcpSingletonMetric ( val , d ) if err != nil { return nil , err } return & PCPCounter { sm , sync . RWMutex { } } , nil }
NewPCPCounter creates a new PCPCounter instance.
NewPCPCounter creates a new PCPCounter instance .