datasource

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2025 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	CacheHit    = "hit"
	CacheWrite  = "write"
	CacheDelete = "delete"
)

Variables

This section is empty.

Functions

func MicroTime

func MicroTime(timer time.Time) float64

Types

type CacheDataSource

type CacheDataSource struct {
	// contains filtered or unexported fields
}

func (*CacheDataSource) LogCache

func (source *CacheDataSource) LogCache(connection, typeParam, action, key, value string, duration, expiration float32)

func (*CacheDataSource) LogCacheMiss

func (source *CacheDataSource) LogCacheMiss(connection, action, key, value string, misses int, duration, expiration float32)

func (*CacheDataSource) Resolve

func (source *CacheDataSource) Resolve(dataBuffer *DataBuffer)

type CacheLoggerDataSourceInterface

type CacheLoggerDataSourceInterface interface {
	DataSource
	CacheLoggerInterface
}

type CacheLoggerInterface

type CacheLoggerInterface interface {
	LogCache(connection, typeParam, action string, key string, value string, duration float32, expiration float32)
	LogCacheMiss(connection, action string, key string, value string, misses int, duration float32, expiration float32)
}

type CommandLoggerDataSourceInterface

type CommandLoggerDataSourceInterface interface {
	DataSource
	CommandLoggerInterface
}

type CommandLoggerInterface

type CommandLoggerInterface interface {
	LogCommand(command string, key string, duration float32)
}

type DataBuffer

type DataBuffer struct {
	Log                  []interface{}            `json:"log"`
	DatabaseQueries      []interface{}            `json:"databaseQueries"`
	DatabaseQueriesCount int                      `json:"databaseQueriesCount"`
	DatabaseDuration     float32                  `json:"databaseDuration"`
	RedisCommands        []interface{}            `json:"redisCommands"`
	CacheQueries         []interface{}            `json:"cacheQueries"`
	CacheTime            float32                  `json:"cacheTime"`
	CacheDeletes         int16                    `json:"cacheDeletes"`
	CacheWrites          int16                    `json:"cacheWrites"`
	CacheReads           int16                    `json:"cacheReads"`
	CacheHits            int16                    `json:"cacheHits"`
	TimelineData         map[string]interface{}   `json:"timelineData"`
	Time                 float64                  `json:"time"`
	Controller           string                   `json:"controller"`
	Middleware           []string                 `json:"middleware"`
	MemoryUsage          uint64                   `json:"memoryUsage"`
	ResponseTime         float64                  `json:"responseTime"`
	ResponseDuration     float64                  `json:"responseDuration"`
	ResponseStatus       int16                    `json:"responseStatus"`
	UserData             []map[string]interface{} `json:"userData"`
}

type DataSource

type DataSource interface {
	Resolve(dataBuffer *DataBuffer)
}

type DatabaseDataSource

type DatabaseDataSource struct {
	// contains filtered or unexported fields
}

func (*DatabaseDataSource) LogQuery

func (source *DatabaseDataSource) LogQuery(model, query string, duration float32, bind []interface{})

func (*DatabaseDataSource) Resolve

func (source *DatabaseDataSource) Resolve(dataBuffer *DataBuffer)

type LoggerDataSource

type LoggerDataSource struct {
	// contains filtered or unexported fields
}

func (*LoggerDataSource) LogDebugMap

func (source *LoggerDataSource) LogDebugMap(name string, debugData map[string]string)

func (*LoggerDataSource) LogDebugSlice

func (source *LoggerDataSource) LogDebugSlice(name string, debugData []string)

func (*LoggerDataSource) LogDebugString

func (source *LoggerDataSource) LogDebugString(name string, debugData string)

func (*LoggerDataSource) Resolve

func (source *LoggerDataSource) Resolve(dataBuffer *DataBuffer)

type LoggerDataSourceInterface

type LoggerDataSourceInterface interface {
	DataSource
	LoggerInterface
}

type LoggerInterface

type LoggerInterface interface {
	LogDebugSlice(name string, debugData []string)
	LogDebugMap(name string, debugData map[string]string)
	LogDebugString(name string, debugData string)
}

type QueryLoggerDataSourceInterface

type QueryLoggerDataSourceInterface interface {
	DataSource
	QueryLoggerInterface
}

type QueryLoggerInterface

type QueryLoggerInterface interface {
	LogQuery(model, query string, duration float32, bind []interface{})
}

type RedisDataSource

type RedisDataSource struct {
	// contains filtered or unexported fields
}

func (*RedisDataSource) LogCommand

func (source *RedisDataSource) LogCommand(command string, key string, duration float32)

func (*RedisDataSource) Resolve

func (source *RedisDataSource) Resolve(dataBuffer *DataBuffer)

type RequestLoggerDataSourceInterface

type RequestLoggerDataSourceInterface interface {
	DataSource
	RequestLoggerInterface
}

type RequestLoggerInterface

type RequestLoggerInterface interface {
	SetStartTime(start time.Time)
	SetResponseTime(responseTime time.Time)
	SetResponseStatus(status int16)
	StartMemoryUsage()
	EndMemoryUsage()
	SetController(controller string, method string)
	SetMiddleware([]string)
}

type RequestResponseDataSource

type RequestResponseDataSource struct {
	// contains filtered or unexported fields
}

func (*RequestResponseDataSource) EndMemoryUsage

func (source *RequestResponseDataSource) EndMemoryUsage()

func (*RequestResponseDataSource) Resolve

func (source *RequestResponseDataSource) Resolve(dataBuffer *DataBuffer)

func (*RequestResponseDataSource) SetController

func (source *RequestResponseDataSource) SetController(controller string, method string)

func (*RequestResponseDataSource) SetMiddleware

func (source *RequestResponseDataSource) SetMiddleware(middleware []string)

func (*RequestResponseDataSource) SetResponseStatus

func (source *RequestResponseDataSource) SetResponseStatus(responseStatus int16)

func (*RequestResponseDataSource) SetResponseTime

func (source *RequestResponseDataSource) SetResponseTime(responseTime time.Time)

func (*RequestResponseDataSource) SetStartTime

func (source *RequestResponseDataSource) SetStartTime(start time.Time)

func (*RequestResponseDataSource) StartMemoryUsage

func (source *RequestResponseDataSource) StartMemoryUsage()

type TimelineDataSource

type TimelineDataSource struct {
	// contains filtered or unexported fields
}

func (*TimelineDataSource) EndEvent

func (source *TimelineDataSource) EndEvent(event string)

func (*TimelineDataSource) Resolve

func (source *TimelineDataSource) Resolve(dataBuffer *DataBuffer)

func (*TimelineDataSource) StartEvent

func (source *TimelineDataSource) StartEvent(event string, description string)

type TimelineLoggerDataSourceInterface

type TimelineLoggerDataSourceInterface interface {
	DataSource
	TimelineLoggerInterface
}

type TimelineLoggerInterface

type TimelineLoggerInterface interface {
	StartEvent(event string, description string)
	EndEvent(event string)
}

type UserDataDataSource

type UserDataDataSource struct {
	Title  string                   `json:"title"`
	Data   []map[string]interface{} `json:"data"`
	ShowAs string                   `json:"showAs"` // Present data as "counters" or "table"
	// contains filtered or unexported fields
}

func (*UserDataDataSource) LogTable

func (source *UserDataDataSource) LogTable(data map[string]interface{}, title string, labels map[string]string)

LogTable labels: Map of human-readable labels for the data contents showAs: Describes how the data should be presented ("counters" or "table")

func (*UserDataDataSource) Resolve

func (source *UserDataDataSource) Resolve(dataBuffer *DataBuffer)

func (*UserDataDataSource) SetShowAs

func (source *UserDataDataSource) SetShowAs(showAs string)

func (*UserDataDataSource) SetTitle

func (source *UserDataDataSource) SetTitle(title string)

type UserDataInterface

type UserDataInterface interface {
	SetTitle(title string)
	SetShowAs(showAs string)
	LogTable(data map[string]interface{}, title string, labels map[string]string)
}

type UserDataSourceInterface

type UserDataSourceInterface interface {
	DataSource
	UserDataInterface
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL