really skip scaling if equal

This commit is contained in:
Jörg Thalheim 2016-04-22 15:34:53 +00:00
parent f535fd3579
commit 5f7bcc4eb5

View File

@ -1,15 +1,16 @@
package handler package handler
import ( import (
"git.higgsboson.tk/Mic92/kapacitor-scale/scaling"
"errors" "errors"
"fmt" "fmt"
"github.com/influxdata/kapacitor/udf"
"github.com/influxdata/kapacitor/udf/agent"
"github.com/pk-rawat/gostr/src"
"log" "log"
"strconv" "strconv"
"time" "time"
"git.higgsboson.tk/Mic92/kapacitor-scale/scaling"
"github.com/influxdata/kapacitor/udf"
"github.com/influxdata/kapacitor/udf/agent"
"github.com/pk-rawat/gostr/src"
) )
type Handler struct { type Handler struct {
@ -193,6 +194,7 @@ func (h *Handler) Point(p *udf.Point) error {
} }
if to == service.CurrentInstances { if to == service.CurrentInstances {
h.debug("skip scaling service '%s' still %d", h.Id, to) h.debug("skip scaling service '%s' still %d", h.Id, to)
return nil
} }
h.debug("attempt to scale service '%s' from %d to %d", h.Id, service.CurrentInstances, to) h.debug("attempt to scale service '%s' from %d to %d", h.Id, service.CurrentInstances, to)
if !h.Simulate { if !h.Simulate {