metrics

package
v0.275.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 8 Imported by: 18

Documentation

Index

Constants

View Source
const PublisherUnknown = "unknown"

PublisherUnknown : Default value for Labels.PubID

Variables

This section is empty.

Functions

This section is empty.

Types

type AdapterBid

type AdapterBid string

AdapterBid : Whether or not the adapter returned bids

const (
	AdapterBidPresent AdapterBid = "bid"
	AdapterBidNone    AdapterBid = "nobid"
)

Adapter bid response status.

func AdapterBids

func AdapterBids() []AdapterBid

type AdapterError

type AdapterError string

AdapterError : Errors which may have occurred during the adapter's execution

const (
	AdapterErrorBadInput            AdapterError = "badinput"
	AdapterErrorBadServerResponse   AdapterError = "badserverresponse"
	AdapterErrorTimeout             AdapterError = "timeout"
	AdapterErrorFailedToRequestBids AdapterError = "failedtorequestbid"
	AdapterErrorValidation          AdapterError = "validation"
	AdapterErrorUnknown             AdapterError = "unknown_error"
)

Adapter execution status

func AdapterErrors

func AdapterErrors() []AdapterError

type AdapterLabels

type AdapterLabels struct {
	Source        DemandSource
	RType         RequestType
	Adapter       openrtb_ext.BidderName
	PubID         string // exchange specific ID, so we cannot compile in values
	CookieFlag    CookieFlag
	AdapterBids   AdapterBid
	AdapterErrors map[AdapterError]struct{}
}

AdapterLabels defines the labels that can be attached to the adapter metrics.

type AdapterMetrics

type AdapterMetrics struct {
	NoCookieMeter      metrics.Meter
	ErrorMeters        map[AdapterError]metrics.Meter
	NoBidMeter         metrics.Meter
	GotBidsMeter       metrics.Meter
	RequestTimer       metrics.Timer
	PriceHistogram     metrics.Histogram
	BidsReceivedMeter  metrics.Meter
	PanicMeter         metrics.Meter
	MarkupMetrics      map[openrtb_ext.BidType]*MarkupDeliveryMetrics
	ConnCreated        metrics.Counter
	ConnReused         metrics.Counter
	ConnWaitTime       metrics.Timer
	GDPRRequestBlocked metrics.Meter

	BidValidationCreativeSizeErrorMeter metrics.Meter
	BidValidationCreativeSizeWarnMeter  metrics.Meter

	BidValidationSecureMarkupErrorMeter metrics.Meter
	BidValidationSecureMarkupWarnMeter  metrics.Meter
}

AdapterMetrics houses the metrics for a particular adapter

type CacheResult

type CacheResult string

CacheResult : Cache hit/miss

const (
	// CacheHit represents a cache hit i.e the key was found in cache
	CacheHit CacheResult = "hit"
	// CacheMiss represents a cache miss i.e that key wasn't found in cache
	// and had to be fetched from the backend
	CacheMiss CacheResult = "miss"
)

func CacheResults

func CacheResults() []CacheResult

CacheResults returns possible cache results i.e. cache hit or miss

type CookieFlag

type CookieFlag string

CookieFlag : User ID cookie exists flag

const (
	CookieFlagYes     CookieFlag = "exists"
	CookieFlagNo      CookieFlag = "no"
	CookieFlagUnknown CookieFlag = "unknown"
)

Cookie flag

func CookieTypes

func CookieTypes() []CookieFlag

type CookieSyncStatus added in v0.173.0

type CookieSyncStatus string

CookieSyncStatus is a status code resulting from a call to the /cookie_sync endpoint.

const (
	CookieSyncOK                     CookieSyncStatus = "ok"
	CookieSyncBadRequest             CookieSyncStatus = "bad_request"
	CookieSyncOptOut                 CookieSyncStatus = "opt_out"
	CookieSyncGDPRHostCookieBlocked  CookieSyncStatus = "gdpr_blocked_host_cookie"
	CookieSyncAccountBlocked         CookieSyncStatus = "acct_blocked"
	CookieSyncAccountConfigMalformed CookieSyncStatus = "acct_config_malformed"
	CookieSyncAccountInvalid         CookieSyncStatus = "acct_invalid"
)

func CookieSyncStatuses added in v0.173.0

func CookieSyncStatuses() []CookieSyncStatus

CookieSyncStatuses returns possible cookie sync statuses.

type DemandSource

type DemandSource string

DemandSource : Demand source enumeration

const (
	DemandWeb     DemandSource = "web"
	DemandApp     DemandSource = "app"
	DemandUnknown DemandSource = "unknown"
)

The demand sources

func DemandTypes

func DemandTypes() []DemandSource

type ImpLabels

type ImpLabels struct {
	BannerImps bool
	VideoImps  bool
	AudioImps  bool
	NativeImps bool
}

ImpLabels defines metric labels describing the impression type.

type ImpMediaType

type ImpMediaType string

ImpMediaType : Media type described in the "imp" JSON object TODO is this still needed?

const (
	ImpTypeBanner ImpMediaType = "banner"
	ImpTypeVideo  ImpMediaType = "video"
	ImpTypeAudio  ImpMediaType = "audio"
	ImpTypeNative ImpMediaType = "native"
)

The media types described in the "imp" json objects

func ImpTypes

func ImpTypes() []ImpMediaType

type Labels

type Labels struct {
	Source        DemandSource
	RType         RequestType
	PubID         string // exchange specific ID, so we cannot compile in values
	CookieFlag    CookieFlag
	RequestStatus RequestStatus
}

Labels defines the labels that can be attached to the metrics.

type MarkupDeliveryMetrics

type MarkupDeliveryMetrics struct {
	AdmMeter  metrics.Meter
	NurlMeter metrics.Meter
}

type Metrics

type Metrics struct {
	MetricsRegistry                metrics.Registry
	ConnectionCounter              metrics.Counter
	TMaxTimeoutCounter             metrics.Counter
	ConnectionAcceptErrorMeter     metrics.Meter
	ConnectionCloseErrorMeter      metrics.Meter
	ImpMeter                       metrics.Meter
	AppRequestMeter                metrics.Meter
	NoCookieMeter                  metrics.Meter
	DebugRequestMeter              metrics.Meter
	RequestTimer                   metrics.Timer
	RequestsQueueTimer             map[RequestType]map[bool]metrics.Timer
	PrebidCacheRequestTimerSuccess metrics.Timer
	PrebidCacheRequestTimerError   metrics.Timer
	StoredDataFetchTimer           map[StoredDataType]map[StoredDataFetchType]metrics.Timer
	StoredDataErrorMeter           map[StoredDataType]map[StoredDataError]metrics.Meter
	StoredReqCacheMeter            map[CacheResult]metrics.Meter
	StoredImpCacheMeter            map[CacheResult]metrics.Meter
	AccountCacheMeter              map[CacheResult]metrics.Meter
	DNSLookupTimer                 metrics.Timer
	TLSHandshakeTimer              metrics.Timer
	BidderServerResponseTimer      metrics.Timer
	StoredResponsesMeter           metrics.Meter

	// Metrics for OpenRTB requests specifically
	RequestStatuses       map[RequestType]map[RequestStatus]metrics.Meter
	AmpNoCookieMeter      metrics.Meter
	CookieSyncMeter       metrics.Meter
	CookieSyncStatusMeter map[CookieSyncStatus]metrics.Meter
	SyncerRequestsMeter   map[string]map[SyncerCookieSyncStatus]metrics.Meter
	SetUidMeter           metrics.Meter
	SetUidStatusMeter     map[SetUidStatus]metrics.Meter
	SyncerSetsMeter       map[string]map[SyncerSetUidStatus]metrics.Meter

	// Media types found in the "imp" JSON object
	ImpsTypeBanner metrics.Meter
	ImpsTypeVideo  metrics.Meter
	ImpsTypeAudio  metrics.Meter
	ImpsTypeNative metrics.Meter

	// Notification timeout metrics
	TimeoutNotificationSuccess metrics.Meter
	TimeoutNotificationFailure metrics.Meter

	// TCF adaption metrics
	PrivacyCCPARequest       metrics.Meter
	PrivacyCCPARequestOptOut metrics.Meter
	PrivacyCOPPARequest      metrics.Meter
	PrivacyLMTRequest        metrics.Meter
	PrivacyTCFRequestVersion map[TCFVersionValue]metrics.Meter

	AdapterMetrics map[openrtb_ext.BidderName]*AdapterMetrics

	// Will hold boolean values to help us disable metric collection if needed
	MetricsDisabled config.DisabledMetrics

	// AdsCert metrics
	AdsCertRequestsSuccess metrics.Meter
	AdsCertRequestsFailure metrics.Meter

	// Module metrics
	ModuleMetrics map[string]map[string]*ModuleMetrics

	OverheadTimer map[OverheadType]metrics.Timer
	// contains filtered or unexported fields
}

func NewBlankMetrics

func NewBlankMetrics(registry metrics.Registry, exchanges []openrtb_ext.BidderName, disabledMetrics config.DisabledMetrics, moduleStageNames map[string][]string) *Metrics

NewBlankMetrics creates a new Metrics object with all blank metrics object. This may also be useful for testing routines to ensure that no metrics are written anywhere.

This will be useful when removing endpoints, we can just run will the blank metrics function rather than loading metrics that never get filled. This will also eventually let us configure metrics, such as setting a limited set of metrics for a production instance, and then expanding again when we need more debugging.

func NewMetrics

func NewMetrics(registry metrics.Registry, exchanges []openrtb_ext.BidderName, disableAccountMetrics config.DisabledMetrics, syncerKeys []string, moduleStageNames map[string][]string) *Metrics

NewMetrics creates a new Metrics object with needed metrics defined. In time we may develop to the point where Metrics contains all the metrics we might want to record, and then we build the actual metrics object to contain only the metrics we are interested in. This would allow for debug mode metrics. The code would allways try to record the metrics, but effectively noop if we are using a blank meter/timer.

func (*Metrics) RecordAccountCCPAChannelEnabledWarning added in v0.244.0

func (me *Metrics) RecordAccountCCPAChannelEnabledWarning(account string)

func (*Metrics) RecordAccountCacheResult

func (me *Metrics) RecordAccountCacheResult(cacheResult CacheResult, inc int)

RecordAccountCacheResult implements a part of the MetricsEngine interface. Records the cache hits and misses when looking up accounts.

func (*Metrics) RecordAccountGDPRChannelEnabledWarning added in v0.244.0

func (me *Metrics) RecordAccountGDPRChannelEnabledWarning(account string)

func (*Metrics) RecordAccountGDPRPurposeWarning added in v0.244.0

func (me *Metrics) RecordAccountGDPRPurposeWarning(account string, purposeName string)

func (*Metrics) RecordAccountUpgradeStatus added in v0.244.0

func (me *Metrics) RecordAccountUpgradeStatus(account string)

func (*Metrics) RecordAdapterBidReceived

func (me *Metrics) RecordAdapterBidReceived(labels AdapterLabels, bidType openrtb_ext.BidType, hasAdm bool)

RecordAdapterBidReceived implements a part of the MetricsEngine interface. This tracks how many bids from each Bidder use `adm` vs. `nurl.

func (*Metrics) RecordAdapterConnections

func (me *Metrics) RecordAdapterConnections(adapterName openrtb_ext.BidderName,
	connWasReused bool,
	connWaitTime time.Duration)

Keeps track of created and reused connections to adapter bidders and the time from the connection request, to the connection creation, or reuse from the pool across all engines

func (*Metrics) RecordAdapterGDPRRequestBlocked

func (me *Metrics) RecordAdapterGDPRRequestBlocked(adapterName openrtb_ext.BidderName)

func (*Metrics) RecordAdapterPanic

func (me *Metrics) RecordAdapterPanic(labels AdapterLabels)

RecordAdapterPanic implements a part of the MetricsEngine interface

func (*Metrics) RecordAdapterPrice

func (me *Metrics) RecordAdapterPrice(labels AdapterLabels, cpm float64)

RecordAdapterPrice implements a part of the MetricsEngine interface. Generates a histogram of winning bid prices

func (*Metrics) RecordAdapterRequest

func (me *Metrics) RecordAdapterRequest(labels AdapterLabels)

RecordAdapterRequest implements a part of the MetricsEngine interface

func (*Metrics) RecordAdapterTime

func (me *Metrics) RecordAdapterTime(labels AdapterLabels, length time.Duration)

RecordAdapterTime implements a part of the MetricsEngine interface. Records the adapter response time

func (*Metrics) RecordAdsCertReq added in v0.223.0

func (me *Metrics) RecordAdsCertReq(success bool)

func (*Metrics) RecordAdsCertSignTime added in v0.223.0

func (me *Metrics) RecordAdsCertSignTime(adsCertSignTime time.Duration)

func (*Metrics) RecordBidValidationCreativeSizeError added in v0.238.0

func (me *Metrics) RecordBidValidationCreativeSizeError(adapter openrtb_ext.BidderName, pubID string)

func (*Metrics) RecordBidValidationCreativeSizeWarn added in v0.238.0

func (me *Metrics) RecordBidValidationCreativeSizeWarn(adapter openrtb_ext.BidderName, pubID string)

func (*Metrics) RecordBidValidationSecureMarkupError added in v0.238.0

func (me *Metrics) RecordBidValidationSecureMarkupError(adapter openrtb_ext.BidderName, pubID string)

func (*Metrics) RecordBidValidationSecureMarkupWarn added in v0.238.0

func (me *Metrics) RecordBidValidationSecureMarkupWarn(adapter openrtb_ext.BidderName, pubID string)

func (*Metrics) RecordBidderServerResponseTime added in v0.254.0

func (me *Metrics) RecordBidderServerResponseTime(bidderServerResponseTime time.Duration)

func (*Metrics) RecordConnectionAccept

func (me *Metrics) RecordConnectionAccept(success bool)

func (*Metrics) RecordConnectionClose

func (me *Metrics) RecordConnectionClose(success bool)

func (*Metrics) RecordCookieSync

func (me *Metrics) RecordCookieSync(status CookieSyncStatus)

RecordCookieSync implements a part of the MetricsEngine interface. Records a cookie sync request

func (*Metrics) RecordDNSTime

func (me *Metrics) RecordDNSTime(dnsLookupTime time.Duration)

func (*Metrics) RecordDebugRequest added in v0.212.0

func (me *Metrics) RecordDebugRequest(debugEnabled bool, pubID string)

func (*Metrics) RecordImps

func (me *Metrics) RecordImps(labels ImpLabels)

func (*Metrics) RecordModuleCalled added in v0.236.0

func (me *Metrics) RecordModuleCalled(labels ModuleLabels, duration time.Duration)

func (*Metrics) RecordModuleExecutionError added in v0.236.0

func (me *Metrics) RecordModuleExecutionError(labels ModuleLabels)

func (*Metrics) RecordModuleFailed added in v0.236.0

func (me *Metrics) RecordModuleFailed(labels ModuleLabels)

func (*Metrics) RecordModuleSuccessNooped added in v0.236.0

func (me *Metrics) RecordModuleSuccessNooped(labels ModuleLabels)

func (*Metrics) RecordModuleSuccessRejected added in v0.236.0

func (me *Metrics) RecordModuleSuccessRejected(labels ModuleLabels)

func (*Metrics) RecordModuleSuccessUpdated added in v0.236.0

func (me *Metrics) RecordModuleSuccessUpdated(labels ModuleLabels)

func (*Metrics) RecordModuleTimeout added in v0.236.0

func (me *Metrics) RecordModuleTimeout(labels ModuleLabels)

func (*Metrics) RecordOverheadTime added in v0.252.0

func (me *Metrics) RecordOverheadTime(overhead OverheadType, length time.Duration)

RecordOverheadTime implements a part of the MetricsEngine interface. Records the adapter overhead time

func (*Metrics) RecordPrebidCacheRequestTime

func (me *Metrics) RecordPrebidCacheRequestTime(success bool, length time.Duration)

RecordPrebidCacheRequestTime implements a part of the MetricsEngine interface. Records the amount of time taken to store the auction result in Prebid Cache.

func (*Metrics) RecordRequest

func (me *Metrics) RecordRequest(labels Labels)

RecordRequest implements a part of the MetricsEngine interface

func (*Metrics) RecordRequestPrivacy

func (me *Metrics) RecordRequestPrivacy(privacy PrivacyLabels)

func (*Metrics) RecordRequestQueueTime

func (me *Metrics) RecordRequestQueueTime(success bool, requestType RequestType, length time.Duration)

func (*Metrics) RecordRequestTime

func (me *Metrics) RecordRequestTime(labels Labels, length time.Duration)

RecordRequestTime implements a part of the MetricsEngine interface. The calling code is responsible for determining the call duration.

func (*Metrics) RecordSetUid added in v0.173.0

func (me *Metrics) RecordSetUid(status SetUidStatus)

RecordSetUid implements a part of the MetricsEngine interface. Records a set uid sync request

func (*Metrics) RecordStoredDataError

func (me *Metrics) RecordStoredDataError(labels StoredDataLabels)

RecordStoredDataError implements a part of the MetricsEngine interface

func (*Metrics) RecordStoredDataFetchTime

func (me *Metrics) RecordStoredDataFetchTime(labels StoredDataLabels, length time.Duration)

RecordStoredDataFetchTime implements a part of the MetricsEngine interface

func (*Metrics) RecordStoredImpCacheResult

func (me *Metrics) RecordStoredImpCacheResult(cacheResult CacheResult, inc int)

RecordStoredImpCacheResult implements a part of the MetricsEngine interface. Records the cache hits and misses when looking up stored impressions.

func (*Metrics) RecordStoredReqCacheResult

func (me *Metrics) RecordStoredReqCacheResult(cacheResult CacheResult, inc int)

RecordStoredReqCacheResult implements a part of the MetricsEngine interface. Records the cache hits and misses when looking up stored requests

func (*Metrics) RecordStoredResponse added in v0.219.0

func (me *Metrics) RecordStoredResponse(pubId string)

func (*Metrics) RecordSyncerRequest added in v0.173.0

func (me *Metrics) RecordSyncerRequest(key string, status SyncerCookieSyncStatus)

RecordSyncerRequest implements a part of the MetricsEngine interface. Records a cookie sync syncer request and status

func (*Metrics) RecordSyncerSet added in v0.173.0

func (me *Metrics) RecordSyncerSet(key string, status SyncerSetUidStatus)

RecordSyncerSet implements a part of the MetricsEngine interface. Records a set uid sync request and status

func (*Metrics) RecordTLSHandshakeTime

func (me *Metrics) RecordTLSHandshakeTime(tlsHandshakeTime time.Duration)

func (*Metrics) RecordTMaxTimeout added in v0.268.0

func (m *Metrics) RecordTMaxTimeout()

func (*Metrics) RecordTimeoutNotice

func (me *Metrics) RecordTimeoutNotice(success bool)

type MetricsEngine

type MetricsEngine interface {
	RecordConnectionAccept(success bool)
	RecordTMaxTimeout()
	RecordConnectionClose(success bool)
	RecordRequest(labels Labels)                           // ignores adapter. only statusOk and statusErr fom status
	RecordImps(labels ImpLabels)                           // RecordImps across openRTB2 engines that support the 'Native' Imp Type
	RecordRequestTime(labels Labels, length time.Duration) // ignores adapter. only statusOk and statusErr fom status
	RecordOverheadTime(overHead OverheadType, length time.Duration)
	RecordAdapterRequest(labels AdapterLabels)
	RecordAdapterConnections(adapterName openrtb_ext.BidderName, connWasReused bool, connWaitTime time.Duration)
	RecordDNSTime(dnsLookupTime time.Duration)
	RecordTLSHandshakeTime(tlsHandshakeTime time.Duration)
	RecordBidderServerResponseTime(bidderServerResponseTime time.Duration)
	RecordAdapterPanic(labels AdapterLabels)
	RecordAdapterBidReceived(labels AdapterLabels, bidType openrtb_ext.BidType, hasAdm bool)
	RecordAdapterPrice(labels AdapterLabels, cpm float64)
	RecordAdapterTime(labels AdapterLabels, length time.Duration)
	RecordCookieSync(status CookieSyncStatus)
	RecordSyncerRequest(key string, status SyncerCookieSyncStatus)
	RecordSetUid(status SetUidStatus)
	RecordSyncerSet(key string, status SyncerSetUidStatus)
	RecordStoredReqCacheResult(cacheResult CacheResult, inc int)
	RecordStoredImpCacheResult(cacheResult CacheResult, inc int)
	RecordAccountCacheResult(cacheResult CacheResult, inc int)
	RecordStoredDataFetchTime(labels StoredDataLabels, length time.Duration)
	RecordStoredDataError(labels StoredDataLabels)
	RecordPrebidCacheRequestTime(success bool, length time.Duration)
	RecordRequestQueueTime(success bool, requestType RequestType, length time.Duration)
	RecordTimeoutNotice(success bool)
	RecordRequestPrivacy(privacy PrivacyLabels)
	RecordAdapterGDPRRequestBlocked(adapterName openrtb_ext.BidderName)
	RecordDebugRequest(debugEnabled bool, pubId string)
	RecordStoredResponse(pubId string)
	RecordAdsCertReq(success bool)
	RecordAdsCertSignTime(adsCertSignTime time.Duration)
	RecordBidValidationCreativeSizeError(adapter openrtb_ext.BidderName, account string)
	RecordBidValidationCreativeSizeWarn(adapter openrtb_ext.BidderName, account string)
	RecordBidValidationSecureMarkupError(adapter openrtb_ext.BidderName, account string)
	RecordBidValidationSecureMarkupWarn(adapter openrtb_ext.BidderName, account string)
	RecordModuleCalled(labels ModuleLabels, duration time.Duration)
	RecordModuleFailed(labels ModuleLabels)
	RecordModuleSuccessNooped(labels ModuleLabels)
	RecordModuleSuccessUpdated(labels ModuleLabels)
	RecordModuleSuccessRejected(labels ModuleLabels)
	RecordModuleExecutionError(labels ModuleLabels)
	RecordModuleTimeout(labels ModuleLabels)
	RecordAccountGDPRPurposeWarning(account string, purposeName string)
	RecordAccountGDPRChannelEnabledWarning(account string)
	RecordAccountCCPAChannelEnabledWarning(account string)
	RecordAccountUpgradeStatus(account string)
}

MetricsEngine is a generic interface to record PBS metrics into the desired backend The first three metrics function fire off once per incoming request, so total metrics will equal the total number of incoming requests. The remaining 5 fire off per outgoing request to a bidder adapter, so will record a number of hits per incoming request. The two groups should be consistent within themselves, but comparing numbers between groups is generally not useful.

type MetricsEngineMock

type MetricsEngineMock struct {
	mock.Mock
}

MetricsEngineMock is mock for the MetricsEngine interface

func (*MetricsEngineMock) RecordAccountCCPAChannelEnabledWarning added in v0.244.0

func (me *MetricsEngineMock) RecordAccountCCPAChannelEnabledWarning(account string)

func (*MetricsEngineMock) RecordAccountCacheResult

func (me *MetricsEngineMock) RecordAccountCacheResult(cacheResult CacheResult, inc int)

RecordAccountCacheResult mock

func (*MetricsEngineMock) RecordAccountGDPRChannelEnabledWarning added in v0.244.0

func (me *MetricsEngineMock) RecordAccountGDPRChannelEnabledWarning(account string)

func (*MetricsEngineMock) RecordAccountGDPRPurposeWarning added in v0.244.0

func (me *MetricsEngineMock) RecordAccountGDPRPurposeWarning(account string, purposeName string)

func (*MetricsEngineMock) RecordAccountUpgradeStatus added in v0.244.0

func (me *MetricsEngineMock) RecordAccountUpgradeStatus(account string)

func (*MetricsEngineMock) RecordAdapterBidReceived

func (me *MetricsEngineMock) RecordAdapterBidReceived(labels AdapterLabels, bidType openrtb_ext.BidType, hasAdm bool)

RecordAdapterBidReceived mock

func (*MetricsEngineMock) RecordAdapterConnections

func (me *MetricsEngineMock) RecordAdapterConnections(bidderName openrtb_ext.BidderName, connWasReused bool, connWaitTime time.Duration)

RecordAdapterConnections mock

func (*MetricsEngineMock) RecordAdapterGDPRRequestBlocked

func (me *MetricsEngineMock) RecordAdapterGDPRRequestBlocked(adapterName openrtb_ext.BidderName)

RecordAdapterGDPRRequestBlocked mock

func (*MetricsEngineMock) RecordAdapterPanic

func (me *MetricsEngineMock) RecordAdapterPanic(labels AdapterLabels)

RecordAdapterPanic mock

func (*MetricsEngineMock) RecordAdapterPrice

func (me *MetricsEngineMock) RecordAdapterPrice(labels AdapterLabels, cpm float64)

RecordAdapterPrice mock

func (*MetricsEngineMock) RecordAdapterRequest

func (me *MetricsEngineMock) RecordAdapterRequest(labels AdapterLabels)

RecordAdapterRequest mock

func (*MetricsEngineMock) RecordAdapterTime

func (me *MetricsEngineMock) RecordAdapterTime(labels AdapterLabels, length time.Duration)

RecordAdapterTime mock

func (*MetricsEngineMock) RecordAdsCertReq added in v0.223.0

func (me *MetricsEngineMock) RecordAdsCertReq(success bool)

func (*MetricsEngineMock) RecordAdsCertSignTime added in v0.223.0

func (me *MetricsEngineMock) RecordAdsCertSignTime(adsCertSignTime time.Duration)

func (*MetricsEngineMock) RecordBidValidationCreativeSizeError added in v0.238.0

func (me *MetricsEngineMock) RecordBidValidationCreativeSizeError(adapter openrtb_ext.BidderName, account string)

func (*MetricsEngineMock) RecordBidValidationCreativeSizeWarn added in v0.238.0

func (me *MetricsEngineMock) RecordBidValidationCreativeSizeWarn(adapter openrtb_ext.BidderName, account string)

func (*MetricsEngineMock) RecordBidValidationSecureMarkupError added in v0.238.0

func (me *MetricsEngineMock) RecordBidValidationSecureMarkupError(adapter openrtb_ext.BidderName, account string)

func (*MetricsEngineMock) RecordBidValidationSecureMarkupWarn added in v0.238.0

func (me *MetricsEngineMock) RecordBidValidationSecureMarkupWarn(adapter openrtb_ext.BidderName, account string)

func (*MetricsEngineMock) RecordBidderServerResponseTime added in v0.254.0

func (me *MetricsEngineMock) RecordBidderServerResponseTime(bidderServerResponseTime time.Duration)

RecordBidderServerResponseTime mock

func (*MetricsEngineMock) RecordConnectionAccept

func (me *MetricsEngineMock) RecordConnectionAccept(success bool)

RecordConnectionAccept mock

func (*MetricsEngineMock) RecordConnectionClose

func (me *MetricsEngineMock) RecordConnectionClose(success bool)

RecordConnectionClose mock

func (*MetricsEngineMock) RecordCookieSync

func (me *MetricsEngineMock) RecordCookieSync(status CookieSyncStatus)

RecordCookieSync mock

func (*MetricsEngineMock) RecordDNSTime

func (me *MetricsEngineMock) RecordDNSTime(dnsLookupTime time.Duration)

RecordDNSTime mock

func (*MetricsEngineMock) RecordDebugRequest added in v0.212.0

func (me *MetricsEngineMock) RecordDebugRequest(debugEnabled bool, pubId string)

RecordDebugRequest mock

func (*MetricsEngineMock) RecordImps

func (me *MetricsEngineMock) RecordImps(labels ImpLabels)

RecordImps mock

func (*MetricsEngineMock) RecordModuleCalled added in v0.236.0

func (me *MetricsEngineMock) RecordModuleCalled(labels ModuleLabels, duration time.Duration)

func (*MetricsEngineMock) RecordModuleExecutionError added in v0.236.0

func (me *MetricsEngineMock) RecordModuleExecutionError(labels ModuleLabels)

func (*MetricsEngineMock) RecordModuleFailed added in v0.236.0

func (me *MetricsEngineMock) RecordModuleFailed(labels ModuleLabels)

func (*MetricsEngineMock) RecordModuleSuccessNooped added in v0.236.0

func (me *MetricsEngineMock) RecordModuleSuccessNooped(labels ModuleLabels)

func (*MetricsEngineMock) RecordModuleSuccessRejected added in v0.236.0

func (me *MetricsEngineMock) RecordModuleSuccessRejected(labels ModuleLabels)

func (*MetricsEngineMock) RecordModuleSuccessUpdated added in v0.236.0

func (me *MetricsEngineMock) RecordModuleSuccessUpdated(labels ModuleLabels)

func (*MetricsEngineMock) RecordModuleTimeout added in v0.236.0

func (me *MetricsEngineMock) RecordModuleTimeout(labels ModuleLabels)

func (*MetricsEngineMock) RecordOverheadTime added in v0.252.0

func (me *MetricsEngineMock) RecordOverheadTime(overhead OverheadType, length time.Duration)

RecordOverheadTime mock

func (*MetricsEngineMock) RecordPrebidCacheRequestTime

func (me *MetricsEngineMock) RecordPrebidCacheRequestTime(success bool, length time.Duration)

RecordPrebidCacheRequestTime mock

func (*MetricsEngineMock) RecordRequest

func (me *MetricsEngineMock) RecordRequest(labels Labels)

RecordRequest mock

func (*MetricsEngineMock) RecordRequestPrivacy

func (me *MetricsEngineMock) RecordRequestPrivacy(privacy PrivacyLabels)

RecordRequestPrivacy mock

func (*MetricsEngineMock) RecordRequestQueueTime

func (me *MetricsEngineMock) RecordRequestQueueTime(success bool, requestType RequestType, length time.Duration)

RecordRequestQueueTime mock

func (*MetricsEngineMock) RecordRequestTime

func (me *MetricsEngineMock) RecordRequestTime(labels Labels, length time.Duration)

RecordRequestTime mock

func (*MetricsEngineMock) RecordSetUid added in v0.173.0

func (me *MetricsEngineMock) RecordSetUid(status SetUidStatus)

RecordSetUid mock

func (*MetricsEngineMock) RecordStoredDataError

func (me *MetricsEngineMock) RecordStoredDataError(labels StoredDataLabels)

RecordStoredDataError mock

func (*MetricsEngineMock) RecordStoredDataFetchTime

func (me *MetricsEngineMock) RecordStoredDataFetchTime(labels StoredDataLabels, length time.Duration)

RecordStoredDataFetchTime mock

func (*MetricsEngineMock) RecordStoredImpCacheResult

func (me *MetricsEngineMock) RecordStoredImpCacheResult(cacheResult CacheResult, inc int)

RecordStoredImpCacheResult mock

func (*MetricsEngineMock) RecordStoredReqCacheResult

func (me *MetricsEngineMock) RecordStoredReqCacheResult(cacheResult CacheResult, inc int)

RecordStoredReqCacheResult mock

func (*MetricsEngineMock) RecordStoredResponse added in v0.219.0

func (me *MetricsEngineMock) RecordStoredResponse(pubId string)

func (*MetricsEngineMock) RecordSyncerRequest added in v0.173.0

func (me *MetricsEngineMock) RecordSyncerRequest(key string, status SyncerCookieSyncStatus)

RecordSyncerRequest mock

func (*MetricsEngineMock) RecordSyncerSet added in v0.173.0

func (me *MetricsEngineMock) RecordSyncerSet(key string, status SyncerSetUidStatus)

RecordSyncerSet mock

func (*MetricsEngineMock) RecordTLSHandshakeTime

func (me *MetricsEngineMock) RecordTLSHandshakeTime(tlsHandshakeTime time.Duration)

func (*MetricsEngineMock) RecordTMaxTimeout added in v0.268.0

func (me *MetricsEngineMock) RecordTMaxTimeout()

RecordTMaxTimeout mock

func (*MetricsEngineMock) RecordTimeoutNotice

func (me *MetricsEngineMock) RecordTimeoutNotice(success bool)

RecordTimeoutNotice mock

type ModuleLabels added in v0.236.0

type ModuleLabels struct {
	Module    string
	Stage     string
	AccountID string
}

type ModuleMetrics added in v0.236.0

type ModuleMetrics struct {
	DurationTimer         metrics.Timer
	CallCounter           metrics.Counter
	FailureCounter        metrics.Counter
	SuccessNoopCounter    metrics.Counter
	SuccessUpdateCounter  metrics.Counter
	SuccessRejectCounter  metrics.Counter
	ExecutionErrorCounter metrics.Counter
	TimeoutCounter        metrics.Counter
}

type OverheadType added in v0.252.0

type OverheadType string

OverheadType: overhead type enumeration

const (
	// PreBidder - measures the time needed to execute the adapter's MakeRequests() implementation, build Prebid headers and apply GZip compression if needed
	PreBidder OverheadType = "pre-bidder"
	// MakeAuctionResponse - measures the amount of time spent doing all the MakeBids() calls as well as preparing PBS's response
	MakeAuctionResponse OverheadType = "make-auction-response"
	// MakeBidderRequests - measures the time needed to fetch a stored request (if needed), parse, unmarshal, and validate the OpenRTB request, interpret its privacy policies, and split it into multiple requests sanitized for each bidder
	MakeBidderRequests OverheadType = "make-bidder-requests"
)

func OverheadTypes added in v0.252.0

func OverheadTypes() []OverheadType

func (OverheadType) String added in v0.252.0

func (t OverheadType) String() string

type PrivacyLabels

type PrivacyLabels struct {
	CCPAEnforced   bool
	CCPAProvided   bool
	COPPAEnforced  bool
	GDPREnforced   bool
	GDPRTCFVersion TCFVersionValue
	LMTEnforced    bool
}

PrivacyLabels defines metrics describing the result of privacy enforcement.

type RequestLabels

type RequestLabels struct {
	RequestStatus RequestStatus
}

RequestLabels defines metric labels describing the result of a network request.

type RequestStatus

type RequestStatus string

RequestStatus : The request return status

const (
	RequestStatusOK               RequestStatus = "ok"
	RequestStatusBadInput         RequestStatus = "badinput"
	RequestStatusErr              RequestStatus = "err"
	RequestStatusNetworkErr       RequestStatus = "networkerr"
	RequestStatusBlacklisted      RequestStatus = "blacklistedacctorapp"
	RequestStatusQueueTimeout     RequestStatus = "queuetimeout"
	RequestStatusAccountConfigErr RequestStatus = "acctconfigerr"
)

Request/return status

func RequestStatuses

func RequestStatuses() []RequestStatus

type RequestType

type RequestType string

RequestType : Request type enumeration

const (
	ReqTypeORTB2Web RequestType = "openrtb2-web"
	ReqTypeORTB2App RequestType = "openrtb2-app"
	ReqTypeAMP      RequestType = "amp"
	ReqTypeVideo    RequestType = "video"
)

The request types (endpoints)

func RequestTypes

func RequestTypes() []RequestType

type SetUidStatus added in v0.173.0

type SetUidStatus string

SetUidStatus is a status code resulting from a call to the /setuid endpoint.

const (
	SetUidOK                     SetUidStatus = "ok"
	SetUidBadRequest             SetUidStatus = "bad_request"
	SetUidOptOut                 SetUidStatus = "opt_out"
	SetUidGDPRHostCookieBlocked  SetUidStatus = "gdpr_blocked_host_cookie"
	SetUidAccountBlocked         SetUidStatus = "acct_blocked"
	SetUidAccountConfigMalformed SetUidStatus = "acct_config_malformed"
	SetUidAccountInvalid         SetUidStatus = "acct_invalid"
	SetUidSyncerUnknown          SetUidStatus = "syncer_unknown"
)

/setuid action labels

func SetUidStatuses added in v0.173.0

func SetUidStatuses() []SetUidStatus

SetUidStatuses returns possible setuid statuses.

type StoredDataError

type StoredDataError string
const (
	StoredDataErrorNetwork   StoredDataError = "network"
	StoredDataErrorUndefined StoredDataError = "undefined"
)

func StoredDataErrors

func StoredDataErrors() []StoredDataError

type StoredDataFetchType

type StoredDataFetchType string
const (
	FetchAll   StoredDataFetchType = "all"
	FetchDelta StoredDataFetchType = "delta"
)

func StoredDataFetchTypes

func StoredDataFetchTypes() []StoredDataFetchType

type StoredDataLabels

type StoredDataLabels struct {
	DataType      StoredDataType
	DataFetchType StoredDataFetchType
	Error         StoredDataError
}

type StoredDataType

type StoredDataType string
const (
	AccountDataType  StoredDataType = "account"
	AMPDataType      StoredDataType = "amp"
	CategoryDataType StoredDataType = "category"
	RequestDataType  StoredDataType = "request"
	VideoDataType    StoredDataType = "video"
	ResponseDataType StoredDataType = "response"
)

func StoredDataTypes

func StoredDataTypes() []StoredDataType

type SyncerCookieSyncStatus added in v0.173.0

type SyncerCookieSyncStatus string

SyncerCookieSyncStatus is a status code from an invocation of a syncer resulting from a call to the /cookie_sync endpoint.

const (
	SyncerCookieSyncOK               SyncerCookieSyncStatus = "ok"
	SyncerCookieSyncPrivacyBlocked   SyncerCookieSyncStatus = "privacy_blocked"
	SyncerCookieSyncAlreadySynced    SyncerCookieSyncStatus = "already_synced"
	SyncerCookieSyncTypeNotSupported SyncerCookieSyncStatus = "type_not_supported"
)

func SyncerRequestStatuses added in v0.173.0

func SyncerRequestStatuses() []SyncerCookieSyncStatus

SyncerRequestStatuses returns possible syncer statuses.

type SyncerSetUidStatus added in v0.173.0

type SyncerSetUidStatus string

SyncerSetUidStatus is a status code from an invocation of a syncer resulting from a call to the /setuid endpoint.

const (
	SyncerSetUidOK      SyncerSetUidStatus = "ok"
	SyncerSetUidCleared SyncerSetUidStatus = "cleared"
)

func SyncerSetUidStatuses added in v0.173.0

func SyncerSetUidStatuses() []SyncerSetUidStatus

SyncerSetUidStatuses returns possible syncer set statuses.

type TCFVersionValue

type TCFVersionValue string

TCFVersionValue : The possible values for TCF versions

const (
	TCFVersionErr TCFVersionValue = "err"
	TCFVersionV2  TCFVersionValue = "v2"
)

func TCFVersionToValue

func TCFVersionToValue(version int) TCFVersionValue

TCFVersionToValue takes an integer TCF version and returns the corresponding TCFVersionValue

func TCFVersions

func TCFVersions() []TCFVersionValue

TCFVersions returns the possible values for the TCF version

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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