Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for KindUint64 (0.13 sec)

  1. src/runtime/metrics/value.go

    type ValueKind int
    
    const (
    	// KindBad indicates that the Value has no type and should not be used.
    	KindBad ValueKind = iota
    
    	// KindUint64 indicates that the type of the Value is a uint64.
    	KindUint64
    
    	// KindFloat64 indicates that the type of the Value is a float64.
    	KindFloat64
    
    	// KindFloat64Histogram indicates that the type of the Value is a *Float64Histogram.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 08 16:59:11 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  2. src/log/slog/value_access_benchmark_test.go

    		a  any
    	)
    	b.Run("switch-checked", func(b *testing.B) {
    		for i := 0; i < b.N; i++ {
    			for _, v := range vs {
    				switch v.Kind() {
    				case KindString:
    					s = v.String()
    				case KindInt64:
    					ii = v.Int64()
    				case KindUint64:
    					u = v.Uint64()
    				case KindFloat64:
    					f = v.Float64()
    				case KindBool:
    					bb = v.Bool()
    				case KindDuration:
    					d = v.Duration()
    				case KindAny:
    					a = v.Any()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 21 20:55:33 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  3. src/internal/godebug/godebug_test.go

    	metrics.Read(m[:])
    	if kind := m[0].Value.Kind(); kind != metrics.KindUint64 {
    		t.Fatalf("NonDefault kind = %v, want uint64", kind)
    	}
    
    	s := New(name)
    	s.Value()
    	s.IncNonDefault()
    	s.IncNonDefault()
    	s.IncNonDefault()
    	metrics.Read(m[:])
    	if kind := m[0].Value.Kind(); kind != metrics.KindUint64 {
    		t.Fatalf("NonDefault kind = %v, want uint64", kind)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 4K bytes
    - Viewed (0)
  4. src/log/slog/internal/benchmarks/handlers.go

    	return err
    }
    
    func (h *fastTextHandler) appendValue(buf *buffer.Buffer, v slog.Value) {
    	switch v.Kind() {
    	case slog.KindString:
    		buf.WriteString(v.String())
    	case slog.KindInt64:
    		*buf = strconv.AppendInt(*buf, v.Int64(), 10)
    	case slog.KindUint64:
    		*buf = strconv.AppendUint(*buf, v.Uint64(), 10)
    	case slog.KindFloat64:
    		*buf = strconv.AppendFloat(*buf, v.Float64(), 'g', -1, 64)
    	case slog.KindBool:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 12 20:33:37 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  5. src/runtime/metrics/example_test.go

    	// Iterate over all results.
    	for _, sample := range samples {
    		// Pull out the name and value.
    		name, value := sample.Name, sample.Value
    
    		// Handle each sample.
    		switch value.Kind() {
    		case metrics.KindUint64:
    			fmt.Printf("%s: %d\n", name, value.Uint64())
    		case metrics.KindFloat64:
    			fmt.Printf("%s: %f\n", name, value.Float64())
    		case metrics.KindFloat64Histogram:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 08 16:09:01 UTC 2021
    - 2.6K bytes
    - Viewed (0)
  6. src/log/slog/json_handler.go

    	s.buf.WriteByte('"')
    }
    
    func appendJSONValue(s *handleState, v Value) error {
    	switch v.Kind() {
    	case KindString:
    		s.appendString(v.str())
    	case KindInt64:
    		*s.buf = strconv.AppendInt(*s.buf, v.Int64(), 10)
    	case KindUint64:
    		*s.buf = strconv.AppendUint(*s.buf, v.Uint64(), 10)
    	case KindFloat64:
    		// json.Marshal is funny about floats; it doesn't
    		// always match strconv.AppendFloat. So just call it.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 17 16:18:11 UTC 2023
    - 8.1K bytes
    - Viewed (0)
Back to top