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) Name() string
- func (h *Analyzer) ReceiveData(context protocol.Context, event *protocol.SocketDataUploadEvent) bool
- func (h *Analyzer) UpdateExtensionConfig(config *profiling.ExtensionConfig)
- type BufferAnalyzer
- type ConnectionMetrics
- func (h *ConnectionMetrics) FlushMetrics(traffic *base.ProcessTraffic, metricsBuilder *base.MetricsBuilder)
- func (h *ConnectionMetrics) MergeFrom(analyzer *Analyzer, other *ConnectionMetrics)
- func (h *ConnectionMetrics) MergeMetricsFromConnection(connection *base.ConnectionContext, data base.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,
}
View Source
var ProtocolName = "http1"
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) ReceiveData ¶
func (*Analyzer) UpdateExtensionConfig ¶
func (h *Analyzer) UpdateExtensionConfig(config *profiling.ExtensionConfig)
type BufferAnalyzer ¶
type BufferAnalyzer struct {
// contains filtered or unexported fields
}
func NewHTTP1BufferAnalyzer ¶
func NewHTTP1BufferAnalyzer(http1 *Analyzer) *BufferAnalyzer
func (*BufferAnalyzer) Analyze ¶
func (h *BufferAnalyzer) Analyze(events *list.List) (request, response base2.SocketDataBuffer)
type ConnectionMetrics ¶
type ConnectionMetrics struct {
// contains filtered or unexported fields
}
func (*ConnectionMetrics) FlushMetrics ¶
func (h *ConnectionMetrics) FlushMetrics(traffic *base.ProcessTraffic, metricsBuilder *base.MetricsBuilder)
func (*ConnectionMetrics) MergeFrom ¶
func (h *ConnectionMetrics) MergeFrom(analyzer *Analyzer, other *ConnectionMetrics)
func (*ConnectionMetrics) MergeMetricsFromConnection ¶
func (h *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 (s *Sampler) AppendMetrics(config *SamplingConfig, duration time.Duration, request *http.Request, response *http.Response, reqBuffer, respBuffer protocol.SocketDataBuffer)
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.TracingContext
RequestURI string
RequestBuffer protocol.SocketDataBuffer
Request *http.Request
ResponseBuffer protocol.SocketDataBuffer
Response *http.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 *http.Request, reqBuffer protocol.SocketDataBuffer, resp *http.Response, respBuffer protocol.SocketDataBuffer)
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.