Documentation
¶
Overview ¶
Package stats contains interfaces and utilities relating to the collection of statistics from Scalibr.
Index ¶
- type Collector
- type FileStats
- type NoopCollector
- func (c NoopCollector) AfterDetectorRun(name string, runtime time.Duration, err error)
- func (c NoopCollector) AfterExtractorRun(name string, runtime time.Duration, err error)
- func (c NoopCollector) AfterFileSeen(name string, filestats *FileStats)
- func (c NoopCollector) AfterInodeVisited(path string)
- func (c NoopCollector) AfterResultsExported(destination string, bytes int, err error)
- func (c NoopCollector) AfterScan(runtime time.Duration, status *plugin.ScanStatus)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector interface {
AfterInodeVisited(path string)
AfterExtractorRun(name string, runtime time.Duration, err error)
AfterDetectorRun(name string, runtime time.Duration, err error)
AfterScan(runtime time.Duration, status *plugin.ScanStatus)
// AfterResultsExported is called after results have been exported. destination should merely be
// a category of where the result was written to (e.g. 'file', 'http'), not the precise location.
AfterResultsExported(destination string, bytes int, err error)
AfterFileSeen(pluginName string, filestats *FileStats)
}
Collector is a component which is notified when certain events occur. It can be implemented with different metric backends to enable monitoring of Scalibr.
type FileStats ¶ added in v0.1.1
type FileStats struct {
Path string
Error error
FileSizeBytes int64
// For extractors that unarchive a compressed files, this reports the bytes
// that were opened during the unarchiving process.
UncompressedBytes int64
}
FileStats is a struct containing stats about a file that was extracted. If the file was skipped due to an error during extraction, `Error` will be populated.
type NoopCollector ¶
type NoopCollector struct{}
NoopCollector implements Collector by doing nothing.
func (NoopCollector) AfterDetectorRun ¶
func (c NoopCollector) AfterDetectorRun(name string, runtime time.Duration, err error)
AfterDetectorRun implements Collector by doing nothing.
func (NoopCollector) AfterExtractorRun ¶
func (c NoopCollector) AfterExtractorRun(name string, runtime time.Duration, err error)
AfterExtractorRun implements Collector by doing nothing.
func (NoopCollector) AfterFileSeen ¶ added in v0.1.1
func (c NoopCollector) AfterFileSeen(name string, filestats *FileStats)
AfterFileSeen implements Collector by doing nothing.
func (NoopCollector) AfterInodeVisited ¶
func (c NoopCollector) AfterInodeVisited(path string)
AfterInodeVisited implements Collector by doing nothing.
func (NoopCollector) AfterResultsExported ¶
func (c NoopCollector) AfterResultsExported(destination string, bytes int, err error)
AfterResultsExported implements Collector by doing nothing.
func (NoopCollector) AfterScan ¶
func (c NoopCollector) AfterScan(runtime time.Duration, status *plugin.ScanStatus)
AfterScan implements Collector by doing nothing.