synapse

package
v0.0.0-...-9c90d3e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PingInterval           = 5 * time.Second
	PongWait               = 10 * time.Second
	WsWait                 = 10 * time.Second
	DeRegisterWaitDuration = 10 * time.Minute
	MaxMessageSize         = 4096
)

Websocket connection options

View Source
const (
	TestExecutionMode = "testExecution"
	CoverageMode      = "coverageMode"
	BuildID           = "build-id"
	Repo              = "repo"
	Mode              = "mode"
	JobID             = "job-id"
	ID                = "id"
)

const related to task mode

View Source
const (
	Alive    = "Alive"
	NotAlive = "NotAlive"
)

constant related to synapse meta

Variables

View Source
var TierOpts = map[core.Tier]Specs{
	core.Internal: {CPU: 0.5, RAM: 384},
	core.XSmall:   {CPU: 1, RAM: 2000},
	core.Small:    {CPU: 2, RAM: 4000},
	core.Medium:   {CPU: 4, RAM: 8000},
	core.Large:    {CPU: 8, RAM: 16000},
	core.XLarge:   {CPU: 16, RAM: 32000},
}

TierOpts is const map which map each tier to specs

Functions

func CheckSynpaseMinRequirement

func CheckSynpaseMinRequirement(cpu float32, ram int64) bool

CheckSynpaseMinRequirement checks if synapse has enough resources

func NewSynapseManager

func NewSynapseManager(
	ctx context.Context,
	logger lumber.Logger,
	redis core.RedisDB,
	orgStore core.OrganizationStore,
	synapseStore core.SynapseStore,
	buildStore core.BuildStore,
	repoStore core.RepoStore,
	taskStore core.TaskStore,
	taskQueueUtils core.TaskQueueUtils,
	taskQueueManager core.TaskQueueManager) core.SynapseClientManager

NewSynapseManager returns new synapseManger

func NewSynapsePoolManager

func NewSynapsePoolManager(ctx context.Context,
	logger lumber.Logger,
	redisDB core.RedisDB,
	synapseStore core.SynapseStore,
	buildStore core.BuildStore,
	repoStore core.RepoStore,
	taskStore core.TaskStore,
	taskQueueUtils core.TaskQueueUtils,
	taskQueueManager core.TaskQueueManager,
	synapseManager core.SynapseClientManager) core.SynapsePoolManager

NewSynapsePoolManager returns new synapsePool

Types

type Specs

type Specs struct {
	CPU float32
	RAM int64
}

Specs denotes system specification

func GetResources

func GetResources(tierOpts core.Tier) Specs

GetResources function to get dummy resources based on pod type

Jump to

Keyboard shortcuts

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