client

package
v0.0.0-...-d59e0d2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2017 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Requests chan *PinbaRequests
	// contains filtered or unexported fields
}

Client is net.Conn wrapper for reading data from pinba-collector

func New

func New(addr string, connectTimeout, readTimeout time.Duration) (*Client, error)

New validates given address and creates new Client

func (*Client) Listen

func (c *Client) Listen(interval int64)

Listen will read all data from socket into buffer, and will flush it to internal channel for processing with given interval

type PinbaRequests

type PinbaRequests struct {
	Timestamp int64
	Requests  []*pinba.Request
}

PinbaRequests struct holds slice of decoded Request's and timestamp, when they were collected

func NewPinbaRequests

func NewPinbaRequests(timestamp int64, data io.Reader) (*PinbaRequests, error)

NewPinbaRequests will read and decode requests for given timestamp

type ServerMessage

type ServerMessage struct {
	Timestamp int64
	Data      bytes.Buffer
	// contains filtered or unexported fields
}

ServerMessage is struct to read and "decode" pinba-collector (server) messages

func (*ServerMessage) ReadFrom

func (message *ServerMessage) ReadFrom(r io.Reader) error

ReadFrom will read message from given io.Reader and "extract" from it timestamp and raw byte data of pinba requests for this timestamp

Jump to

Keyboard shortcuts

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