govs

package module
v0.0.0-...-9ed681a Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2018 License: BSD-3-Clause Imports: 11 Imported by: 0

README

govs

This set of packages provide the API for communication with DPVS from Go.

install
# install golang
go get github.com/yubo/govs/cmd/govs
howto
govs -h
govs stats -t io/worker/dev/ctl [-i id]

io core information

#govs stats -t io
core_id                                   2
rx_ring_0                                 0          0
rx_ring_1                                 0          0
Rx_nic_port0_queue0                   20537       5539
Rx_nic_port1_queue1                     495        495
Rx_nic_port2_queue2                       5          5
Rx_nic_port3_queue3                       0          0
tx_nic_port0                              0          0
tx_nic_port1                           1192       1192
veth0                            Rx_packets         45 Rx_dropped          0 Tx_packets          8 Tx_dropped          0
veth1                            Rx_packets          0 Rx_dropped          0 Tx_packets       4000 Tx_dropped          0
kni_deq                          128726359132
kni_deq_err                      128726359087
  • core_id: core id
  • rx_ring_worker?: calls number of rte_ring_sp_enqueue_bulk()
  • rx_nic_port?_queue?: number of mbufs get from rte_eth_rx_burst()
  • tx_nic_port?: number of mbufs get from rte_eth_tx_burst()
  • veth?: kni dev counter
  • kni_deq: calls number of rte_ring_sc_dequeue_burst(..)
  • kni_deq_err: calls number of failed rte_ring_sc_dequeue_burst(..)
#govs stats -t worker
core      ipmiss       frag       icmp        pkt     v4sctp       ospf unknow(v4)       drop    kni_enq    kni_err        arp       ipv6     unknow
3              0          0          0          0          0          0          0          0     201277          0          0          0          0
  • core: number of worker core
  • ipmiss: number of pkts ip miss
  • frag: number of pkt is fragmented
  • icmp: number of icmp pkt
  • pkt: number of pkt
  • v4sctp: number of ipv4 sctp
  • ospf: number of ipv4 ospf
  • unknow(v4): number of unknow ipv4 protocol
  • drop: number of drop pkt
  • kni_enq: calls number of rte_ring_sp_enqueue_bulk(lp->kni_rings_out[skb->port], ...)
  • kni_err: calls number of failed rte_ring_sp_enqueue_bulk(lp->kni_rings_out[skb->port], ...)
  • arp: number of arp pkt
  • ipv6: number of ipv6 pkt
  • unknow: number of unknow L3 protocol
#govs stats -t dev
port         ipackets   opackets     ibytes     obytes    imissed    ierrors    oerrors  rx_nombuf
0              120092         70   30942493       8118          0          0          0          0
1              123517      10318   31196462     711370          0          0          0          0
  • port: number of port
  • ipackets: Total number of successfully received packets
  • opackets: Total number of successfully transmitted packets
  • ibytes: Total number of successfully received bytes.
  • obytes: Total number of successfully transmitted bytes
  • imissed: Total of RX packets dropped by the HW, * because there are no available buffer (i.e. RX queues are full)
  • ierrors: Total number of erroneous received packets
  • oerrors: Total number of failed transmitted packets
  • rx_nombuf: Total number of RX mbuf allocation failures
#govs stats -t ctl
id                seq      n_svc      state
-                   0          0          -

0                   0          0          s
  • id: number of core
  • seq: sequence number of config
  • n_svc: total number of virtual service
  • state: state of the worker, s(sync), p(pending)
AUTHOR

Written by Yu Bo.

REPORTING BUGS

Report bugs to yubo@xiaomi.com

Documentation

Overview

* Copyright 2016 Xiaomi Corporation. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. * * Authors: Yu Bo <yubo@xiaomi.com>

* Copyright 2016 Xiaomi Corporation. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. * * Authors: Yu Bo <yubo@xiaomi.com>

* Copyright 2016 Xiaomi Corporation. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. * * Authors: Yu Bo <yubo@xiaomi.com>

* Copyright 2016 Xiaomi Corporation. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. * * Authors: Yu Bo <yubo@xiaomi.com>

* Copyright 2016 Xiaomi Corporation. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. * * Authors: Yu Bo <yubo@xiaomi.com>

* Copyright 2016 Xiaomi Corporation. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. * * Authors: Yu Bo <yubo@xiaomi.com>

* Copyright 2016 Xiaomi Corporation. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. * * Authors: Yu Bo <yubo@xiaomi.com>

Index

Constants

View Source
const (
	URL = "/tmp/dpvs.sock"

	/*
	 *      IPVS Connection Flags
	 */
	VS_CONN_F_FWD_MASK   = 0x000f /* mask for the fwd methods */
	VS_CONN_F_MASQ       = 0x0000 /* masquerading/NAT */
	VS_CONN_F_LOCALNODE  = 0x0001 /* local node */
	VS_CONN_F_TUNNEL     = 0x0002 /* tunneling */
	VS_CONN_F_DROUTE     = 0x0003 /* direct routing */
	VS_CONN_F_BYPASS     = 0x0004 /* cache bypass */
	VS_CONN_F_FULLNAT    = 0x0005 /* full nat */
	VS_CONN_F_DSNAT      = 0x0008 /* dsnat flag */
	VS_CONN_F_SYNC       = 0x0020 /* entry created by sync */
	VS_CONN_F_HASHED     = 0x0040 /* hashed entry */
	VS_CONN_F_NOOUTPUT   = 0x0080 /* no output packets */
	VS_CONN_F_INACTIVE   = 0x0100 /* not established */
	VS_CONN_F_OUT_SEQ    = 0x0200 /* must do output seq adjust */
	VS_CONN_F_IN_SEQ     = 0x0400 /* must do input seq adjust */
	VS_CONN_F_SEQ_MASK   = 0x0600 /* in/out sequence mask */
	VS_CONN_F_NO_CPORT   = 0x0800 /* no client port set yet */
	VS_CONN_F_TEMPLATE   = 0x1000 /* template, not connection */
	VS_CONN_F_ONE_PACKET = 0x2000 /* forward only one packet */
	VS_CONN_F_SYNPROXY   = 0x8000 /* syn proxy flag */

	VS_SVC_F_PERSISTENT = 0x0001             /* persistent port */
	VS_SVC_F_HASHED     = 0x0002             /* hashed entry */
	VS_SVC_F_ONEPACKET  = 0x0004             /* one-packet scheduling */
	VS_SVC_F_SYNPROXY   = VS_CONN_F_SYNPROXY /* synproxy flag */
	VS_SVC_F_DSNAT      = VS_CONN_F_DSNAT    /* dsnat flag */
	VS_SVC_F_MASK       = (VS_SVC_F_PERSISTENT |
		VS_SVC_F_ONEPACKET |
		VS_SVC_F_SYNPROXY |
		VS_SVC_F_DSNAT)
)
View Source
const (
	CMD_NONE = iota
	CMD_ADD
	CMD_EDIT
	CMD_DEL
	CMD_ADDDEST
	CMD_EDITDEST
	CMD_DELDEST
	CMD_FLUSH
	CMD_LIST
	CMD_ZERO
	CMD_VERSION
	CMD_ADDLADDR
	CMD_DELLADDR
	CMD_GETLADDR
	CMD_TIMEOUT
	CMD_STATUS
	CMD_LAST
)
View Source
const (
	OPT_NONE = iota
	OPT_SERVICE
	OPT_NETMASK
	OPT_SCHEDULER
	OPT_FLAGS
	OPT_REALSERVER
	OPT_WEIGHT
	OPT_UTHRESHOLD
	OPT_LTHRESHOLD
	OPT_LADDR
	OPT_TYPE
	OPT_ID
	OPT_TIMEOUT
	OPT_CONNFLAGS
	OPT_PRINTDETAIL
	OPT_PRINTALLWORKER
	OPT_LAST
)
View Source
const (
	VS_STATS_IO = iota
	VS_STATS_WORKER
	VS_ESTATS_WORKER
	VS_STATS_DEV
	VS_STATS_CTL
	VS_STATS_MEM
	VS_STATS_IP_VS_INFO
	VS_STATS_DEBUG
)
View Source
const (
	VS_CMD_UNSPEC       = iota
	VS_CMD_NEW_SERVICE  /* add service */
	VS_CMD_SET_SERVICE  /* modify service */
	VS_CMD_DEL_SERVICE  /* delete service */
	VS_CMD_GET_SERVICE  /* get service info */
	VS_CMD_GET_SERVICES /* get services info */
	VS_CMD_NEW_DEST     /* add destination */
	VS_CMD_SET_DEST     /* modify destination */
	VS_CMD_DEL_DEST     /* delete destination */
	VS_CMD_GET_DEST     /* get destination info */
	VS_CMD_NEW_DAEMON   /* start sync daemon */
	VS_CMD_DEL_DAEMON   /* stop sync daemon */
	VS_CMD_GET_DAEMON   /* get sync daemon status */
	VS_CMD_SET_CONFIG   /* set config settings */
	VS_CMD_GET_CONFIG   /* get config settings */
	VS_CMD_SET_INFO     /* only used in GET_INFO reply */
	VS_CMD_GET_INFO     /* get general IPVS info */
	VS_CMD_ZERO         /* zero all counters and stats */
	VS_CMD_FLUSH        /* flush services and dests */
	VS_CMD_NEW_LADDR    /* add local address */
	VS_CMD_DEL_LADDR    /* del local address */
	VS_CMD_GET_LADDR    /* dump local address */

)
View Source
const (
	IPPROTO_IP      = 0   /* Dummy protocol for TCP		*/
	IPPROTO_ICMP    = 1   /* Internet Control Message Protocol	*/
	IPPROTO_IGMP    = 2   /* Internet Group Management Protocol	*/
	IPPROTO_IPIP    = 4   /* IPIP tunnels (older KA9Q tunnels use 94) */
	IPPROTO_TCP     = 6   /* Transmission Control Protocol	*/
	IPPROTO_EGP     = 8   /* Exterior Gateway Protocol		*/
	IPPROTO_PUP     = 12  /* PUP protocol				*/
	IPPROTO_UDP     = 17  /* User Datagram Protocol		*/
	IPPROTO_IDP     = 22  /* XNS IDP protocol			*/
	IPPROTO_DCCP    = 33  /* Datagram Congestion Control Protocol */
	IPPROTO_IPV6    = 41  /* IPv6-in-IPv4 tunnelling		*/
	IPPROTO_RSVP    = 46  /* RSVP protocol			*/
	IPPROTO_GRE     = 47  /* Cisco GRE tunnels (rfc 1701,1702)	*/
	IPPROTO_ESP     = 50  /* Encapsulation Security Payload protocol */
	IPPROTO_AH      = 51  /* Authentication Header protocol       */
	IPPROTO_BEETPH  = 94  /* IP option pseudo header for BEET */
	IPPROTO_PIM     = 103 /* Protocol Independent Multicast	*/
	IPPROTO_COMP    = 108 /* Compression Header protocol */
	IPPROTO_SCTP    = 132 /* Stream Control Transport Protocol	*/
	IPPROTO_UDPLITE = 136 /* UDP-Lite (RFC 3828)			*/
	IPPROTO_RAW     = 255 /* Raw IP packets			*/
)
View Source
const (
	EPERM   = 1  /* Operation not permitted */
	ENOENT  = 2  /* No such file or directory */
	ESRCH   = 3  /* No such process */
	EINTR   = 4  /* Interrupted system call */
	EIO     = 5  /* I/O error */
	ENXIO   = 6  /* No such device or address */
	E2BIG   = 7  /* Argument list too long */
	ENOEXEC = 8  /* Exec format error */
	EBADF   = 9  /* Bad file number */
	ECHILD  = 10 /* No child processes */
	EAGAIN  = 11 /* Try again */
	ENOMEM  = 12 /* Out of memory */
	EACCES  = 13 /* Permission denied */
	EFAULT  = 14 /* Bad address */
	ENOTBLK = 15 /* Block device required */
	EBUSY   = 16 /* Device or resource busy */
	EEXIST  = 17 /* File exists */
	EXDEV   = 18 /* Cross-device link */
	ENODEV  = 19 /* No such device */
	ENOTDIR = 20 /* Not a directory */
	EISDIR  = 21 /* Is a directory */
	EINVAL  = 22 /* Invalid argument */
	ENFILE  = 23 /* File table overflow */
	EMFILE  = 24 /* Too many open files */
	ENOTTY  = 25 /* Not a typewriter */
	ETXTBSY = 26 /* Text file busy */
	EFBIG   = 27 /* File too large */
	ENOSPC  = 28 /* No space left on device */
	ESPIPE  = 29 /* Illegal seek */
	EROFS   = 30 /* Read-only file system */
	EMLINK  = 31 /* Too many links */
	EPIPE   = 32 /* Broken pipe */
	EDOM    = 33 /* Math argument out of domain of func */
	ERANGE  = 34 /* Math result not representable */
	EMAX    = 34
)
View Source
const (
	VS_CTL_S_SYNC = iota
	VS_CTL_S_PENDING
	VS_CTL_S_LAST
)
View Source
const NUMBER_OF_CMD = CMD_LAST - 1
View Source
const NUMBER_OF_OPT = OPT_LAST - 1

Variables

View Source
var (
	CmdOpt   CmdOptions
	FirstCmd FirstCommand
)
View Source
var CMDNAMES = [NUMBER_OF_CMD]string{
	"add-service",
	"edit-service",
	"delete-service",
	"add-realserver",
	"edit-realserver",
	"delete-realserver",
	"flush",
	"list",
	"zero",
	"version",
	"add-localaddr",
	"del-localaddr",
	"get-localaddr",
	"timeout",
	"status",
}
View Source
var CMD_V_OPT = [NUMBER_OF_CMD][NUMBER_OF_OPT]byte{

	{'+', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
	{'+', ' ', ' ', ' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
	{'+', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
	{'+', 'x', 'x', 'x', '+', ' ', ' ', ' ', 'x', 'x', 'x', 'x', ' ', 'x', 'x'},
	{'+', 'x', 'x', 'x', '+', ' ', ' ', ' ', 'x', 'x', 'x', 'x', ' ', 'x', 'x'},
	{'+', 'x', 'x', 'x', '+', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
	{'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
	{' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' ', 'x', 'x', ' ', ' '},
	{'+', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
	{'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
	{'+', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '+', 'x', 'x', 'x', 'x', 'x', 'x'},
	{'+', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '+', 'x', 'x', 'x', 'x', 'x', 'x'},
	{' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x'},
	{'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' ', 'x', 'x', 'x'},
	{' ', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', ' ', ' ', 'x', 'x', ' ', ' '},
}
View Source
var OPTNAMES = [NUMBER_OF_OPT]string{
	"service",
	"netmask",
	"scheduler",
	"flags",
	"real-server",
	"weight",
	"u-threshold",
	"l-threshold",
	"localaddr",
	"type",
	"id",
	"timeout",
	"conn-flags",
	"print detail",
	"print all cpu worker",
}

Functions

func DecodeAddr

func DecodeAddr(s string) (string, error)

func Dest_title

func Dest_title(detail bool) string

func Laddr_title

func Laddr_title() string

func Ntohl

func Ntohl(i Be32) uint32

func Ntohs

func Ntohs(i Be16) uint16

func Parse_service

func Parse_service(o *CallOptions) error

func Svc_title

func Svc_title(detail bool) string

func Vs_close

func Vs_close()

func Vs_dial

func Vs_dial() error

Types

type Addr4

type Addr4 struct {
	Ip   Be32
	Port Be16
}

func (*Addr4) Set

func (p *Addr4) Set(value string) error

func (*Addr4) String

func (p *Addr4) String() string

type Be16

type Be16 uint16

func Htons

func Htons(i uint16) Be16

func (*Be16) Set

func (p *Be16) Set(value string) error

func (Be16) String

func (p Be16) String() string

type Be32

type Be32 uint32

func Htonl

func Htonl(i uint32) Be32

func (*Be32) Set

func (p *Be32) Set(value string) error

func (Be32) String

func (p Be32) String() string

func (*Be32) UnmarshalJSON

func (p *Be32) UnmarshalJSON(data []byte) error

type CallOptions

type CallOptions struct {
	Opt CmdOptions
}

type CmdOptions

type CmdOptions struct {
	/* status */
	Typ string
	Id  int
	/* service */
	Addr       Addr4
	Nic        uint
	Protocol   Protocol
	TCP        string
	UDP        string
	Sched_name string
	Flags      uint
	Number     int
	Timeout    uint
	Timeout_s  string
	Netmask    Be32

	/* dest */
	Dnic        uint
	Daddr       Addr4
	Conn_flags  uint
	Weight      int
	U_threshold uint
	L_threshold uint

	/* local addr */
	Lnic uint
	Lip  Be32

	/* timeout */
	Tcp_timeout     int
	Tcp_fin_timeout int
	Udp_timeout     int

	/* others opt */
	Print_detail     bool
	Print_all_worker bool
}

type Ecode

type Ecode int

func (Ecode) String

func (e Ecode) String() string

type FirstCommand

type FirstCommand struct {
	ADD      bool
	EDIT     bool
	DEL      bool
	ADDDEST  bool
	EDITDEST bool
	DELDEST  bool
	FLUSH    bool
	LIST     bool
	ZERO     bool
	USAGE    bool
	VERSION  bool
	ADDLADDR bool
	DELLADDR bool
	GETLADDR bool
	TIMEOUT  bool
	STATUS   bool
}

type Protocol

type Protocol uint8

func (*Protocol) Set

func (p *Protocol) Set(value string) error

func (*Protocol) String

func (p *Protocol) String() string

type Vs_cmd_q

type Vs_cmd_q struct {
	Cmd int
}

type Vs_cmd_r

type Vs_cmd_r struct {
	Code int
	Msg  string
}

func Set_add

func Set_add(o *CmdOptions) (*Vs_cmd_r, error)

func Set_adddest

func Set_adddest(o *CmdOptions) (*Vs_cmd_r, error)

func Set_addladdr

func Set_addladdr(o *CmdOptions) (*Vs_cmd_r, error)

func Set_del

func Set_del(o *CmdOptions) (*Vs_cmd_r, error)

func Set_deldest

func Set_deldest(o *CmdOptions) (*Vs_cmd_r, error)

func Set_delladdr

func Set_delladdr(o *CmdOptions) (*Vs_cmd_r, error)

func Set_edit

func Set_edit(o *CmdOptions) (*Vs_cmd_r, error)

func Set_editdest

func Set_editdest(o *CmdOptions) (*Vs_cmd_r, error)

func Set_flush

func Set_flush(o *CmdOptions) (*Vs_cmd_r, error)

func Set_timeout

func Set_timeout(o *CmdOptions) (*Vs_cmd_r, error)

func Set_zero

func Set_zero(o *CmdOptions) (*Vs_cmd_r, error)

func (Vs_cmd_r) String

func (r Vs_cmd_r) String() string

type Vs_dest_q

type Vs_dest_q struct {
	Cmd     int
	Service Vs_service_user
	Dest    Vs_dest_user
}

type Vs_dest_user

type Vs_dest_user struct {
	Nic         uint8
	Addr        Be32
	Port        Be16
	Conn_flags  uint
	Weight      int
	U_threshold uint32
	L_threshold uint32
}

type Vs_dest_user_r

type Vs_dest_user_r struct {
	Addr        Be32
	Port        Be16
	Conn_flags  uint
	Weight      int
	U_threshold uint32
	L_threshold uint32
	Activeconns uint32
	Inactconns  uint32
	Persistent  uint32
	Conns       uint64
	Inpkts      uint64
	Outpkts     uint64
	Inbytes     uint64
	Outbytes    uint64
}

func (Vs_dest_user_r) String

func (d Vs_dest_user_r) String() string

type Vs_estats_worker_r

type Vs_estats_worker_r struct {
	Code   int
	Msg    string
	Worker []map[string]int64
}

func Get_estats_worker

func Get_estats_worker(id int) (*Vs_estats_worker_r, error)

func (Vs_estats_worker_r) String

func (r Vs_estats_worker_r) String() (ret string)

type Vs_laddr_q

type Vs_laddr_q struct {
	Cmd     int
	Service Vs_service_user
	Laddr   Vs_laddr_user
}

type Vs_laddr_user

type Vs_laddr_user struct {
	Nic  uint8
	Addr Be32
}

type Vs_laddr_user_r

type Vs_laddr_user_r struct {
	Addr          Be32
	Conn_counts   uint32
	Port_conflict uint64
}

func (Vs_laddr_user_r) String

func (l Vs_laddr_user_r) String() string

type Vs_list_dests_r

type Vs_list_dests_r struct {
	Code  int
	Msg   string
	Dests []Vs_dest_user_r
}

func Get_dests

func Get_dests(o *CmdOptions) (*Vs_list_dests_r, error)

func (Vs_list_dests_r) String

func (r Vs_list_dests_r) String() string

type Vs_list_laddrs_r

type Vs_list_laddrs_r struct {
	Code   int
	Msg    string
	Laddrs []Vs_laddr_user_r
}

func Get_laddrs

func Get_laddrs(o *CmdOptions) (*Vs_list_laddrs_r, error)

func (Vs_list_laddrs_r) String

func (r Vs_list_laddrs_r) String() string

type Vs_list_q

type Vs_list_q struct {
	Cmd          int
	Num_services int
	Service      Vs_service_user
	Dest         Vs_dest_user
	Laddr        Vs_laddr_user
}

type Vs_list_service_r

type Vs_list_service_r struct {
	Code    int
	Msg     string
	Service Vs_service_user_r
}

func Get_service

func Get_service(o *CmdOptions) (*Vs_list_service_r, error)

func (Vs_list_service_r) String

func (r Vs_list_service_r) String() string

type Vs_list_services_r

type Vs_list_services_r struct {
	Code         int
	Msg          string
	Num_services int
	Services     []Vs_service_user_r
}

func Get_services

func Get_services(o *CmdOptions) (*Vs_list_services_r, error)

func (Vs_list_services_r) String

func (r Vs_list_services_r) String() (s string)

type Vs_service_q

type Vs_service_q struct {
	Cmd     int
	Service Vs_service_user
}

type Vs_service_user

type Vs_service_user struct {
	Nic        uint8
	Protocol   uint8
	Addr       Be32
	Port       Be16
	Sched_name string
	Flags      uint
	Timeout    uint
	Netmask    Be32
	Number     int /* max list laddr/dests */
}

type Vs_service_user_r

type Vs_service_user_r struct {
	Protocol   uint8
	Addr       Be32
	Port       Be16
	Sched_name string
	Flags      uint32
	Timeout    uint32
	Netmask    Be32
	Conns      uint64
	Inpkts     uint64
	Outpkts    uint64
	Inbytes    uint64
	Outbytes   uint64
	Num_dests  uint32
	Num_laddrs uint32
}

func (Vs_service_user_r) String

func (svc Vs_service_user_r) String() string

type Vs_stats_ctl_r

type Vs_stats_ctl_r struct {
	Code         int
	Msg          string
	Num_services int
	Seq          int
	Wait_group   int
	Workers      []struct {
		Worker_id    int
		Num_services int
		Seq          int
	}
}

func Get_stats_ctl

func Get_stats_ctl() (*Vs_stats_ctl_r, error)

func (Vs_stats_ctl_r) String

func (r Vs_stats_ctl_r) String() string

id seq n_svc state - 0 0 -

0 0 0 s

type Vs_stats_dest

type Vs_stats_dest struct {
	Addr        Be32
	Port        Be16
	Conn_flags  uint32
	Weight      int32
	U_threshold uint32
	L_threshold uint32
	Activeconns uint32
	Inactconns  uint32
	Persistent  uint32
	Conns       uint64
	Inpkts      uint64
	Outpkts     uint64
	Inbytes     uint64
	Outbytes    uint64
}

func (*Vs_stats_dest) ListDestStats

func (d *Vs_stats_dest) ListDestStats(detail bool, Coefficient uint64)

type Vs_stats_dev_entry

type Vs_stats_dev_entry struct {
	Port_id   int
	Ipackets  int64
	Opackets  int64
	Ibytes    int64
	Obytes    int64
	Imissed   int64
	Ierrors   int64
	Oerrors   int64
	Rx_nombuf int64
}

type Vs_stats_dev_r

type Vs_stats_dev_r struct {
	Code int
	Msg  string
	Dev  []Vs_stats_dev_entry
}

func Get_stats_dev

func Get_stats_dev(id int) (*Vs_stats_dev_r, error)

func (Vs_stats_dev_r) String

func (r Vs_stats_dev_r) String() string

type Vs_stats_ifa

type Vs_stats_ifa struct {
	Port_id    int
	Rx_packets int64
	Rx_dropped int64
	Tx_packets int64
	Tx_dropped int64
}

type Vs_stats_io_entry

type Vs_stats_io_entry struct {
	Core_id int

	Rx_nic_queues_port  []int32
	Rx_nic_queues_queue []int32
	Rx_nic_queues_iters []int64
	Rx_nic_queues_pkts  []int64

	Rx_rings_iters      []int64
	Rx_rings_pkts       []int64
	Rx_rings_drop_iters []int64
	Rx_rings_drop_pkts  []int64
	Rx_rings_drop_count []int64

	Tx_nic_ports_port       []int32
	Tx_nic_ports_queue      []int32
	Tx_nic_ports_iters      []int64
	Tx_nic_ports_pkts       []int64
	Tx_nic_ports_drop_iters []int64
	Tx_nic_ports_drop_pkts  []int64

	Kni []Vs_stats_ifa
}

type Vs_stats_io_r

type Vs_stats_io_r struct {
	Code int
	Msg  string
	Io   []Vs_stats_io_entry
}

func Get_stats_io

func Get_stats_io(id int) (*Vs_stats_io_r, error)

func (Vs_stats_io_r) String

func (r Vs_stats_io_r) String() string

id kni_deq kni_err k_rx rx_d tx tx_d

type Vs_stats_mem_r

type Vs_stats_mem_r struct {
	Code    int
	Msg     string
	Svc     int
	Rs      int
	Laddr   int
	Conn    int
	Sockets []struct {
		Socket_id        int
		Kni_mbuf_cnt     int
		Kni_mbuf_size    int
		Nic_mbuf_cnt     int
		Nic_mbuf_size    int
		Worker_mbuf_cnt  int
		Worker_mbuf_size int
		Svc              int
		Rs               int
		Laddr            int
		Conn             int
	}
}

func Get_stats_mem

func Get_stats_mem() (*Vs_stats_mem_r, error)

func (Vs_stats_mem_r) String

func (r Vs_stats_mem_r) String() string

type Vs_stats_q

type Vs_stats_q struct {
	Type     int
	Id       int /* worker id */
	Protocol uint8
	Addr     Be32
	Port     Be16
	Detail   uint8
}

type Vs_stats_svc

type Vs_stats_svc struct {
	Protocol    uint8
	Addr        Be32
	Port        Be16
	Sched_name  string
	Flags       uint32
	Timeout     uint32
	Netmask     Be32
	Est_timeout uint32
	Conns       uint64
	Inpkts      uint64
	Outpkts     uint64
	Inbytes     uint64
	Outbytes    uint64
	Num_dests   uint32
	Num_laddrs  uint32
	Dests       []Vs_stats_dest
}

func (*Vs_stats_svc) ListVsStats

func (svc *Vs_stats_svc) ListVsStats(detail bool, Coefficient uint64)

type Vs_stats_text_r

type Vs_stats_text_r struct {
	Code int
	Msg  string
	Text string
}

func Get_stats_debug

func Get_stats_debug() (*Vs_stats_text_r, error)

func Get_stats_vs

func Get_stats_vs(o *CmdOptions) (*Vs_stats_text_r, error)

func (*Vs_stats_text_r) Decode_handle

func (r *Vs_stats_text_r) Decode_handle() error

func (*Vs_stats_text_r) PrintVsStats

func (r *Vs_stats_text_r) PrintVsStats()

func (Vs_stats_text_r) String

func (r Vs_stats_text_r) String() string

type Vs_stats_worker_entry

type Vs_stats_worker_entry struct {
	Core_id              int
	Conns                int64
	Inpkts               int64
	Outpkts              int64
	Inbytes              int64
	Outbytes             int64
	Rings_in_iters       []int64
	Rings_in_pkts        []int64
	Rings_in_miss        []int64
	Rings_in_miss_count  []int64
	Rings_out_port       []int32
	Rings_out_iters      []int64
	Rings_out_pkts       []int64
	Rings_out_drop_iters []int64
	Rings_out_drop_pkts  []int64
	Vs_drop              []int64
}

type Vs_stats_worker_r

type Vs_stats_worker_r struct {
	Code   int
	Msg    string
	Worker []Vs_stats_worker_entry
}

func Get_stats_worker

func Get_stats_worker(id int) (*Vs_stats_worker_r, error)

func (Vs_stats_worker_r) String

func (r Vs_stats_worker_r) String() string

type Vs_timeout_q

type Vs_timeout_q struct {
	Cmd             int
	Tcp_timeout     int
	Tcp_fin_timeout int
	Udp_timeout     int
}

func (*Vs_timeout_q) Set

func (t *Vs_timeout_q) Set(value string) (err error)

type Vs_timeout_r

type Vs_timeout_r struct {
	Code            int
	Msg             string
	Tcp_timeout     int
	Tcp_fin_timeout int
	Udp_timeout     int
}

func Get_timeout

func Get_timeout(o *CmdOptions) (*Vs_timeout_r, error)

func (Vs_timeout_r) String

func (r Vs_timeout_r) String() string

type Vs_timeout_user

type Vs_timeout_user struct {
	Tcp_timeout     int
	Tcp_fin_timeout int
	Udp_timeout     int
}

type Vs_version_r

type Vs_version_r struct {
	Code    int
	Msg     string
	Version int
	Size    int
}

func Get_version

func Get_version() (*Vs_version_r, error)

func (Vs_version_r) String

func (r Vs_version_r) String() string

Directories

Path Synopsis
cmd
govs
* Copyright 2016 Xiaomi Corporation.
* Copyright 2016 Xiaomi Corporation.

Jump to

Keyboard shortcuts

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