Documentation ¶
Index ¶
- Variables
- func GetTraceHooks(t *Trace) *httptrace.ClientTrace
- type Hook
- type SyncConfig
- type Trace
- func (t *Trace) GetDrift() time.Duration
- func (t *Trace) IncreaseDrift(start time.Time)
- func (t *Trace) LogError(hook TraceHookType, err error)
- func (t *Trace) LogTime(hook TraceHookType)
- func (t *Trace) SetDone()
- func (t *Trace) SetStart(now time.Time)
- func (t *Trace) UpdateLatest(latest time.Time)
- func (t *Trace) WaitForSignal(hook TraceHookType)
- type TraceHookType
Constants ¶
This section is empty.
Variables ¶
View Source
var ThtStrings = [...]string{
"GetConn",
"DNSStart",
"DNSDone",
"ConnectStart",
"ConnectDone",
"TLSHandshakeStart",
"TLSHandshakeDone",
"GotConn",
"WroteHeaders",
"WroteRequest",
"Got100Continue",
"GotFirstResponseByte",
"Wait100Continue",
}
Functions ¶
func GetTraceHooks ¶
func GetTraceHooks(t *Trace) *httptrace.ClientTrace
Types ¶
type Hook ¶
type Hook struct { Time time.Time `json:"time"` Duration time.Duration `json:"duration"` Wait bool `json:"did_wait"` LocalDrift time.Duration `json:"local_drift"` Err error `json:"error"` }
func (*Hook) NeedToWait ¶
func (*Hook) SetLocalDrift ¶
type SyncConfig ¶
type SyncConfig struct { Cond *sync.Cond `json:"-" yaml:"-"` ReadyWg *sync.WaitGroup `json:"-" yaml:"-"` WaitOnHook TraceHookType `json:"-" yaml:"-"` }
type Trace ¶
type Trace struct { *SyncConfig `json:"-" yaml:"-"` Id uint64 `json:"id" yaml:"id"` UniqueId string `json:"unique_id" yaml:"unique_id"` TotalDrift time.Duration `json:"total_drift" yaml:"total_drift"` Start time.Time `json:"start_time" yaml:"start_time"` Latest time.Time `json:"latest" yaml:"latest"` Done time.Time `json:"done" yaml:"done"` Total time.Duration `json:"total" yaml:"total"` Error bool `json:"had_error" yaml:"had_error"` LocalAddr string `json:"local_addr" yaml:"local_addr"` Hooks map[TraceHookType]*Hook `json:"hooks" yaml:"hooks"` }
func New ¶
func New(id uint64, syncConfig *SyncConfig) *Trace
func (*Trace) IncreaseDrift ¶
func (*Trace) LogError ¶
func (t *Trace) LogError(hook TraceHookType, err error)
func (*Trace) LogTime ¶
func (t *Trace) LogTime(hook TraceHookType)
func (*Trace) UpdateLatest ¶
func (*Trace) WaitForSignal ¶
func (t *Trace) WaitForSignal(hook TraceHookType)
type TraceHookType ¶
type TraceHookType int
const ( GetConn TraceHookType = iota DNSStart DNSDone ConnectStart ConnectDone TLSHandshakeStart TLSHandshakeDone GotConn WroteHeaders WroteRequest Got100Continue GotFirstResponseByte Wait100Continue HooksCount )
func Unstring ¶
func Unstring(name string) (TraceHookType, error)
func (TraceHookType) MarshalText ¶
func (tht TraceHookType) MarshalText() (text []byte, err error)
func (TraceHookType) String ¶
func (tht TraceHookType) String() string
func (*TraceHookType) UnmarshalText ¶
func (tht *TraceHookType) UnmarshalText(text []byte) (err error)
Click to show internal directories.
Click to hide internal directories.