Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Polling App Metrics & Autoscaling #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
email = "[email protected]"
login = "atosatto"

[people.jnardiello]
name = "Jacopo Nardiello"
email = "[email protected]"
login = "jnardiello"

[people.fntlnz]
name = "Fontana Lorenzo"
email = "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion container/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

type Backend interface {
Monitor(eventsChan chan<- event.Event, errChan chan<- error)
Exec(actionsChan chan<- action.Action, errChan chan<- error)
Exec(actionsChan <-chan action.Action, errChan chan<- error)
}

func NewBackend(name string, c config.BackendConfig) (Backend, error) {
Expand Down
2 changes: 1 addition & 1 deletion container/backend/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ func (d *Docker) Monitor(eventsChan chan<- kevent.Event, errChan chan<- error) {
}
}

func (d *Docker) Exec(actionsChan chan<- kaction.Action, errChan chan<- error) {
func (d *Docker) Exec(actionsChan <-chan kaction.Action, errChan chan<- error) {
log.Debug("[Docker][Exec] Start")
}
12 changes: 6 additions & 6 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ package engine
import (
log "github.com/Sirupsen/logrus"
"github.com/opsfactory/kappa/container/action"
"github.com/opsfactory/kappa/container/backend"
containerBackend "github.com/opsfactory/kappa/container/backend"
"github.com/opsfactory/kappa/container/event"
)

type Engine struct {
backend backend.Backend
containerBackend containerBackend.Backend
}

func NewEngine(b backend.Backend) *Engine {
return &Engine{backend: b}
func NewEngine(b containerBackend.Backend) *Engine {
return &Engine{containerBackend: b}
}

func (e Engine) Run() error {
Expand All @@ -21,8 +21,8 @@ func (e Engine) Run() error {
eventsChan := make(chan event.Event)
actionsChan := make(chan action.Action)

go e.backend.Monitor(eventsChan, errChan)
go e.backend.Exec(actionsChan, errChan)
go e.containerBackend.Monitor(eventsChan, errChan)
go e.containerBackend.Exec(actionsChan, errChan)
go e.handleEvent(eventsChan, actionsChan, errChan)

for err := range errChan {
Expand Down