aggregator

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountersFromEventData

func CountersFromEventData(data []byte) ([]string, int64, error)

CountersFromEventData parses an event body and generates the Redis counters to increment for it

func ParseTimestamp

func ParseTimestamp(id string) (int64, error)

ParseTimestamp extracts the event timestamp from an event ID

func RecordLag

func RecordLag(id string)

RecordLag parses the timestamp from a event ID and observes the lag as Prometheus metrics

Types

type Length

type Length struct {
	New int64 `json:"new,omitempty"`
	Old int64 `json:"old,omitempty"`
}

Length comment

type MediawikiRecentchange

type MediawikiRecentchange struct {
	ID                   int64                  `json:"id,omitempty"`
	Meta                 *Meta                  `json:"meta"`
	Schema               string                 `json:"$schema"`
	AdditionalProperties map[string]interface{} `json:"-,omitempty"`
	Timestamp            int                    `json:"timestamp,omitempty"`
	Wiki                 string                 `json:"wiki,omitempty"`

	Bot     bool    `json:"bot,omitempty"`
	Comment string  `json:"comment,omitempty"`
	Length  *Length `json:"length,omitempty"`

	LogAction        string      `json:"log_action,omitempty"`
	LogActionComment interface{} `json:"log_action_comment,omitempty"`
	LogID            interface{} `json:"log_id,omitempty"`
	LogParams        interface{} `json:"log_params,omitempty"`
	LogType          interface{} `json:"log_type,omitempty"`

	Minor         bool      `json:"minor,omitempty"`
	Namespace     int       `json:"namespace,omitempty"`
	Parsedcomment string    `json:"parsedcomment,omitempty"`
	Patrolled     bool      `json:"patrolled,omitempty"`
	Revision      *Revision `json:"revision,omitempty"`

	ServerName       string `json:"server_name,omitempty"`
	ServerScriptPath string `json:"server_script_path,omitempty"`
	ServerURL        string `json:"server_url,omitempty"`

	Title string `json:"title,omitempty"`
	Type  string `json:"type,omitempty"`
	User  string `json:"user,omitempty"`
}

MediawikiRecentchange comment

type Meta

type Meta struct {
	Domain    string `json:"domain,omitempty"`
	DateTime  string `json:"dt"`
	ID        string `json:"id"`
	RequestID string `json:"request_id,omitempty"`
	Stream    string `json:"stream"`
	URI       string `json:"uri,omitempty"`
}

Meta comment

type Revision

type Revision struct {
	New interface{} `json:"new,omitempty"`
	Old interface{} `json:"old,omitempty"`
}

Revision comment

type Server

type Server interface {
	Start() error
	Stop()
}

Server consumes events from filesystem or kafka, then calculates aggregate stats and stores them in redis

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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