metrics

package
v2.0.0-...-e570596 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndpointMetricsName

func EndpointMetricsName(method, path string) string

func LoggingName

func LoggingName(path string) string

func NormalizePath

func NormalizePath(path string) string

Types

type Client

type Client struct {
	Client api.WriteAPI

	Counts func() (guilds, channels, roles, messages int64, timeTaken time.Duration)
	// contains filtered or unexported fields
}

Client is an InfluxDB client. All exported methods on Client are safe to use even when Client is nil.

func New

func New(url, token, organization, database string) *Client

New creates a new client

func (*Client) EventHandler

func (c *Client) EventHandler(ev interface{})

EventHandler handles Arikawa events

func (*Client) IncCommand

func (c *Client) IncCommand()

IncCommand increments the command count by one

func (*Client) IncQuery

func (c *Client) IncQuery()

IncQuery increments the query count by one

func (*Client) IncRequests

func (c *Client) IncRequests(method, path string, status int)

func (*Client) RegisterEvent

func (c *Client) RegisterEvent(name string)

RegisterEvent registers an event name. Separate from EventHandler to allow us to log our own, custom events (currently: nick update + kick)

Jump to

Keyboard shortcuts

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