serverstore

package
v0.52.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package serverstore implements storing logic for fakeintake server Stores raw payloads and try parsing known payloads dumping them to json

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRouteHandled

func IsRouteHandled(route string) bool

IsRouteHandled checks if a route is handled by the Datadog parsed store

Types

type Store

type Store struct {
	NbPayloads *prometheus.GaugeVec
	// contains filtered or unexported fields
}

Store implements a thread-safe storage for raw and json dumped payloads

func NewStore

func NewStore() *Store

NewStore initialise a new payloads store

func (*Store) AppendPayload

func (s *Store) AppendPayload(route string, data []byte, encoding string, collectTime time.Time) error

AppendPayload adds a payload to the store and tries parsing and adding a dumped json to the parsed store

func (*Store) CleanUpPayloadsOlderThan

func (s *Store) CleanUpPayloadsOlderThan(time time.Time)

CleanUpPayloadsOlderThan removes payloads older than time

func (*Store) Flush

func (s *Store) Flush()

Flush cleans up any stored payload

func (*Store) GetJSONPayloads

func (s *Store) GetJSONPayloads(route string) (payloads []api.ParsedPayload)

GetJSONPayloads returns payloads collected and parsed to json for route `route`

func (*Store) GetRawPayloads

func (s *Store) GetRawPayloads(route string) (payloads []api.Payload)

GetRawPayloads returns payloads collected for route `route`

func (*Store) GetRouteStats

func (s *Store) GetRouteStats() map[string]int

GetRouteStats returns stats on collectedraw payloads by route

Jump to

Keyboard shortcuts

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