options

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package options defines data structure for common surfacer options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	MetricsBufferSize int
	Config            *surfacerpb.SurfacerDef
	Logger            *logger.Logger
	HTTPServeMux      *http.ServeMux

	AddFailureMetric bool
	// contains filtered or unexported fields
}

Options encapsulates surfacer options common to all surfacers.

func BuildOptionsFromConfig

func BuildOptionsFromConfig(sdef *surfacerpb.SurfacerDef, l *logger.Logger) (*Options, error)

BuildOptionsFromConfig builds surfacer options using config.

func (*Options) AllowEventMetrics

func (opts *Options) AllowEventMetrics(em *metrics.EventMetrics) bool

AllowEventMetrics returns whether a certain EventMetrics should be allowed or not. TODO(manugarg): Explore if we can either log or increment some metric when we ignore an EventMetrics.

func (*Options) AllowMetric

func (opts *Options) AllowMetric(metricName string) bool

AllowMetric returns whether a certain Metric should be allowed or not.

Jump to

Keyboard shortcuts

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