Documentation ¶
Index ¶
- func AddMetric(observation *pb.Observation, name string, status pb.Status, score float32) *pb.Observation
- func CompareTimestamp(a *timestamp.Timestamp, b *timestamp.Timestamp) int32
- func DumpPanorama(w io.Writer, pano *pb.Panorama)
- func DumpView(w io.Writer, view *pb.View)
- func GetMetric(observation *pb.Observation, name string) *pb.Metric
- func InferenceString(inf *pb.Inference) string
- func JSONMarshal(t interface{}, prefix string, indent string) ([]byte, error)
- func JString(config interface{}) string
- func LoadConfig(path string, config interface{}) error
- func MetricsString(metrics map[string]*pb.Metric) string
- func NewMetrics(names ...string) map[string]*pb.Metric
- func NewObservation(t time.Time, names ...string) *pb.Observation
- func NewObservationSingleMetric(t time.Time, name string, status pb.Status, score float32) *pb.Observation
- func NewReport(observer string, subject string, metrics map[string]*pb.Value) *pb.Report
- func ObservationString(ob *pb.Observation) string
- func PanoramaString(pano *pb.Panorama) string
- func SaveConfig(path string, config interface{}) error
- func SetMetric(observation *pb.Observation, name string, status pb.Status, score float32) bool
- func StatusFromFullStr(status string) pb.Status
- func StatusFromStr(status string) pb.Status
- func StringArrayToSlice(array string) ([]string, error)
- func SubtractTimestamp(a *timestamp.Timestamp, b *timestamp.Timestamp) int64
- func ViewString(view *pb.View) string
- type BufferingConfig
- type ClassifierConfig
- type ConcurrentPanorama
- type Event
- type EventMap
- type EventParser
- type FieldClassifier
- type FieldClassifierResult
- type FieldFilter
- func NewFieldEqualsFilter(field string, match string) FieldFilter
- func NewFieldFilter(config *FieldFilterClauseConfig) (FieldFilter, error)
- func NewFieldInSetFilter(field string, elements ...string) FieldFilter
- func NewFieldMRegexpMapAnyFilter(field string, prefix_group string, patterns ...string) FieldFilter
- func NewFieldMRegexpMapFilter(field string, prefix_group string, pattern string) FieldFilter
- func NewFieldNotEqualFilter(field string, match string) FieldFilter
- func NewFieldRegexAnyFilter(field string, patterns ...string) FieldFilter
- func NewFieldRegexFilter(field string, pattern string) FieldFilter
- type FieldFilterBody
- type FieldFilterBranch
- type FieldFilterChainConfig
- type FieldFilterClauseConfig
- type FieldFilterTree
- type FieldFilterTreeConfig
- type GarbageCollectionConfig
- type HealthDB
- type HealthExchange
- type HealthInference
- type HealthServerConfig
- type HealthStorage
- type ObserverModule
- type Registration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMetric ¶
func AddMetric(observation *pb.Observation, name string, status pb.Status, score float32) *pb.Observation
func InferenceString ¶
func LoadConfig ¶
func NewObservation ¶
func NewObservation(t time.Time, names ...string) *pb.Observation
func ObservationString ¶
func ObservationString(ob *pb.Observation) string
func PanoramaString ¶
func SaveConfig ¶
func StatusFromFullStr ¶
func StatusFromStr ¶
func StringArrayToSlice ¶
func SubtractTimestamp ¶
func ViewString ¶
Types ¶
type BufferingConfig ¶
type ClassifierConfig ¶
type EventParser ¶
type FieldClassifier ¶
type FieldClassifier func(result map[string]string) *FieldClassifierResult
func NewFieldClassifier ¶
func NewFieldClassifier(config *ClassifierConfig) (FieldClassifier, error)
type FieldClassifierResult ¶
type FieldFilter ¶
func NewFieldEqualsFilter ¶
func NewFieldEqualsFilter(field string, match string) FieldFilter
func NewFieldFilter ¶
func NewFieldFilter(config *FieldFilterClauseConfig) (FieldFilter, error)
func NewFieldInSetFilter ¶
func NewFieldInSetFilter(field string, elements ...string) FieldFilter
func NewFieldMRegexpMapAnyFilter ¶
func NewFieldMRegexpMapAnyFilter(field string, prefix_group string, patterns ...string) FieldFilter
func NewFieldMRegexpMapFilter ¶
func NewFieldMRegexpMapFilter(field string, prefix_group string, pattern string) FieldFilter
func NewFieldNotEqualFilter ¶
func NewFieldNotEqualFilter(field string, match string) FieldFilter
func NewFieldRegexAnyFilter ¶
func NewFieldRegexAnyFilter(field string, patterns ...string) FieldFilter
func NewFieldRegexFilter ¶
func NewFieldRegexFilter(field string, pattern string) FieldFilter
type FieldFilterBody ¶
type FieldFilterBody struct { Chain []FieldFilter Classifier FieldClassifier }
type FieldFilterBranch ¶
type FieldFilterBranch struct { Head FieldFilter Bodies []*FieldFilterBody }
type FieldFilterChainConfig ¶
type FieldFilterChainConfig struct { Chain []*FieldFilterClauseConfig Classifier ClassifierConfig }
type FieldFilterClauseConfig ¶
type FieldFilterTree ¶
type FieldFilterTree []*FieldFilterBranch
func NewFieldFilterTree ¶
func NewFieldFilterTree(config *FieldFilterTreeConfig) (FieldFilterTree, error)
func (*FieldFilterTree) Eval ¶
func (self *FieldFilterTree) Eval(fields map[string]string) (map[string]string, FieldClassifier, bool)
type FieldFilterTreeConfig ¶
type FieldFilterTreeConfig struct {
FilterTree []*FieldFilterChainConfig
}
type GarbageCollectionConfig ¶
type HealthDB ¶
type HealthDB interface { // Open or create a database with file name Open() (*sql.DB, error) // Insert a report into the database InsertReport(report *pb.Report) error // Insert an inference result into the database InsertInference(inf *pb.Inference) error // Insert a registration into the database InsertRegistration(registration *Registration) error // Read the past registrations from the database ReadRegistrations() (map[uint64]*Registration, uint64) // Close the database connection Close() }
type HealthExchange ¶
type HealthExchange interface { // Propagate a report to other peers Propagate(report *pb.Report) error // Let others know I'd like to subscribe to reports about subject Subscribe(subject string) error // Let others know I'd like to unsubscribe to reports about subject Unsubscribe(subject string) error // Ping one peer and get a response Ping(peer string) (*pb.PingReply, error) // Ping all peers and get response PingAll() (map[string]*pb.PingReply, error) // peer is interested in a particular subject Interested(peer string, subject string) bool // peer is not interested in a particular subject Uninterested(peer string, subject string) bool }
type HealthInference ¶
type HealthInference interface { // Associate database with the raw storage SetDB(db HealthDB) // Asynchronously infer the health of a subject InferSubjectAsync(subject string) error // Infer the health of a subject InferSubject(subject string) (*pb.Inference, error) // Asynchronously infer the health of a subject that has a new report // May support incremental inference InferReportAsync(report *pb.Report) error // Infer the health of a subject that has a new report // May support incremental inference InferReport(report *pb.Report) (*pb.Inference, error) // Get the health inference of a subject GetInference(subject string) *pb.Inference // Get all the health inference for all observed subjects DumpInference() map[string]*pb.Inference // Start the inference service Start() error // Stop the inference service Stop() error }
type HealthServerConfig ¶
type HealthServerConfig struct { Addr string Id string Subjects []string Peers map[string]string // all peers' id and address FilterSubmission bool // whether to filter submitted report based on the subject id LogLevel string DumpMemUsage bool DBFile string GCConfig GarbageCollectionConfig BufConfig BufferingConfig }
type HealthStorage ¶
type HealthStorage interface { // Associate database with the raw storage SetDB(db HealthDB) // Add a subject to the observing subject list AddSubject(subject string) bool // Stop observing a particular subject, all the reports // concerning this subject will be ignored RemoveSubject(subject string, clean bool) bool // Get the list of subjects that we have observed GetSubjects() map[string]time.Time // Add a report to the view storage AddReport(report *pb.Report, filter bool) (int, error) // Get the latest report for a subject GetLatestReport(subject string) *pb.Report // Get the view from an observer about a subject GetView(observer string, subject string) *pb.View // Get the whole panorama for a subject GetPanorama(subject string) *ConcurrentPanorama // Get all the panoramas for all observed subjects DumpPanorama() map[string]*pb.Panorama // Garbage collect stale observations from panoramas // Return number of reaped observations for a subject // When relative is true, the GC is based on elapsed // time with the most recent observation rather than // the absolute time now. GC(ttl time.Duration, relative bool) map[string]uint32 }
type ObserverModule ¶
Simple tuple about the local observer that will monitor health of a component
type Registration ¶
type Registration struct { ObserverModule Handle uint64 Time time.Time }
Represents a registration to Panorama
Click to show internal directories.
Click to hide internal directories.