ommonitor

package module
v0.0.0-...-3c068b5 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 12 Imported by: 0

README

ommonitor

Open Match Tickets Monitoring tool.

demo

Install

go install github.com/DeNA/ommonitor/cmd/ommonitor@latest

Usage

ommonitor connects to Open Match's Redis. For example, you can connect to Redis on Kubernetes with the kubectl port-forward command.

# port-forwarding to Redis
kubectl port-forward -n open-match svc/open-match-redis-master 6379:6379

Run ommonitor with Redis address.

# Run ommonitor
ommonitor 127.0.0.1:6379

Several options are available. See the ommonitor -h for details.

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

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

func NewMonitor

func NewMonitor(redisAddr string, client rueidis.Client, opts ...MonitorOption) *Monitor

func (*Monitor) FetchAllTickets

func (m *Monitor) FetchAllTickets(ctx context.Context, progress func(MonitorFetchProgress)) ([]Ticket, error)

func (*Monitor) RedisAddr

func (m *Monitor) RedisAddr() string

func (*Monitor) TicketCount

func (m *Monitor) TicketCount() int

type MonitorFetchProgress

type MonitorFetchProgress struct {
	State          MonitorFetchProgressState
	TicketsScanned int
	TicketsFetched int
	// --- done
	TicketsAdded   int
	TicketsExpired int
}

type MonitorFetchProgressState

type MonitorFetchProgressState string
const (
	MonitorFetchProgressStateScanning MonitorFetchProgressState = "scanning"
	MonitorFetchProgressStateFetching MonitorFetchProgressState = "fetching"
	MonitorFetchProgressStateDone     MonitorFetchProgressState = "done"
)

type MonitorOption

type MonitorOption interface {
	// contains filtered or unexported methods
}

func WithMinimatch

func WithMinimatch() MonitorOption

func WithRedisKeyPrefix

func WithRedisKeyPrefix(prefix string) MonitorOption

type MonitorOptionFunc

type MonitorOptionFunc func(options *monitorOptions)

type Ticket

type Ticket struct {
	TicketID     string
	Status       TicketStatus
	CreatedAt    time.Time
	SearchFields *pb.SearchFields
	Assignment   *pb.Assignment
	ExpiredAt    *time.Time
	Extensions   map[string]*anypb.Any
}

func (*Ticket) HasExpired

func (t *Ticket) HasExpired(now time.Time) bool

type TicketStatus

type TicketStatus string
const (
	TicketStatusActive   TicketStatus = "Active"
	TicketStatusProposed TicketStatus = "Proposed"
	TicketStatusAssigned TicketStatus = "Assigned"
)

Directories

Path Synopsis
cmd
ommonitor command

Jump to

Keyboard shortcuts

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