stats

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Overview

Package stats contains interfaces and utilities relating to the collection of statistics from Scalibr.

Index

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)
}

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 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) 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.

Jump to

Keyboard shortcuts

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