stats

package
v0.0.0-...-ab45ee7 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: AGPL-3.0 Imports: 16 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

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) IncHTTPRequest

func (c *Client) IncHTTPRequest(req string)

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)

func (*Client) SetMode

func (c *Client) SetMode(http bool)

True: only send http request counts

Jump to

Keyboard shortcuts

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