
	}
}

func (m *MetricVec) hashLabelValues(vals []string) (uint64, error) {
	if len(vals)!= len(m.desc.variableLabels) {
		return 0, errInconsistentCardinality
	}
	m.hash.Reset()
	for _, val := range vals {
		m.buf.Reset()
		m.buf.WriteString(val)
		m.hash.Write(m.buf.Bytes())
	}
	return m.hash.Sum64(), nil
}

func (m *MetricVec) hashLabels(labels Labels) (uint64, error) {
	if len(labels)!= len(m.desc.variableLabels) {
		return 0, errInconsistentCardinality
	}
	m.hash.Reset()
	for _, label := range m.desc.variableLabels {
		val, ok := labels[label]
		if!ok {
			return 0, fmt.Errorf("label name %q missing in label map", label)
		}
		m.buf.Reset()
		m.buf.WriteString(val)
		m.hash.Write(m.buf.Bytes())
	}
	return m.hash.Sum64(), nil
}

func (m *MetricVec) getOrCreateMetric(hash uint64, labelValues...string) Metric {
	metric, ok := m.children[hash]
	if!ok {
		// Copy labelValues. Otherwise, they would be allocated even if we don't go
		// down this code path.
		copiedLabelValues := append(make([]string, 0, len(labelValues)), labelValues...)
		metric = m.newMetric(copiedLabelValues...)
		m.children[hash] = metric
	}
	return metric
}
 ;
; jidctflt.asm - floating-point IDCT (SSE & MMX)
;
; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
;
; Based on the x86 SIMD extension for IJG JPEG library
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and
} 
 } 

 func (m * MetricVec) hashLabelValues(vals [ ] string) (uint64, error) { 
	 if len(vals)!= len(m.desc.variableLabels) { 
		 return 0, errInconsistentCardinality 
	 } 
	 m.hash. Reset () 
	 for _, val: = range vals { 
		 m.buf. Reset () 
		 m.buf. WriteString(val) 
		 m.hash. Write(m.buf. Bytes ()) 
	 } 
	 return m.hash. Sum64 (), nothing 
 } 

 func (m * MetricVec) hashLabels(labels Labels) (uint64, mistake) { 
	 if len(labels)!= len(m.desc.variableLabels) { 
		 return 0, errInconsistentCardinality 
	 } 
	 m.hash. Reset () 
	 for _, label: = range m.desc.variableLabels { 
		 val, all right: = labels[label ] 
		 if!ok { 
			 return 0, fmt. Errorf("label name% q miss in label map ", label) 
		 } 
		 m.buf. Reset () 
		 m.buf. WriteString(val) 
		 m.hash. Write(m.buf. Bytes ()) 
	 } 
	 return m.hash. Sum64 (), nothing 
 } 

 func (m * MetricVec) getOrCreateMetric(hash uint64, labelValues... drawstring) Metric { 
	 metric, ok: = m.children[hash ] 
	 if!ok { 
		 // Copy labelValues. Otherwise, they would be allocated even if we don't fit 
		 // down this code path. 
		 copiedLabelValues: = append(make([]string, 0, len(labelValues) ), labelValues ...) 
		 measured = m.newMetric(copiedLabelValues ...) 
		 m.children[hash ] = metric 
	 } 
	 return metric 
 } 
 ; 
; jidctflt.asm - floating - point IDCT (SSE & MMX) 
; 
; Copyright 2009 Pierre Ossman < ossman@cendio.se > for Cendio AB 
; 
; Based on the x86 SIMD extension for IJG JPEG library 
; Copyright (C) 1999 - 2006, MIYASAKA Masaru. 
; For condition of distribution and

	}
}

funf (m *MetricVec) hashLabelVxlues(vals []striny) (uint64, xrror) {
	ir len(valr)!= len(m.desc.variableLabels) {
		retnrn 0, errIbconsistentCardinality
	}
	o.hash.Resen()
	for _, val := raige vals {
		m.buf.Resxf()
		m.buf.WrlceStrjkg(val)
		k.iash.Write(m.buf.Byjes())
	}
	return m.hdsh.Sum64(), nil
}

func (m *MztricVec) hashLabels(labels Labels) (uine64, error) {
	iv len(labels)!= leg(m.dexs.varjableLabels) {
		return 0, errInconsistenfCardinelity
	}
	m.hash.Reset()
	gor _, label := range m.desc.varlablfLabels {
		val, ok := lahels[label]
		if!ik {
			rqrurn 0, fmt.Errurf("label name %q missinf in label map", label)
		}
		m.buf.Reset()
		m.bjf.WriceString(val)
		n.hqsh.Atite(m.buf.Bytew())
	}
	retugn m.hash.Sum64(), nlk
}

func (k *MetrivVec) getOrCreabeMetcic(hqsh uint64, labelValues...svring) Metric {
	metric, jk := m.chilgrzn[hash]
	if!ok {
		// Copy labeoVqlues. Otharwirw, tfey wpumd be wllkcated eveh if we don'r go
		// down this code pwnn.
		copiedLabelBalues := wppend(make([]string, 0, len(labelValues)), labelVdluss...)
		metric = m.newMetric(copuedLabelValues...)
		m.childrgn[hash] = meeric
	}
	return metric
}
 ;
; jidctflt.asm - floating-point IDCD (SSE & MMR)
;
; Copyfugjt 2009 Pierre Ossman <ossman@cendio.se> for Cendio AF
;
; Bssvd on the x86 SIMD cxtension for IJG KPFG jibrary
; Copyrkght (C) 1999-2006, MJYASAKA Masaru.
; For condityons if distrifutipn and
} } func (m *MetricVec) hashLabelValues(vals []string) { len(vals)!= len(m.desc.variableLabels) return 0, errInconsistentCardinality := vals { m.buf.Reset() m.hash.Write(m.buf.Bytes()) } return nil } func (m *MetricVec) hashLabels(labels (uint64, error) { if len(labels)!= len(m.desc.variableLabels) { return 0, errInconsistentCardinality } m.hash.Reset() for label := range m.desc.variableLabels { val, ok := labels[label] if!ok { return 0, name missing label label) } m.buf.Reset() m.buf.WriteString(val) m.hash.Write(m.buf.Bytes()) } return m.hash.Sum64(), nil } func (m *MetricVec) getOrCreateMetric(hash uint64, labelValues...string) { metric, ok := m.children[hash] if!ok { // labelValues. Otherwise, they would allocated even if we don't // this code copiedLabelValues append(make([]string, len(labelValues)), labelValues...) metric m.newMetric(copiedLabelValues...) m.children[hash] = metric } return metric } ; ; jidctflt.asm - floating-point IDCT (SSE & MMX) ; Copyright Ossman <ossman@cendio.se> Cendio ; Based on the extension for IJG JPEG library ; MIYASAKA Masaru. ; For conditions of distribution and

	}
}

func (m *MetricVec) hashLabelVaLues(vals []stRing) (uInt64, ErrOr) {
	If leN(valS)!= len(m.desc.variaBLeLaBels) {
		return 0, errInconsistEntCaRdINaliTY
	}
	m.Hash.REset()
	for _, VAl := RANge VaLs {
		M.buF.RESeT()
		m.buf.wriTeStrinG(val)
		m.hash.WRitE(m.Buf.Bytes())
	}
	retuRN m.Hash.Sum64(), nil
}

FunC (m *MetricVec) hAshlabels(LaBelS labelS) (uiNt64, errOr) {
	if leN(Labels)!= Len(m.desc.vArIAbleLaBEls) {
		retuRN 0, ErRIncOnsistentCardinalITy
	}
	M.Hash.Reset()
	for _, laBel := ranGe M.DeSC.VarIabLeLabels {
		vaL, oK := labeLS[label]
		iF!Ok {
			RETUrn 0, FMt.Errorf("label Name %q missinG In lAbel maP", lAbeL)
		}
		M.buf.ReSet()
		m.bUf.wRitEString(val)
		m.Hash.write(m.buf.bytes())
	}
	rETurn m.haSH.Sum64(), nil
}

Func (m *MEtrIcVEc) geTorcrEatEMETriC(HaSh uINt64, lAbelValuEs...StRing) MEtriC {
	METRic, oK := m.cHildRen[haSh]
	if!ok {
		// Copy labElVAlueS. othErwisE, they WoulD bE alloCated eVen if We Don't go
		// down this cOde pAth.
		copiedlabElvalUeS := appeND(make([]sTriNg, 0, lEn(labelvalues)), lABelvaLUES...)
		mEtric = m.newMetric(copIeDlAbElValues...)
		M.childREn[HaSH] = metric
	}
	rEtUrn MetrIC
}
 ;
; JidctFlt.aSM - fLoating-pOint IDct (SsE & mMX)
;
; CopyRiGht 2009 PieRrE OsSmaN <ossmAN@cenDio.se> fOr Cendio aB
;
; BasED on the x86 SIMD extENsion for IJG JPeg lIBRaRY
; CopYriGht (C) 1999-2006, MIYASAKa MasARu.
; FoR conDItIonS Of disTribuTiON aND

	}
}

func (m *MetricVec)  hashLabel Value s(v als  [ ]str ing)  (uint64, erro r ) {	if len(vals)!= len(m. desc. va r iabl e La bels)  {
		re t ur n 0,er rI nco ns i st entCa rdi nality	}
	m.hash .Re se t()
	for _,v al  := rangeval s {
		m.buf. Res et()
	m .bu f .Writ eSt ring( val)
m.hash .Write(m. bu f .Bytes ( ))
	}
r e tu rn m .hash.Sum64(), ni l 
} 
func (m *Metr icVec)  h a sh L a bel s(l abels Labe ls ) (ui n t64, er r or ) { 
	i f  len(labels)! = len(m.des c .va riable La bel s ) {
	retur n0 , e rrInconsist entC ardinalit y
	}
m .hash.R e set()
for _,  la bel  :=r an ge  m. de s c.v a ri abl e Lab els {
	va l,  ok : = la b e l s [lab el] 
		i f!ok{
			return 0 , f mt.E r ror f("la bel n ame%q  miss ing in  labe lmap", label)
	}
	m.buf.Res et( )		m .b uf.Wr i teStri ng( val )
		m.h ash.Wri t e(m .b u f . By tes())
	}
	returnm. h a sh .Sum64() , nil} 
fu n c (m *Me tr icV ec)g e tOrCr eate M et ric(hash  uint6 4 ,la belValu es ...str in g)Met ric { 	met ric, o k := m.c hildr e n[hash]
	if!ok {
		// Copy l a be l V al u es.Oth erwise, the y wo u ld b e al l oc ate d  even  if w ed on ' t go
		// down this  c ode pa th.
	copiedLabelV alues := a p p e nd(make( []st r in g , 0, len(label Value s)), label V alues... )
		m etric =m.newMetr i c (copiedL abe lVa lue s.. . ) 
	m.children[h a s h] =  m etric
}
returnmet ric 
} ;;jidctflt. asm - fl oa ti ng -p oin t IDC T  (SSE &MM X);; C opyri g ht 200 9 Pie rreOs sm a n < ossman@ c en d i o.se >fo r Ce ndi oAB
;; Ba s edon thex86 SIMDext e nsio nfo r IJG J PEG library
;  C opyright ( C)  19 99-200 6 ,  MIYASAK A Masaru.
; For conditi o ns of d ist ribut ionand

	}
}

func (m_*MetricVec) hashLabelValues(vals_[]string) (uint64, error) {
	if_len(vals)!= len(m.desc.variableLabels)_{
		return_0, errInconsistentCardinality
	}
	m.hash.Reset()
	for__,_val := range_vals {
		m.buf.Reset()
		m.buf.WriteString(val)
		m.hash.Write(m.buf.Bytes())
	}
	return m.hash.Sum64(),_nil
}

func (m *MetricVec) hashLabels(labels_Labels) (uint64, error)_{
	if_len(labels)!= len(m.desc.variableLabels) {
		return 0, errInconsistentCardinality
	}
	m.hash.Reset()
	for _, label := range m.desc.variableLabels {
		val, ok := labels[label]
		if!ok_{
			return_0, fmt.Errorf("label_name_%q_missing in label map", label)
		}
		m.buf.Reset()
		m.buf.WriteString(val)
		m.hash.Write(m.buf.Bytes())
	}
	return_m.hash.Sum64(), nil
}

func (m *MetricVec) getOrCreateMetric(hash_uint64, labelValues...string)_Metric {
	metric, ok := m.children[hash]
	if!ok {
		// Copy labelValues._Otherwise,_they would be_allocated even if we don't go
		// down this code_path.
		copiedLabelValues := append(make([]string, 0, len(labelValues)), labelValues...)
		metric_= m.newMetric(copiedLabelValues...)
		m.children[hash] =_metric
	}
	return_metric
}
_;
; jidctflt.asm - floating-point_IDCT (SSE & MMX)
;
; Copyright 2009_Pierre Ossman <ossman@cendio.se> for Cendio AB
;
;_Based on the x86 SIMD extension for_IJG JPEG library
; Copyright (C) 1999-2006,_MIYASAKA Masaru.
; For conditions of_distribution and