coWatchBenchmark

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 16 Imported by: 0

README

coWatchBenchmark

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUserManager

func NewUserManager(room *RoomUnit) *userManager

Types

type RequestedUserInfo

type RequestedUserInfo struct {
	Sid          string `json:"sid"`
	Upgrades     []int  `json:"upgrades"`
	PingInterval int    `json:"PingInterval"`
	PingTimeOut  int    `json:"PingTimeout"`
}

type Room

type Room struct {
	Name string `json:"name"`
}

type RoomManager

type RoomManager struct {
	Addr      string
	RoomSize  int
	UserSize  int
	MsgLen    int
	Frequency int
	LckRoom   sync.Mutex
	Rooms     []*RoomUnit
	Start     bool
}

func NewRoomManager

func NewRoomManager(addr string, room, user, msgLen, frequency int) *RoomManager

func (*RoomManager) GetCreatingRoomAvgDuration

func (p *RoomManager) GetCreatingRoomAvgDuration() time.Duration

return the average time consumption of all rooms which are created successfully

func (*RoomManager) GetCreatingUsersAvgDuration

func (p *RoomManager) GetCreatingUsersAvgDuration() time.Duration

func (*RoomManager) RequestRoomsFromServer

func (p *RoomManager) RequestRoomsFromServer(when string)

RoomManager is using for manage Rooms. Host, format for Host: Schema://server:port or Schema://ip:port

type RoomUnit

type RoomUnit struct {
	Host         string // server+port
	Schema       string
	Id           string // room ID
	Password     string
	PingInterval int // ws/wss
	PingTimeout  int // ws/wss
	RtcToken     string
	Users        []User //users in room
	UserManager  *userManager
	// for statistics
	ConnectionDuration time.Duration
	// contains filtered or unexported fields
}

func NewRoom

func NewRoom(host string, maximumUsers, msgLength, frequency int) *RoomUnit

/ as is

func (*RoomUnit) CreateUsers

func (p *RoomUnit) CreateUsers()

func (*RoomUnit) GetUsersAvgConnectionDuration

func (p *RoomUnit) GetUsersAvgConnectionDuration() time.Duration

return the average time consumption of all rooms which are created successfully

func (*RoomUnit) RequestServerRoom

func (p *RoomUnit) RequestServerRoom() error

type User

type User struct {
	Lw sync.Mutex // lock for writing

	ConnectionDuration time.Duration
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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