// Value returns the value of the metric at the given level.
343561
func (m Metric) Value(level int) float64 {
	return math.Ldexp(m.Deriv, -m.Dim*level)
}
576607
func (setting Setting) Value() (driver.Value, error) {
	result, err := json.Marshal(setting)
	return string(result), err
}
1348236
func (iter *UnionIter) Value() []byte {
	if !iter.curIsDirty {
		return iter.snapshotIt.Value()
	}
	return iter.dirtyIt.Value()
}
1138653
func (s *Scanner) Value() []byte {
	if s.valid {
		return s.cache[s.idx].Value
	}
	return nil
}
826307
func (p *Polygon) Value() (driver.Value, error) {
	if p.Polygon == nil {
		return nil, nil
	}
	return value(p.Polygon)
}
665301
func (c *changer) Value() (interface{}, error) {
	if c.err != nil {
		return nil, c.err
	}
	return c.node.content.value(), nil
}
443508
func (m Map) Value() (driver.Value, error) {
	b, err := json.Marshal(m)
	if err != nil {
		return nil, errors.WithStack(err)
	}
	return string(b), nil
}
483731
func (src *Int2) Value() (driver.Value, error) {
	switch src.Status {
	case Present:
		return int64(src.Int), nil
	case Null:
		return nil, nil
	default:
		return nil, errUndefined
	}
}
1102566
func (ms *MetricSender) Value(name string, value float64, unit string) ValueChainer {
	chainer := valueChainer{}
	chainer.emitter = ms.eventEmitter
	chainer.envelope = &events.Envelope{
		Origin:    proto.String(ms.eventEmitter.Origin()),
		EventType: events.Envelope_ValueMetric.Enum(),
		ValueMetric: &events.ValueMetric{
			Name:  proto.String(name),
			Value: proto.Float64(value),
			Unit:  proto.String(unit),
		},
	}
	return chainer
}
632985
func (mls *MultiLineString) Value() (driver.Value, error) {
	if mls.MultiLineString == nil {
		return nil, nil
	}
	return value(mls.MultiLineString)
}
185700
func (tc *TiDBContext) Value(key fmt.Stringer) interface{} {
	return tc.session.Value(key)
}
1033599
func (c *Counter) Value() ([]byte, error) {
	if c.invalid {
		return nil, errInvalidCounter
	}
	return c.value[:], nil
}
1365285
func (c *Context) Value(key interface{}) interface{} {
	if s, ok := key.(string); ok {
		if v, ok := c.data[s]; ok {
			return v
		}
	}
	return c.Context.Value(key)
}
559675
func (it *EntryInfoIterator) Value() (EntryInfo, error) {
	it.mutex.Lock()

	if !it.valid {
		it.mutex.Unlock()
		return emptyEntryInfo, ErrInvalidIteratorState
	}

	entry, err := it.cache.shards[it.currentShard].getEntry(int(it.elements[it.currentIndex]))

	if err != nil {
		it.mutex.Unlock()
		return emptyEntryInfo, ErrCannotRetrieveEntry
	}
	it.mutex.Unlock()

	return EntryInfo{
		timestamp: readTimestampFromEntry(entry),
		hash:      readHashFromEntry(entry),
		key:       readKeyFromEntry(entry),
		value:     readEntry(entry),
	}, nil
}
819214
func (iter *Iterator) Value() Entry {
	if iter.n == nil {
		return nil
	}

	return iter.n.entry
}
323523
func (iter *Iterator) Value() Entry {
	if iterExhausted(iter) {
		return nil
	}

	if iter.entries == nil || iter.index < 0 || iter.index >= len(iter.entries.entries) {
		return nil
	}

	return iter.entries.entries[iter.index]
}
1041356
func Value(name string, value float64, unit string) metric_sender.ValueChainer {
	if metricSender == nil {
		return nil
	}
	return metricSender.Value(name, value, unit)
}