func (p *Assembler) AddMessage(message []byte) {
	p.Lock()
	if p.packetLength == 0 {
		p.packetLength = copy(p.packet.Buffer, message)
	} else if len(p.packet.Buffer) >= len(message)+p.packetLength+1 {
		p.packet.Buffer[p.packetLength] = messageSeparator
		n := copy(p.packet.Buffer[p.packetLength+1:], message)
		p.packetLength += n + 1
	} else {
		p.flush()
		p.packetLength = copy(p.packet.Buffer, message)
	}
	p.Unlock()
}
// AddMessage adds a new dogstatsd message to the buffer
AddMessage adds a new dogstatsd message to the buffer
// AddMessage adds a new dogstatsd message to the buffer
func (p *Assembler) AddMessage(message []byte) {
	p.Lock()
	if p.packetLength == 0 {
		p.packetLength = copy(p.packet.Buffer, message)
	} else if len(p.packet.Buffer) >= len(message)+p.packetLength+1 {
		p.packet.Buffer[p.packetLength] = messageSeparator
		n := copy(p.packet.Buffer[p.packetLength+1:], message)
		p.packetLength += n + 1
	} else {
		p.flush()
		p.packetLength = copy(p.packet.Buffer, message)
	}
	p.Unlock()
}
func ( p * Assembler ) AddMessage ( message [ ] byte ) { p . Lock ( ) if p . packetLength == 0 { p . packetLength = copy ( p . packet . Buffer , message ) } else if len ( p . packet . Buffer ) >= len ( message ) + p . packetLength + 1 { p . packet . Buffer [ p . packetLength ] = messageSeparator n := copy ( p . packet . Buffer [ p . packetLength + 1 : ] , message ) p . packetLength += n + 1 } else { p . flush ( ) p . packetLength = copy ( p . packet . Buffer , message ) } p . Unlock ( ) }
AddMessage adds a new dogstatsd message to the buffer
AddMessage adds a new dogstatsd message to the buffer