Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilterCriteria ¶
type LogEntry ¶
type LogEntry struct {
Timestamp time.Time `json:"timestamp"`
Duration int64 `json:"duration_ms"`
Database string `json:"database"`
User string `json:"user"`
Query string `json:"query"`
Reads int64 `json:"logical_reads"`
Writes int64 `json:"writes"`
CPU int64 `json:"cpu_ms"`
SPID int `json:"spid"`
}
func FilterEntries ¶
func FilterEntries(entries []LogEntry, criteria FilterCriteria) []LogEntry
FilterEntries filters log entries based on criteria
type LogFormatDetector ¶
type LogFormatDetector struct{}
LogFormatDetector helps identify the format of log files
func NewLogFormatDetector ¶
func NewLogFormatDetector() *LogFormatDetector
func (*LogFormatDetector) DetectFormat ¶
func (d *LogFormatDetector) DetectFormat(sample string) LogFormat
type LogMetrics ¶
type LogMetrics struct {
TotalEntries int `json:"total_entries"`
QueryTypes map[string]int `json:"query_types"`
AvgDuration float64 `json:"avg_duration_ms"`
MaxDuration int64 `json:"max_duration_ms"`
MinDuration int64 `json:"min_duration_ms"`
TotalReads int64 `json:"total_reads"`
TotalWrites int64 `json:"total_writes"`
DatabaseCounts map[string]int `json:"database_counts"`
HourlyDistribution map[int]int `json:"hourly_distribution"`
}
LogMetrics provides statistics about parsed logs
func CalculateMetrics ¶
func CalculateMetrics(entries []LogEntry) LogMetrics
type SQLServerLogParser ¶
type SQLServerLogParser struct{}
func NewSQLServerLogParser ¶
func NewSQLServerLogParser() *SQLServerLogParser
func (*SQLServerLogParser) ParseLog ¶
func (p *SQLServerLogParser) ParseLog(reader io.Reader) ([]LogEntry, error)
func (*SQLServerLogParser) ParseLogFile ¶
func (p *SQLServerLogParser) ParseLogFile(filename string) ([]LogEntry, error)
ParseLogFile parses a log file by path.
Click to show internal directories.
Click to hide internal directories.