Documentation
¶
Overview ¶
Package profile provides protocol encoding/decoding performance profiling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatProfile ¶
func FormatProfile(r *ProfileResult) string
FormatProfile formats profiling results.
Types ¶
type FieldProfile ¶
type FieldProfile struct {
Name string `json:"name"`
Duration time.Duration `json:"duration"`
Allocs int64 `json:"allocs"`
Bytes int64 `json:"bytes"`
}
FieldProfile holds profiling data for a single field.
type ProfileResult ¶
type ProfileResult struct {
Protocol string `json:"protocol"`
Operation string `json:"operation"`
Total time.Duration `json:"total"`
Fields []FieldProfile `json:"fields"`
TotalAlloc int64 `json:"total_alloc"`
Bottleneck string `json:"bottleneck"`
}
ProfileResult holds the complete profiling result.
type Profiler ¶
type Profiler struct {
// contains filtered or unexported fields
}
Profiler profiles protocol operations.
func NewProfiler ¶
NewProfiler creates a new profiler.
func (*Profiler) ProfileDecode ¶
func (p *Profiler) ProfileDecode(protoName string, data []byte, iterations int) (*ProfileResult, error)
ProfileDecode profiles a decode operation.
Click to show internal directories.
Click to hide internal directories.