transactioncounter

package
v0.0.0-...-d8b4333 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2018 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointAbsCounter

type EndpointAbsCounter struct {
	Counts  uint64 `json:"count,omitempty"`
	Bytes   uint64 `json:"bytes"`
	Packets uint64 `json:"packets"`
	Role    string `json:"role,omitempty"`
}

type EndpointCounter

type EndpointCounter struct {
	Counts  float64 `json:"count,omitempty"`
	Bytes   float64 `json:"bytes"`
	Packets float64 `json:"packets"`
	Role    string  `json:"role,omitempty"`
}

type Transaction

type Transaction struct {
	ServiceId           string                        `json:"serviceID,omitempty"`
	EndpointsCounterMap map[string]EndpointCounter    `json:"endpointCounter,omitempty"`
	EpCountAbs          map[string]EndpointAbsCounter `json:"endpointAbs,omitempty"`
}

func (*Transaction) GetEndpointsCounterMap

func (this *Transaction) GetEndpointsCounterMap() map[string]EndpointCounter

type TransactionCounter

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

func NewTransactionCounter

func NewTransactionCounter(conntrack *conntrack.ConnTrack) *TransactionCounter

func (*TransactionCounter) Count

func (tc *TransactionCounter) Count(infos []*countInfo)

Increment the transaction count for a single endpoint. Transaction counter map uses serviceName as key and endpoint map as value. In endpoint map, key is endpoint IP address, value is the number of transaction happened on the endpoint.

func (*TransactionCounter) GetAllTransactions

func (tc *TransactionCounter) GetAllTransactions() []*Transaction

func (*TransactionCounter) OnEndpointsUpdate

func (this *TransactionCounter) OnEndpointsUpdate(allEndpoints []api.Endpoints)

Implement k8s.io/pkg/proxy/config/EndpointsConfigHandler Interface.

func (*TransactionCounter) ProcessConntrackConnections

func (this *TransactionCounter) ProcessConntrackConnections()

Get all the current Established TCP connections from conntrack and add count to transaction counter.

func (*TransactionCounter) Reset

func (tc *TransactionCounter) Reset()

Clear the transaction counter map.

Jump to

Keyboard shortcuts

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