Documentation ¶
Index ¶
- Constants
- Variables
- func NewDataCollector(storage DataStorage) *dataCollector
- func NewRedisDataStorage(ctx context.Context, cf redis.ClientFactory) *redisDataStorage
- func Use()
- type CPUPair
- type ChartController
- type ChartsForwardRequest
- type DataGroup
- type DataStorage
- type Feed
- type PprofPair
- type RawEntries
- type SimplePair
Constants ¶
View Source
const (
HttpChartPrefix = "charts"
)
Variables ¶
View Source
var ( SamplingRate = time.Second SampleMaxSize int64 = 86400 SampleProfiles = utils.NewStringSet("block", "goroutine", "heap", "mutex", "threadcreate") )
View Source
var ( // DataGroups collected profiles to return in "data" endpoint DataGroups = []DataGroup{GroupBytesAllocated, GroupGCPauses, GroupCPUUsage, GroupPprof} // PongTimeout is the time data feed would wait for pong message before it close the websocket connection PongTimeout = time.Minute )
View Source
var Content embed.FS
View Source
var Module = &bootstrap.Module{ Precedence: bootstrap.DebugPrecedence, Options: []fx.Option{ fx.Provide(provideDataStorage, NewDataCollector), fx.Invoke(initialize), }, }
Functions ¶
func NewDataCollector ¶
func NewDataCollector(storage DataStorage) *dataCollector
func NewRedisDataStorage ¶
func NewRedisDataStorage(ctx context.Context, cf redis.ClientFactory) *redisDataStorage
Types ¶
type CPUPair ¶
func (*CPUPair) MarshalBinary ¶
type ChartController ¶
type ChartController struct {
// contains filtered or unexported fields
}
func NewChartController ¶
func NewChartController(storage DataStorage, collector *dataCollector) *ChartController
func (*ChartController) ChartUI ¶
func (c *ChartController) ChartUI(w http.ResponseWriter, r *http.Request)
func (*ChartController) Data ¶
func (c *ChartController) Data(gc *gin.Context)
func (*ChartController) DataFeed ¶
func (c *ChartController) DataFeed(gc *gin.Context)
func (*ChartController) Mappings ¶
func (c *ChartController) Mappings() []web.Mapping
type ChartsForwardRequest ¶
type ChartsForwardRequest struct {
Path string `uri:"path"`
}
type DataStorage ¶
type DataStorage interface { Read(ctx context.Context, groups ...DataGroup) (map[DataGroup]RawEntries, error) // Append save data entry Append(ctx context.Context, group DataGroup, entry interface{}, cap int64) error // AppendAll save all data entries, grouped by DataGroup AppendAll(ctx context.Context, data map[DataGroup]interface{}, cap int64) error }
type PprofPair ¶
type PprofPair struct { Ts uint64 `json:"Ts"` Block int `json:"Block"` Goroutine int `json:"Goroutine"` Heap int `json:"Heap"` Mutex int `json:"Mutex"` Threadcreate int `json:"Threadcreate"` }
func (*PprofPair) MarshalBinary ¶
type RawEntries ¶
type RawEntries []string
func (RawEntries) MarshalJSON ¶
func (v RawEntries) MarshalJSON() (data []byte, err error)
type SimplePair ¶
func (*SimplePair) MarshalBinary ¶
func (p *SimplePair) MarshalBinary() (data []byte, err error)
Click to show internal directories.
Click to hide internal directories.