Documentation ¶
Index ¶
Constants ¶
View Source
const ( // MetricFileNameSuffix represents the suffix of the metric file. MetricFileNameSuffix = "metrics.log" // MetricIdxSuffix represents the suffix of the metric index file. MetricIdxSuffix = ".idx" // FileLockSuffix represents the suffix of the lock file. FileLockSuffix = ".lck" // FilePidPrefix represents the pid flag of filename. FilePidPrefix = "pid" )
Variables ¶
This section is empty.
Functions ¶
func FormMetricFileName ¶
Generate the metric file name from the service name.
Types ¶
type DefaultMetricLogWriter ¶
type DefaultMetricLogWriter struct {
// contains filtered or unexported fields
}
func (*DefaultMetricLogWriter) Close ¶
func (d *DefaultMetricLogWriter) Close() error
func (*DefaultMetricLogWriter) Write ¶
func (d *DefaultMetricLogWriter) Write(ts uint64, items []*base.MetricItem) error
type DefaultMetricSearcher ¶
type DefaultMetricSearcher struct {
// contains filtered or unexported fields
}
func (*DefaultMetricSearcher) FindByTimeAndResource ¶
func (s *DefaultMetricSearcher) FindByTimeAndResource(beginTimeMs uint64, endTimeMs uint64, resource string) ([]*base.MetricItem, error)
func (*DefaultMetricSearcher) FindFromTimeWithMaxLines ¶
func (s *DefaultMetricSearcher) FindFromTimeWithMaxLines(beginTimeMs uint64, maxLines uint32) ([]*base.MetricItem, error)
type MetricLogReader ¶
type MetricLogWriter ¶
type MetricLogWriter interface {
Write(ts uint64, items []*base.MetricItem) error
}
MetricLogWriter writes and flushes metric items to current metric log.
func NewDefaultMetricLogWriter ¶
func NewDefaultMetricLogWriter(maxSize uint64, maxFileAmount uint32) (MetricLogWriter, error)
func NewDefaultMetricLogWriterOfApp ¶
func NewDefaultMetricLogWriterOfApp(maxSize uint64, maxFileAmount uint32, appName string) (MetricLogWriter, error)
type MetricSearcher ¶
type MetricSearcher interface { FindByTimeAndResource(beginTimeMs uint64, endTimeMs uint64, resource string) ([]*base.MetricItem, error) FindFromTimeWithMaxLines(beginTimeMs uint64, maxLines uint32) ([]*base.MetricItem, error) }
MetricSearcher searches metric items from the metric log file under given condition.
func NewDefaultMetricSearcher ¶
func NewDefaultMetricSearcher(baseDir, baseFilename string) (MetricSearcher, error)
Click to show internal directories.
Click to hide internal directories.