This commit is contained in:
parent
69e46f577a
commit
1d1a225be6
3 changed files with 21 additions and 0 deletions
|
@ -69,6 +69,9 @@ func (p *Processor) waitForApp() error {
|
|||
statsProcessor := StatsProcessor{
|
||||
DB: p.DB,
|
||||
DockerSock: p.DockerSock,
|
||||
BindIPHTTP: p.BindIPHTTP,
|
||||
BindIPSSH: p.BindIPSSH,
|
||||
AppsPath: p.AppsPath,
|
||||
}
|
||||
|
||||
for i := 0; i < loops; i++ {
|
||||
|
@ -104,6 +107,9 @@ func (p *Processor) List() (apps.Apps, error) {
|
|||
statsProcessor := StatsProcessor{
|
||||
DB: p.DB,
|
||||
DockerSock: p.DockerSock,
|
||||
BindIPHTTP: p.BindIPHTTP,
|
||||
BindIPSSH: p.BindIPSSH,
|
||||
AppsPath: p.AppsPath,
|
||||
}
|
||||
|
||||
err := statsProcessor.GatherStates()
|
||||
|
@ -128,6 +134,9 @@ func (p *Processor) Get() (apps.App, error) {
|
|||
statsProcessor := StatsProcessor{
|
||||
DB: p.DB,
|
||||
DockerSock: p.DockerSock,
|
||||
BindIPHTTP: p.BindIPHTTP,
|
||||
BindIPSSH: p.BindIPSSH,
|
||||
AppsPath: p.AppsPath,
|
||||
}
|
||||
|
||||
err := statsProcessor.UpdateState(p.AppName)
|
||||
|
|
|
@ -13,6 +13,9 @@ import (
|
|||
type StatsProcessor struct {
|
||||
DB *gorm.DB
|
||||
DockerSock string
|
||||
BindIPHTTP string
|
||||
BindIPSSH string
|
||||
AppsPath string
|
||||
}
|
||||
|
||||
// returns instance of getAppProcessor
|
||||
|
@ -36,6 +39,9 @@ func (s *StatsProcessor) UpdateUsage(name string) error {
|
|||
container := docker.Container{
|
||||
App: &app,
|
||||
DockerSock: s.DockerSock,
|
||||
BindIPHTTP: s.BindIPHTTP,
|
||||
BindIPSSH: s.BindIPSSH,
|
||||
AppsPath: s.AppsPath,
|
||||
}
|
||||
|
||||
state, err := container.GetState()
|
||||
|
@ -67,6 +73,9 @@ func (s *StatsProcessor) UpdateState(name string) error {
|
|||
container := docker.Container{
|
||||
App: &app,
|
||||
DockerSock: s.DockerSock,
|
||||
BindIPHTTP: s.BindIPHTTP,
|
||||
BindIPSSH: s.BindIPSSH,
|
||||
AppsPath: s.AppsPath,
|
||||
}
|
||||
state, err := container.Status()
|
||||
if err != nil {
|
||||
|
|
3
main.go
3
main.go
|
@ -76,6 +76,9 @@ func main() {
|
|||
statsProcessor := glue.StatsProcessor{
|
||||
DB: common.GetDBConnection(),
|
||||
DockerSock: config.DockerSocket,
|
||||
BindIPHTTP: config.AppsBindIPHTTP,
|
||||
BindIPSSH: config.AppsBindIPSSH,
|
||||
AppsPath: config.AppsPath,
|
||||
}
|
||||
|
||||
for {
|
||||
|
|
Loading…
Reference in a new issue