Documentation ¶
Index ¶
- type GeneratorCfg
- type LoadGenRunner
- type LoadProfileCfg
- type MessagePrototype
- func (m *MessagePrototype) ApplySupCfg(s SupervisorCfg)
- func (m *MessagePrototype) ApplySvcTemplate(t ServiceTemplate) error
- func (m *MessagePrototype) CreateMessage(uuid string) *habitat.HealthCheckEvent
- func (m *MessagePrototype) PkgFQID() string
- func (m *MessagePrototype) PrettyStr() string
- func (m *MessagePrototype) SetRelease()
- type RunnerConfig
- type RunnerStats
- type RunnerStatsKeeper
- func (r *RunnerStatsKeeper) FailedPublish()
- func (r *RunnerStatsKeeper) Interval() time.Duration
- func (r *RunnerStatsKeeper) Report()
- func (r *RunnerStatsKeeper) ResetCycleStats()
- func (r *RunnerStatsKeeper) RunCollectAndPrintLoop()
- func (r *RunnerStatsKeeper) SuccessfulPublish()
- func (r *RunnerStatsKeeper) SupDied()
- func (r *RunnerStatsKeeper) SupStarted()
- type ServiceTemplate
- type SiteRange
- type SupSim
- type SupervisorCfg
- type SupervisorGroup
- type SupervisorGroupCollection
- type SupervisorTemplate
- type Templates
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GeneratorCfg ¶
type GeneratorCfg struct {
Supervisors []SupervisorCfg `toml:"supervisor"`
}
[[generator.supervisor]] # SupervisorCfg one [[generator.supervisor]] # SupervisorCfg two
type LoadGenRunner ¶
type LoadGenRunner struct { SupervisorGroups SupervisorGroupCollection // contains filtered or unexported fields }
func (*LoadGenRunner) Run ¶
func (r *LoadGenRunner) Run(cfg *RunnerConfig)
type LoadProfileCfg ¶
type LoadProfileCfg struct { Templates Templates `toml:"templates"` GeneratorCfg GeneratorCfg `toml:"generator"` }
func BuiltinConfig ¶
func BuiltinConfig() (*LoadProfileCfg, error)
func BuiltinConfigFull ¶
func BuiltinConfigFull() (*LoadProfileCfg, error)
func ProfileFromFile ¶
func ProfileFromFile(path string) (*LoadProfileCfg, error)
func (*LoadProfileCfg) BuildRunner ¶
func (l *LoadProfileCfg) BuildRunner() (*LoadGenRunner, error)
func (*LoadProfileCfg) BuildSupervisorGroups ¶
func (l *LoadProfileCfg) BuildSupervisorGroups() (SupervisorGroupCollection, error)
type MessagePrototype ¶
type MessagePrototype struct { Application string Environment string Channel string Site string Origin string PkgName string Release string }
Data elements of a message that currently exist: sup-id AUTO group hardcode to "default" application assign per-service in sup template environment <name> The environment name of the current deployment health hardcode to 0 (OK) for now. status hardcode to 0 (RUNNING) for now
Package Identifier --origin parse from service name --name parse from service name --version hardcode to 1.0.0 for now --release generate from the startup time of the generator
func (*MessagePrototype) ApplySupCfg ¶
func (m *MessagePrototype) ApplySupCfg(s SupervisorCfg)
func (*MessagePrototype) ApplySvcTemplate ¶
func (m *MessagePrototype) ApplySvcTemplate(t ServiceTemplate) error
func (*MessagePrototype) CreateMessage ¶
func (m *MessagePrototype) CreateMessage(uuid string) *habitat.HealthCheckEvent
func (*MessagePrototype) PkgFQID ¶
func (m *MessagePrototype) PkgFQID() string
func (*MessagePrototype) PrettyStr ¶
func (m *MessagePrototype) PrettyStr() string
func (*MessagePrototype) SetRelease ¶
func (m *MessagePrototype) SetRelease()
type RunnerConfig ¶
type RunnerStats ¶
type RunnerStats struct {
// contains filtered or unexported fields
}
func (*RunnerStats) TotalMessages ¶
func (r *RunnerStats) TotalMessages() uint64
func (*RunnerStats) TotalRate ¶
func (r *RunnerStats) TotalRate() float64
type RunnerStatsKeeper ¶
type RunnerStatsKeeper struct {
// contains filtered or unexported fields
}
func NewStatsKeeper ¶
func NewStatsKeeper() *RunnerStatsKeeper
func (*RunnerStatsKeeper) FailedPublish ¶
func (r *RunnerStatsKeeper) FailedPublish()
func (*RunnerStatsKeeper) Interval ¶
func (r *RunnerStatsKeeper) Interval() time.Duration
func (*RunnerStatsKeeper) Report ¶
func (r *RunnerStatsKeeper) Report()
func (*RunnerStatsKeeper) ResetCycleStats ¶
func (r *RunnerStatsKeeper) ResetCycleStats()
func (*RunnerStatsKeeper) RunCollectAndPrintLoop ¶
func (r *RunnerStatsKeeper) RunCollectAndPrintLoop()
func (*RunnerStatsKeeper) SuccessfulPublish ¶
func (r *RunnerStatsKeeper) SuccessfulPublish()
func (*RunnerStatsKeeper) SupDied ¶
func (r *RunnerStatsKeeper) SupDied()
func (*RunnerStatsKeeper) SupStarted ¶
func (r *RunnerStatsKeeper) SupStarted()
type ServiceTemplate ¶
type ServiceTemplate struct { Package string `toml:"package"` Application string `toml:"application"` }
[[ service ]] package = "noms/pos-service-2"
type SupSim ¶
type SupSim struct { Name string Idx int32 Cfg *RunnerConfig UUID uuid.UUID MessagePrototypes []*MessagePrototype Stats *RunnerStatsKeeper // contains filtered or unexported fields }
func (*SupSim) PublishAll ¶
type SupervisorCfg ¶
type SupervisorCfg struct { Name string `toml:"name"` TemplateName string `toml:"template"` Count int32 `toml:"count"` Channel string `toml:"channel"` Environment string `toml:"environment"` Site string `toml:"site"` }
[[generator.supervisor]]
name = "pos_terminals:production1" template = "pos_terminal" count = 1000 channel = "production1" [site_range] format = "restaurant-prod1-%s" count = 1000
type SupervisorGroup ¶
type SupervisorGroup struct { Name string Count int32 MessagePrototypes []*MessagePrototype }
func (*SupervisorGroup) NewSup ¶
func (s *SupervisorGroup) NewSup(n int32, cfg *RunnerConfig, stats *RunnerStatsKeeper) (*SupSim, error)
func (*SupervisorGroup) PrettyStr ¶
func (s *SupervisorGroup) PrettyStr() string
func (*SupervisorGroup) Run ¶
func (s *SupervisorGroup) Run(cfg *RunnerConfig, stats *RunnerStatsKeeper)
type SupervisorGroupCollection ¶
type SupervisorGroupCollection []*SupervisorGroup
func (SupervisorGroupCollection) HealthCheckRate ¶
func (s SupervisorGroupCollection) HealthCheckRate() float64
Have to assume a default RunnerConfig.Tick of 30s here.
func (SupervisorGroupCollection) ReScaleTo ¶
func (s SupervisorGroupCollection) ReScaleTo(svcCount int32)
func (SupervisorGroupCollection) RollupStats ¶
func (s SupervisorGroupCollection) RollupStats() string
func (SupervisorGroupCollection) TotalSups ¶
func (s SupervisorGroupCollection) TotalSups() int32
func (SupervisorGroupCollection) TotalSvcs ¶
func (s SupervisorGroupCollection) TotalSvcs() int32
type SupervisorTemplate ¶
type SupervisorTemplate struct { Name string `toml:"name"` ServiceTemplates []ServiceTemplate `toml:"service"` }
name = "pos_terminal" [[ service ]] package = "noms/pos-service-1" [[ service ]] package = "noms/pos-service-2"
type Templates ¶
type Templates struct {
SupervisorTemplates []SupervisorTemplate `toml:"supervisor"`
}
[templates]
[[templates.supervisor]] # SupervisorTemplate one [[templates.supervisor]] # SupervisorTemplate two
func (Templates) GetTemplate ¶
func (ts Templates) GetTemplate(name string) *SupervisorTemplate