// newpcpMetricDesc creates a new Metric Description wrapper type.
newpcpMetricDesc creates a new Metric Description wrapper type.
// newpcpMetricDesc creates a new Metric Description wrapper type .
func newpcpMetricDesc(n string, t MetricType, s MetricSemantics, u MetricUnit, desc ...string) (*pcpMetricDesc, error) {
	if n == "" {
		return nil, errors.New("Metric name cannot be empty")
	}
	if len(n) > StringLength {
		return nil, errors.New("metric name is too long")
	}
	if len(desc) > 2 {
		return nil, errors.New("only 2 optional strings allowed, short and long descriptions")
	}
	shortdesc, longdesc := "", ""
	if len(desc) > 0 {
		shortdesc = desc[0]
	}
	if len(desc) > 1 {
		longdesc = desc[1]
	}
	return &pcpMetricDesc{
		hash(n, PCPMetricItemBitLength),
		n, t, s, u,
		shortdesc, longdesc,
	}, nil
}
func newpcpMetricDesc ( n string , t MetricType , s MetricSemantics , u MetricUnit , desc ... string ) ( * pcpMetricDesc , error ) { if n == " " { return nil , errors . New ( " " ) } if len ( n ) > StringLength { return nil , errors . New ( " " ) } if len ( desc ) > 2 { return nil , errors . New ( " " ) } shortdesc , longdesc := " " , " " if len ( desc ) > 0 { shortdesc = desc [ 0 ] } if len ( desc ) > 1 { longdesc = desc [ 1 ] } return & pcpMetricDesc { hash ( n , PCPMetricItemBitLength ) , n , t , s , u , shortdesc , longdesc , } , nil }
newpcpMetricDesc creates a new Metric Description wrapper type.
newpcpMetricDesc creates a new Metric Description wrapper type .