metrics

package
v0.1.17 Latest Latest
Warning

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

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

Documentation

Overview

Package metrics handles anonymous usage metrics reporting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reporter

type Reporter struct {
	// contains filtered or unexported fields
}

Reporter is a client that reports KNE usage events using PubSub.

func NewReporter

func NewReporter(ctx context.Context, projectID, topicID string) (*Reporter, error)

NewReporter creates a new Reporter with a PubSub client for the given project and topic.

func (*Reporter) Close

func (r *Reporter) Close() error

Close closes the Reporters underlying PubSub client and stops the underlying topic.

func (*Reporter) ReportCreateTopologyEnd

func (r *Reporter) ReportCreateTopologyEnd(ctx context.Context, id string, createErr error) error

ReportCreateTopologyEnd reports that a topology creation has ended. An error is returned if the event reporting failed.

func (*Reporter) ReportCreateTopologyStart

func (r *Reporter) ReportCreateTopologyStart(ctx context.Context, t *epb.Topology) (string, error)

ReportCreateTopologyStart reports that a topology creation has started. The UUID of the reported event is returned if the event was successfully reported. Else, an error is returned.

func (*Reporter) ReportDeployClusterEnd

func (r *Reporter) ReportDeployClusterEnd(ctx context.Context, id string, deployErr error) error

ReportDeployClusterEnd reports that a cluster deployment has ended. An error is returned if the event reporting failed.

func (*Reporter) ReportDeployClusterStart

func (r *Reporter) ReportDeployClusterStart(ctx context.Context, c *epb.Cluster) (string, error)

ReportDeployClusterStart reports that a cluster deployment has started. The UUID of the reported event is returned if the event was successfully reported. Else, an error is returned.

Jump to

Keyboard shortcuts

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