Documentation ¶
Index ¶
- func GenerateAllGluonMetrics() []map[string]interface{}
- func GenerateAllHeartbeatMetricPermutations() []proton.ObservabilityMetric
- func GenerateAllUsedDistinctionMetricPermutations() []proton.ObservabilityMetric
- func ModifyThrottlePeriod(duration time.Duration)
- func ModifyUserMetricInterval(duration time.Duration)
- func VerifyAndParseGenericMetrics(metric map[string]interface{}) (bool, proton.ObservabilityMetric)
- type Adapter
- type DistinctionErrorTypeEnum
- type Sender
- type Service
- func (s *Service) AddDistinctMetrics(errType DistinctionErrorTypeEnum, metrics ...proton.ObservabilityMetric)
- func (s *Service) AddMetrics(metrics ...proton.ObservabilityMetric)
- func (s *Service) DeregisterUserClient(userID string)
- func (s *Service) ModifyHeartbeatInterval(duration time.Duration)
- func (s *Service) RegisterUserClient(userID string, protonClient *proton.Client, ...)
- func (s *Service) Run(settingsGetter settingsGetter)
- func (s *Service) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateAllGluonMetrics ¶ added in v3.15.0
func GenerateAllGluonMetrics() []map[string]interface{}
func GenerateAllHeartbeatMetricPermutations ¶ added in v3.14.0
func GenerateAllHeartbeatMetricPermutations() []proton.ObservabilityMetric
func GenerateAllUsedDistinctionMetricPermutations ¶ added in v3.14.0
func GenerateAllUsedDistinctionMetricPermutations() []proton.ObservabilityMetric
func ModifyThrottlePeriod ¶
ModifyThrottlePeriod - used for testing.
func ModifyUserMetricInterval ¶ added in v3.14.0
func VerifyAndParseGenericMetrics ¶ added in v3.15.0
VerifyAndParseGenericMetrics parses a metric provided as an interface into a proton.ObservabilityMetric type. It's exported as it is also used in integration tests.
Types ¶
type Adapter ¶ added in v3.15.0
type Adapter struct {
// contains filtered or unexported fields
}
func NewAdapter ¶ added in v3.15.0
func (*Adapter) AddDistinctMetrics ¶ added in v3.15.0
func (*Adapter) AddMetrics ¶ added in v3.15.0
type DistinctionErrorTypeEnum ¶ added in v3.14.0
type DistinctionErrorTypeEnum int
DistinctionErrorTypeEnum - maps to the specific error schema for which we want to send a user update.
const ( SyncError DistinctionErrorTypeEnum = iota GluonImapError GluonMessageError GluonOtherError SMTPError EventLoopError // EventLoopError - should always be kept last when inserting new keys. )
type Sender ¶ added in v3.14.0
type Sender interface { AddMetrics(metrics ...proton.ObservabilityMetric) AddDistinctMetrics(errType DistinctionErrorTypeEnum, metrics ...proton.ObservabilityMetric) }
Sender - interface maps to the observability service methods, so we can easily pass them down to relevant components.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(ctx context.Context, panicHandler async.PanicHandler) *Service
func (*Service) AddDistinctMetrics ¶ added in v3.14.0
func (s *Service) AddDistinctMetrics(errType DistinctionErrorTypeEnum, metrics ...proton.ObservabilityMetric)
AddDistinctMetrics - sends an additional metric related to the user, so we can determine what number of events come from what number of users. As the binning interval is what allows us to do this we should not send these if there are no logged-in users at that moment.
func (*Service) AddMetrics ¶ added in v3.14.0
func (s *Service) AddMetrics(metrics ...proton.ObservabilityMetric)
func (*Service) DeregisterUserClient ¶
func (*Service) ModifyHeartbeatInterval ¶ added in v3.14.0
ModifyHeartbeatInterval - should only be used for testing. Resets the heartbeat ticker.