Documentation ¶
Index ¶
- Constants
- func BindRequestAndResponse(req context.Context, resp context.Context)
- func DisableTrack()
- func EnableTrack()
- func TrackEnabled() bool
- type TimestampPhase
- type TrackBuffer
- type TrackPhase
- type TrackTime
- type Tracks
- func (t *Tracks) Begin()
- func (t *Tracks) EndTrack(phase TrackPhase)
- func (t *Tracks) GetTrackCosts() string
- func (t *Tracks) GetTrackTimestamp() string
- func (t *Tracks) Range(f func(TrackPhase, TrackTime) bool)
- func (t *Tracks) StartTrack(phase TrackPhase)
- func (t *Tracks) VisitTimestamp(f func(TimestampPhase, time.Time) bool)
Constants ¶
View Source
const MaxServedField = StreamSendFilter
Variables ¶
This section is empty.
Functions ¶
func BindRequestAndResponse ¶
func DisableTrack ¶
func DisableTrack()
func EnableTrack ¶
func EnableTrack()
func TrackEnabled ¶
func TrackEnabled() bool
Types ¶
type TimestampPhase ¶
type TimestampPhase int
const ( RequestStartTimestamp TimestampPhase = iota ResponseStartTimestamp MaxTimestampPhase )
const TrackStartTimestamp TimestampPhase = RequestStartTimestamp
TrackStartTimestamp is an alias for RequestStartTimestamp we think a mosn stream is begin when a request received
type TrackBuffer ¶
type TrackBuffer struct {
*Tracks
}
func TrackBufferByContext ¶
func TrackBufferByContext(ctx context.Context) *TrackBuffer
type TrackPhase ¶
type TrackPhase int
const ( // reserved fields ProtocolDecode TrackPhase = iota // request and response StreamFilterBeforeRoute // MatchRoute // maybe reroute, or multiple steps StreamFilterAfterRoute LoadBalanceChooseHost // maybe rechoose host StreamFilterAfterChooseHost NetworkDataWrite // request and response StreamSendFilter // some extends fields // max phase MaxTrackPhase TrackPhase = 15 )
const NoTrack TrackPhase = -1
type Tracks ¶
type Tracks struct {
// contains filtered or unexported fields
}
func (*Tracks) EndTrack ¶
func (t *Tracks) EndTrack(phase TrackPhase)
func (*Tracks) GetTrackCosts ¶
GetTrackCosts is a wrapper for tracks.Range, only get strings to reserved fields if a extends fields added, use Range [][][]...[]
func (*Tracks) GetTrackTimestamp ¶
GetTrackTimestamp is a wrapper for tracks.VisitTimestamp, get request and response timestamp
func (*Tracks) Range ¶
func (t *Tracks) Range(f func(TrackPhase, TrackTime) bool)
Range ranges the tracks data by f. if f returns false, terminate the range
func (*Tracks) StartTrack ¶
func (t *Tracks) StartTrack(phase TrackPhase)
func (*Tracks) VisitTimestamp ¶
func (t *Tracks) VisitTimestamp(f func(TimestampPhase, time.Time) bool)
Click to show internal directories.
Click to hide internal directories.