Documentation ¶
Index ¶
- Constants
- Variables
- func GetCurrentDir() string
- func InstanceDiscovery() error
- func NewConsulResolver(c *consulapi.Client, service string) naming.Resolver
- func NewZipkinReporter() reporter.Reporter
- func NewZipkinSpanFromCtx(ctx context.Context, f zipkinTracerFunc) (span zipkingo.Span, newCtx context.Context, err error)
- func NewZipkinTracer(opts ...zipkingo.TracerOption) (*zipkingo.Tracer, error)
- func SetPid(curPath string) int
- type FieldsFunc
- type LogFields
- type Metrics
- type ZipkinTag
Constants ¶
View Source
const ( ZIPKIN_OPTION_TAG = 1 + iota ZIPKIN_OPTION_ANNOTATE )
Variables ¶
View Source
var ( // server ErrHandshake = errors.New("handshake failed") ErrOperation = errors.New("request operation not valid") // ring ErrRingEmpty = errors.New("ring buffer empty") ErrRingFull = errors.New("ring buffer full") // timer ErrTimerFull = errors.New("timer full") ErrTimerEmpty = errors.New("timer empty") ErrTimerNoItem = errors.New("timer item not exist") // channel ErrPushMsgArg = errors.New("rpc pushmsg arg error") ErrPushMsgsArg = errors.New("rpc pushmsgs arg error") ErrMPushMsgArg = errors.New("rpc mpushmsg arg error") ErrMPushMsgsArg = errors.New("rpc mpushmsgs arg error") // bucket ErrBroadCastArg = errors.New("rpc broadcast arg error") ErrBroadCastRoomArg = errors.New("rpc broadcast room arg error") // room ErrRoomDroped = errors.New("room droped") // rpc ErrLogic = errors.New("logic rpc is not available") )
.
View Source
var ( Conf *conf.Config Logger logger StatMetrics *Metrics )
View Source
var ServiceRegistrar *consulsd.Registrar
View Source
var ServiceResolver naming.Resolver
Functions ¶
func GetCurrentDir ¶
func GetCurrentDir() string
func InstanceDiscovery ¶
func InstanceDiscovery() error
func NewConsulResolver ¶
func NewZipkinReporter ¶
func NewZipkinSpanFromCtx ¶
func NewZipkinTracer ¶
func NewZipkinTracer(opts ...zipkingo.TracerOption) (*zipkingo.Tracer, error)
Types ¶
type FieldsFunc ¶
type FieldsFunc func() *LogFields
type LogFields ¶
type LogFields struct {
// contains filtered or unexported fields
}
func NewLogFields ¶
func NewLogFields() *LogFields
type Metrics ¶
type Metrics struct { // online Online metrics.Gauge TcpOnline metrics.Gauge WsOnline metrics.Gauge // messages AllMsg metrics.Counter PushMsg metrics.Counter BroadcastMsg metrics.Counter BroadcastRoomMsg metrics.Counter //speed SpeedMsgSecond metrics.Gauge // buckets BucketChannels metrics.Histogram BucketRooms metrics.Histogram }
func MetricsInstrumenting ¶
func MetricsInstrumenting() *Metrics
func (*Metrics) DecrTcpOnline ¶
func (s *Metrics) DecrTcpOnline()
func (*Metrics) DecrWsOnline ¶
func (s *Metrics) DecrWsOnline()
func (*Metrics) IncrBroadcastMsg ¶
func (s *Metrics) IncrBroadcastMsg()
func (*Metrics) IncrBroadcastRoomMsg ¶
func (s *Metrics) IncrBroadcastRoomMsg()
func (*Metrics) IncrPushMsg ¶
func (s *Metrics) IncrPushMsg()
func (*Metrics) IncrTcpOnline ¶
func (s *Metrics) IncrTcpOnline()
func (*Metrics) IncrWsOnline ¶
func (s *Metrics) IncrWsOnline()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.