// AddInt adds an int to be encoded.
326865
func (s *StreamEncoder) AddInt(value int) {
	s.buf = strconv.AppendInt(s.buf, int64(value), 10)
	s.Encoder.writeByte(s.delimiter)
}
328352
func (c *chunkedIntCoder) Add(docNum uint64, vals ...uint64) error {
	chunk := docNum / c.chunkSize
	if chunk != c.currChunk {
		// starting a new chunk
		c.Close()
		c.chunkBuf.Reset()
		c.currChunk = chunk
	}

	if len(c.buf) < binary.MaxVarintLen64 {
		c.buf = make([]byte, binary.MaxVarintLen64)
	}

	for _, val := range vals {
		wb := binary.PutUvarint(c.buf, val)
		_, err := c.chunkBuf.Write(c.buf[:wb])
		if err != nil {
			return err
		}
	}

	return nil
}
1320243
func (enc *Encoder) AddIntKey(key string, v int) {
	enc.IntKey(key, v)
}
1297921
func Int(v int) *int {
	p := new(int)
	*p = v
	return p
}
602217
func RegisterInt(name string, interval time.Duration, unit string, intEmitter func() int) {
	wrapped := func() float64 { return float64(intEmitter()) }
	Register(name, interval, unit, wrapped)
}
1360377
func (lr *LockedRand) Int() (n int) {
	lr.lk.Lock()
	n = lr.r.Int()
	lr.lk.Unlock()
	return
}
805106
func (c *Context) Int(name string) int {
	return lookupInt(name, c.flagSet)
}
526564
func EncodeInt(b []byte, v int64) []byte {
	var data [8]byte
	u := encodeIntToCmpUint(v)
	binary.BigEndian.PutUint64(data[:], u)
	return append(b, data[:]...)
}
939066
func AddInteger(a uint64, b int64) (uint64, error) {
	if b >= 0 {
		return AddUint64(a, uint64(b))
	}

	if uint64(-b) > a {
		return 0, ErrOverflow.GenWithStackByArgs("BIGINT UNSIGNED", fmt.Sprintf("(%d, %d)", a, b))
	}
	return a - uint64(-b), nil
}
1298857
func (num Number) Int() (int, bool) {
	i, err := json.Number(num).Int64()
	if err != nil {
		return 0, false
	}
	return int(i), true
}
4534
func (m *MT19937) Int() int {
	u := uint(m.Int32())
	return int(u << 1 >> 1)
}
1012431
func addvarint(ctxt *Link, d *Pcdata, val uint32) {
	var v uint32
	for v = val; v >= 0x80; v >>= 7 {
		d.P = append(d.P, uint8(v|0x80))
	}
	d.P = append(d.P, uint8(v))
}
1260144
func (enc *Encoder) Int(v int) {
	enc.grow(10)
	r := enc.getPreviousRune()
	if r != '[' {
		enc.writeByte(',')
	}
	enc.buf = strconv.AppendInt(enc.buf, int64(v), 10)
}
247828
func (enc *Encoder) AddInt8KeyOmitEmpty(key string, v int8) {
	enc.Int64KeyOmitEmpty(key, int64(v))
}
344061
func (m *memData) SetInt(name string, i int) {
	m.l.Lock()
	defer m.l.Unlock()
	m.ints[name] = i
}
175876
func (s *Statement) Int() *Statement {
	// notest
	t := token{
		content: "int",
		typ:     identifierToken,
	}
	*s = append(*s, t)
	return s
}
356235
func (s *Client) SetInt(stat string, value int64, rate float32) error {
	if !s.includeStat(rate) {
		return nil
	}

	return s.submit(stat, "", value, "|s", rate)
}