Documentation
¶
Index ¶
Constants ¶
const ( // ChunkSize is used to predict the timestamp schema and timestamps. ChunkSize = 32 * 1024 // 32KB )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogIterator ¶
type LogIterator struct {
// contains filtered or unexported fields
}
LogIterator iterates over StampedLogs in order.
func NewLogIterator ¶
func NewLogIterator(lr *LogReader) (*LogIterator, error)
NewLogIterator creates a new LogIterator instance.
func (*LogIterator) Next ¶
func (it *LogIterator) Next() (*StampedLog, bool)
Next returns the next StampedLog.
type LogReader ¶
type LogReader struct {
// contains filtered or unexported fields
}
LogReader reads and parses log files.
func NewLogReader ¶
func NewLogReader(reader io.ReadSeeker, name string) (*LogReader, error)
NewLogReader creates a new LogReader instance.
func (*LogReader) GetEndTimestamp ¶
GetEndTimestamp returns the last timestamp in the log file.
func (*LogReader) GetStartTimestamp ¶
GetStartTimestamp returns the first timestamp in the log file.
func (*LogReader) GetTimestampFormat ¶
func (lr *LogReader) GetTimestampFormat() TimestampFormat
GetTimestampFormat returns the timestamp format used in the log file.
type OrderedQueue ¶
type OrderedQueue struct {
// contains filtered or unexported fields
}
OrderedQueue maintains order of StampedLog elements.
func NewOrderedQueue ¶
func NewOrderedQueue(size int) *OrderedQueue
NewOrderedQueue creates a new OrderedQueue instance.
func (*OrderedQueue) Consume ¶
func (oq *OrderedQueue) Consume(log *StampedLog) *StampedLog
Consume adds a new log to the queue and returns the oldest log if queue is full.
func (*OrderedQueue) DumpRemaining ¶
func (oq *OrderedQueue) DumpRemaining() []*StampedLog
DumpRemaining returns all remaining logs in order.
type StampedLog ¶
StampedLog represents a log line with its timestamp.
type TimestampFormat ¶
type TimestampFormat struct {
// contains filtered or unexported fields
}
type TimestampHeap ¶
type TimestampHeap []*StampedLog
TimestampHeap implements heap.Interface for StampedLog.
func (*TimestampHeap) Len ¶
func (h *TimestampHeap) Len() int
func (*TimestampHeap) Less ¶
func (h *TimestampHeap) Less(i, j int) bool
func (*TimestampHeap) Pop ¶
func (h *TimestampHeap) Pop() interface{}
func (*TimestampHeap) Push ¶
func (h *TimestampHeap) Push(x interface{})
func (*TimestampHeap) Swap ¶
func (h *TimestampHeap) Swap(i, j int)