metrics

package
v0.7.11 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KeyMessageType, _ = tag.NewKey("message_type")
	KeyPeerID, _      = tag.NewKey("peer_id")
	// KeyInstanceID identifies a dht instance by the pointer address.
	// Useful for differentiating between different dhts that have the same peer id.
	KeyInstanceID, _ = tag.NewKey("instance_id")
)

Keys

View Source
var (
	ReceivedMessages       = stats.Int64("libp2p.io/dht/kad/received_messages", "Total number of messages received per RPC", stats.UnitDimensionless)
	ReceivedMessageErrors  = stats.Int64("libp2p.io/dht/kad/received_message_errors", "Total number of errors for messages received per RPC", stats.UnitDimensionless)
	ReceivedBytes          = stats.Int64("libp2p.io/dht/kad/received_bytes", "Total received bytes per RPC", stats.UnitBytes)
	InboundRequestLatency  = stats.Float64("libp2p.io/dht/kad/inbound_request_latency", "Latency per RPC", stats.UnitMilliseconds)
	OutboundRequestLatency = stats.Float64("libp2p.io/dht/kad/outbound_request_latency", "Latency per RPC", stats.UnitMilliseconds)
	SentMessages           = stats.Int64("libp2p.io/dht/kad/sent_messages", "Total number of messages sent per RPC", stats.UnitDimensionless)
	SentMessageErrors      = stats.Int64("libp2p.io/dht/kad/sent_message_errors", "Total number of errors for messages sent per RPC", stats.UnitDimensionless)
	SentRequests           = stats.Int64("libp2p.io/dht/kad/sent_requests", "Total number of requests sent per RPC", stats.UnitDimensionless)
	SentRequestErrors      = stats.Int64("libp2p.io/dht/kad/sent_request_errors", "Total number of errors for requests sent per RPC", stats.UnitDimensionless)
	SentBytes              = stats.Int64("libp2p.io/dht/kad/sent_bytes", "Total sent bytes per RPC", stats.UnitBytes)
)

Measures

View Source
var (
	ReceivedMessagesView = &view.View{
		Measure:     ReceivedMessages,
		TagKeys:     []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
		Aggregation: view.Count(),
	}
	ReceivedMessageErrorsView = &view.View{
		Measure:     ReceivedMessageErrors,
		TagKeys:     []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
		Aggregation: view.Count(),
	}
	ReceivedBytesView = &view.View{
		Measure:     ReceivedBytes,
		TagKeys:     []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
		Aggregation: defaultBytesDistribution,
	}
	InboundRequestLatencyView = &view.View{
		Measure:     InboundRequestLatency,
		TagKeys:     []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
		Aggregation: defaultMillisecondsDistribution,
	}
	OutboundRequestLatencyView = &view.View{
		Measure:     OutboundRequestLatency,
		TagKeys:     []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
		Aggregation: defaultMillisecondsDistribution,
	}
	SentMessagesView = &view.View{
		Measure:     SentMessages,
		TagKeys:     []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
		Aggregation: view.Count(),
	}
	SentMessageErrorsView = &view.View{
		Measure:     SentMessageErrors,
		TagKeys:     []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
		Aggregation: view.Count(),
	}
	SentRequestsView = &view.View{
		Measure:     SentRequests,
		TagKeys:     []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
		Aggregation: view.Count(),
	}
	SentRequestErrorsView = &view.View{
		Measure:     SentRequestErrors,
		TagKeys:     []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
		Aggregation: view.Count(),
	}
	SentBytesView = &view.View{
		Measure:     SentBytes,
		TagKeys:     []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
		Aggregation: defaultBytesDistribution,
	}
)

Views

DefaultViews with all views in it.

Functions

func UpsertMessageType

func UpsertMessageType(m *pb.Message) tag.Mutator

UpsertMessageType is a convenience upserts the message type of a pb.Message into the KeyMessageType.

Types

This section is empty.

Jump to

Keyboard shortcuts

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