Documentation ¶
Index ¶
- Constants
- Variables
- func NewHTTP1Analyzer() protocol.Protocol
- type Analyzer
- func (h *Analyzer) GenerateMetrics() protocol.Metrics
- func (h *Analyzer) Init(config *profiling.TaskConfig)
- func (h *Analyzer) PackageMaxExpireDuration() time.Duration
- func (h *Analyzer) ParseProtocol(connectionID uint64, metrics protocol.Metrics, buf *buffer.Buffer) enums.ParseResult
- func (h *Analyzer) Protocol() enums.ConnectionProtocol
- func (h *Analyzer) UpdateExtensionConfig(config *profiling.ExtensionConfig)
- type ConnectionMetrics
- type Sampler
- type SamplingConfig
- type SamplingTraceLogBody
- type SamplingTraceLogProcess
- type Trace
- type URIMetrics
- type URISampling
Constants ¶
View Source
const ( TopNSize = 10 SamplingRuleCacheSize = 200 )
Variables ¶
View Source
var DurationHistogramBuckets = []float64{
1, 2, 5, 10, 15, 20, 25, 30, 40, 45, 50, 60, 65, 70, 80, 90, 100, 110, 130, 150, 170, 200, 230, 260, 290,
330, 380, 430, 480, 500, 600, 700, 800, 900, 1000, 1100, 1300, 1500, 1800, 2000, 5000, 10000, 15000, 20000, 30000,
}
View Source
var PackageSizeHistogramBuckets = []float64{
256, 512, 1048, 1536, 2048, 3072, 5120, 8192, 10240, 15360, 20480, 35840, 51200, 76800, 102400, 204800, 512000,
819200, 1048576, 1572864, 2097152, 5242880, 10485760, 20971520, 52428800,
}
Functions ¶
func NewHTTP1Analyzer ¶
Types ¶
type Analyzer ¶
type Analyzer struct {
// contains filtered or unexported fields
}
func (*Analyzer) GenerateMetrics ¶
func (*Analyzer) Init ¶
func (h *Analyzer) Init(config *profiling.TaskConfig)
func (*Analyzer) PackageMaxExpireDuration ¶ added in v0.5.0
func (*Analyzer) ParseProtocol ¶ added in v0.5.0
func (*Analyzer) Protocol ¶ added in v0.5.0
func (h *Analyzer) Protocol() enums.ConnectionProtocol
func (*Analyzer) UpdateExtensionConfig ¶
func (h *Analyzer) UpdateExtensionConfig(config *profiling.ExtensionConfig)
type ConnectionMetrics ¶
type ConnectionMetrics struct {
// contains filtered or unexported fields
}
func (*ConnectionMetrics) AppendRequestToList ¶ added in v0.5.0
func (m *ConnectionMetrics) AppendRequestToList(req *reader.Request)
func (*ConnectionMetrics) FlushMetrics ¶
func (m *ConnectionMetrics) FlushMetrics(traffic *base.ProcessTraffic, metricsBuilder *base.MetricsBuilder)
func (*ConnectionMetrics) MergeMetricsFromConnection ¶
func (m *ConnectionMetrics) MergeMetricsFromConnection(connection *base.ConnectionContext, data base.ConnectionMetrics)
type Sampler ¶
type Sampler struct { Error4xxTraces *metrics.TopN Error5xxTraces *metrics.TopN SlowTraces *metrics.TopN }
func NewSampler ¶
func NewSampler() *Sampler
func (*Sampler) AppendMetrics ¶
func (*Sampler) BuildMetrics ¶
func (s *Sampler) BuildMetrics(process api.ProcessInterface, traffic *base.ProcessTraffic, metricsBuilder *base.MetricsBuilder) int
func (*Sampler) MergeAndClean ¶
type SamplingConfig ¶
type SamplingConfig struct { ProfilingSampling *profiling.HTTPSamplingConfig DefaultRule *profiling.NetworkSamplingRule URISamplings []*URISampling // contains filtered or unexported fields }
func NewSamplingConfig ¶
func NewSamplingConfig(config *profiling.TaskConfig) *SamplingConfig
func (*SamplingConfig) UpdateRules ¶
func (s *SamplingConfig) UpdateRules(configs []*profiling.NetworkSamplingRule)
type SamplingTraceLogBody ¶
type SamplingTraceLogBody struct { URI string `json:"uri"` Reason string `json:"reason"` Latency int64 `json:"latency"` TraceProvider string `json:"trace_provider"` ClientProcess *SamplingTraceLogProcess `json:"client_process"` ServerProcess *SamplingTraceLogProcess `json:"server_process"` DetectPoint string `json:"detect_point"` Component string `json:"component"` SSL bool `json:"ssl"` Status int `json:"status"` }
type SamplingTraceLogProcess ¶
type SamplingTraceLogProcess struct { ProcessID string `json:"process_id"` Local bool `json:"local"` Address string `json:"address"` }
func NewHTTP1SampledTraceLogRemoteProcess ¶
func NewHTTP1SampledTraceLogRemoteProcess(traffic *base.ProcessTraffic, local api.ProcessInterface) *SamplingTraceLogProcess
type Trace ¶
type Trace struct { Trace protocol.Context RequestURI string Request *reader.Request Response *reader.Response Type string Settings *profiling.NetworkDataCollectingSettings TaskConfig *profiling.HTTPSamplingConfig }
func (*Trace) AppendHTTPEvents ¶
func (h *Trace) AppendHTTPEvents(process api.ProcessInterface, traffic *base.ProcessTraffic, metricsBuilder *base.MetricsBuilder)
func (*Trace) Flush ¶
func (h *Trace) Flush(duration int64, process api.ProcessInterface, traffic *base.ProcessTraffic, metricsBuilder *base.MetricsBuilder)
type URIMetrics ¶
type URIMetrics struct { RequestCounter *metrics.Counter StatusCounter map[int]*metrics.Counter AvgRequestPackageSize *metrics.AvgCounter AvgResponsePackageSize *metrics.AvgCounter ReqPackageSizeHistogram *metrics.Histogram RespPackageSizeHistogram *metrics.Histogram // contains filtered or unexported fields }
func NewHTTP1URIMetrics ¶
func NewHTTP1URIMetrics() *URIMetrics
func (*URIMetrics) Append ¶
func (u *URIMetrics) Append(sampleConfig *SamplingConfig, req *reader.Request, resp *reader.Response)
func (*URIMetrics) MergeAndClean ¶
func (u *URIMetrics) MergeAndClean(other *URIMetrics)
func (*URIMetrics) String ¶
func (u *URIMetrics) String() string
type URISampling ¶
type URISampling struct { URIMatcher *regexp.Regexp Rule *profiling.NetworkSamplingRule }
Click to show internal directories.
Click to hide internal directories.