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

Change configuration package to influxdata/config #155

Closed
wants to merge 2 commits into from
Closed
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ With #144 you can now join streams with differing group by dimensions.
- [#145](https://github.com/influxdata/kapacitor/issues/145): The InfluxDB Out Node now writes data to InfluxDB in buffers.
- [#215](https://github.com/influxdata/kapacitor/issues/215): Add performance metrics to nodes for average execution times and node throughput values.
- [#144](https://github.com/influxdata/kapacitor/issues/144): Can now join streams with differing dimensions using the join.On property.
- [#155](https://github.com/influxdata/kapacitor/pull/155): Standardized config across TICK stack.
- [#249](https://github.com/influxdata/kapacitor/issues/249): Can now use InfluxQL functions directly instead of via the MapReduce method. Example `stream.from().count()`.


Expand Down
4 changes: 2 additions & 2 deletions alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
text "text/template"
"time"

"github.com/influxdata/influxdb/influxql"
imodels "github.com/influxdata/influxdb/models"
"github.com/influxdata/kapacitor/models"
"github.com/influxdata/kapacitor/pipeline"
"github.com/influxdata/kapacitor/tick"
"github.com/influxdb/influxdb/influxql"
imodels "github.com/influxdb/influxdb/models"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"time"

"github.com/gorhill/cronexpr"
client "github.com/influxdata/influxdb/client/v2"
"github.com/influxdata/influxdb/influxql"
"github.com/influxdata/kapacitor/models"
"github.com/influxdata/kapacitor/pipeline"
client "github.com/influxdb/influxdb/client/v2"
"github.com/influxdb/influxdb/influxql"
)

type SourceBatchNode struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/kapacitord/run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"runtime"
"strconv"

"github.com/BurntSushi/toml"
cfg "github.com/influxdata/config"
"github.com/influxdata/kapacitor/services/logging"
)

Expand Down Expand Up @@ -207,7 +207,7 @@ func (cmd *Command) ParseConfig(path string) (*Config, error) {
log.Printf("Using configuration at: %s\n", path)

config := NewConfig()
if _, err := toml.DecodeFile(path, &config); err != nil {
if err := cfg.DecodeFile(path, &config); err != nil {
return nil, err
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/kapacitord/run/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import (
"github.com/influxdata/kapacitor/services/udp"
"github.com/influxdata/kapacitor/services/victorops"

"github.com/influxdb/influxdb/services/collectd"
"github.com/influxdb/influxdb/services/graphite"
"github.com/influxdb/influxdb/services/opentsdb"
"github.com/influxdata/influxdb/services/collectd"
"github.com/influxdata/influxdb/services/graphite"
"github.com/influxdata/influxdb/services/opentsdb"
)

// Config represents the configuration format for the kapacitord binary.
Expand Down
6 changes: 3 additions & 3 deletions cmd/kapacitord/run/config_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"os"

"github.com/BurntSushi/toml"
cfg "github.com/influxdata/config"
)

// PrintConfigCommand represents the command executed by "kapacitord config".
Expand Down Expand Up @@ -57,7 +57,7 @@ func (cmd *PrintConfigCommand) Run(args ...string) error {
return fmt.Errorf("%s. To generate a valid configuration file run `kapacitord config > kapacitor.generated.conf`.", err)
}

toml.NewEncoder(cmd.Stdout).Encode(config)
cfg.NewEncoder(cmd.Stdout).Encode(config)
fmt.Fprint(cmd.Stdout, "\n")

return nil
Expand All @@ -71,7 +71,7 @@ func (cmd *PrintConfigCommand) parseConfig(path string) (*Config, error) {
}

config := NewConfig()
if _, err := toml.DecodeFile(path, &config); err != nil {
if err := cfg.DecodeFile(path, &config); err != nil {
return nil, err
}
return config, nil
Expand Down
6 changes: 3 additions & 3 deletions cmd/kapacitord/run/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import (
"os"
"testing"

"github.com/BurntSushi/toml"
"github.com/influxdata/config"
"github.com/influxdata/kapacitor/cmd/kapacitord/run"
)

// Ensure the configuration can be parsed.
func TestConfig_Parse(t *testing.T) {
// Parse configuration.
var c run.Config
if _, err := toml.Decode(`
if err := config.Decode(`
[replay]
dir = "/tmp/replay"

Expand All @@ -34,7 +34,7 @@ dir = "/tmp/task"
func TestConfig_Parse_EnvOverride(t *testing.T) {
// Parse configuration.
var c run.Config
if _, err := toml.Decode(`
if err := config.Decode(`
[replay]
dir = "/tmp/replay"

Expand Down
Binary file added cmd/kapacitord/run/run.test
Binary file not shown.
10 changes: 5 additions & 5 deletions cmd/kapacitord/run/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import (
"strings"
"time"

"github.com/influxdata/influxdb/influxql"
"github.com/influxdata/influxdb/services/collectd"
"github.com/influxdata/influxdb/services/graphite"
"github.com/influxdata/influxdb/services/meta"
"github.com/influxdata/influxdb/services/opentsdb"
"github.com/influxdata/kapacitor"
"github.com/influxdata/kapacitor/services/alerta"
"github.com/influxdata/kapacitor/services/deadman"
Expand All @@ -33,11 +38,6 @@ import (
"github.com/influxdata/kapacitor/services/udp"
"github.com/influxdata/kapacitor/services/victorops"
"github.com/influxdata/kapacitor/wlog"
"github.com/influxdb/influxdb/influxql"
"github.com/influxdb/influxdb/services/collectd"
"github.com/influxdb/influxdb/services/graphite"
"github.com/influxdb/influxdb/services/meta"
"github.com/influxdb/influxdb/services/opentsdb"
"github.com/twinj/uuid"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/kapacitord/run/server_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
"testing"
"time"

client "github.com/influxdata/influxdb/client/v2"
"github.com/influxdata/kapacitor"
"github.com/influxdata/kapacitor/cmd/kapacitord/run"
"github.com/influxdata/kapacitor/services/task_store"
"github.com/influxdata/kapacitor/wlog"
client "github.com/influxdb/influxdb/client/v2"
)

// Server represents a test wrapper for run.Server.
Expand Down
16 changes: 8 additions & 8 deletions cmd/kapacitord/run/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import (
"testing"
"time"

"github.com/influxdata/config"
client "github.com/influxdata/influxdb/client/v2"
"github.com/influxdata/influxdb/influxql"
"github.com/influxdata/influxdb/models"
"github.com/influxdata/kapacitor"
"github.com/influxdata/kapacitor/cmd/kapacitord/run"
"github.com/influxdata/kapacitor/services/udf"
client "github.com/influxdb/influxdb/client/v2"
"github.com/influxdb/influxdb/influxql"
"github.com/influxdb/influxdb/models"
"github.com/influxdb/influxdb/toml"
)

func TestServer_Ping(t *testing.T) {
Expand Down Expand Up @@ -792,7 +792,7 @@ func TestServer_UDFStreamAgents(t *testing.T) {
},
config: udf.FunctionConfig{
Prog: filepath.Join(tdir, "movavg"),
Timeout: toml.Duration(time.Minute),
Timeout: config.Duration(time.Minute),
},
},
// Python
Expand All @@ -801,7 +801,7 @@ func TestServer_UDFStreamAgents(t *testing.T) {
config: udf.FunctionConfig{
Prog: "python2",
Args: []string{"-u", filepath.Join(udfDir, "agent/examples/moving_avg/moving_avg.py")},
Timeout: toml.Duration(time.Minute),
Timeout: config.Duration(time.Minute),
Env: map[string]string{
"PYTHONPATH": strings.Join(
[]string{filepath.Join(udfDir, "agent/py"), os.Getenv("PYTHONPATH")},
Expand Down Expand Up @@ -954,7 +954,7 @@ func TestServer_UDFBatchAgents(t *testing.T) {
},
config: udf.FunctionConfig{
Prog: filepath.Join(tdir, "outliers"),
Timeout: toml.Duration(time.Minute),
Timeout: config.Duration(time.Minute),
},
},
// Python
Expand All @@ -963,7 +963,7 @@ func TestServer_UDFBatchAgents(t *testing.T) {
config: udf.FunctionConfig{
Prog: "python2",
Args: []string{"-u", filepath.Join(udfDir, "agent/examples/outliers/outliers.py")},
Timeout: toml.Duration(time.Minute),
Timeout: config.Duration(time.Minute),
Env: map[string]string{
"PYTHONPATH": strings.Join(
[]string{filepath.Join(udfDir, "agent/py"), os.Getenv("PYTHONPATH")},
Expand Down
4 changes: 2 additions & 2 deletions http_out.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"path"
"sync"

"github.com/influxdata/influxdb/influxql"
imodels "github.com/influxdata/influxdb/models"
"github.com/influxdata/kapacitor/models"
"github.com/influxdata/kapacitor/pipeline"
"github.com/influxdata/kapacitor/services/httpd"
"github.com/influxdb/influxdb/influxql"
imodels "github.com/influxdb/influxdb/models"
)

type HTTPOutNode struct {
Expand Down
2 changes: 1 addition & 1 deletion influxdb_out.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"sync"
"time"

client "github.com/influxdata/influxdb/client/v2"
"github.com/influxdata/kapacitor/models"
"github.com/influxdata/kapacitor/pipeline"
client "github.com/influxdb/influxdb/client/v2"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion integrations/batcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"testing"
"time"

imodels "github.com/influxdata/influxdb/models"
"github.com/influxdata/kapacitor"
"github.com/influxdata/kapacitor/clock"
"github.com/influxdata/kapacitor/wlog"
imodels "github.com/influxdb/influxdb/models"
)

func TestBatch_Derivative(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions integrations/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"reflect"
"time"

client "github.com/influxdata/influxdb/client/v2"
"github.com/influxdata/influxdb/influxql"
"github.com/influxdata/kapacitor"
"github.com/influxdata/kapacitor/wlog"
client "github.com/influxdb/influxdb/client/v2"
"github.com/influxdb/influxdb/influxql"
)

type MockInfluxDBService struct {
Expand Down
6 changes: 3 additions & 3 deletions integrations/streamer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import (
"text/template"
"time"

"github.com/influxdata/influxdb/client"
"github.com/influxdata/influxdb/influxql"
imodels "github.com/influxdata/influxdb/models"
"github.com/influxdata/kapacitor"
"github.com/influxdata/kapacitor/clock"
cmd_test "github.com/influxdata/kapacitor/command/test"
Expand All @@ -31,9 +34,6 @@ import (
"github.com/influxdata/kapacitor/services/victorops"
"github.com/influxdata/kapacitor/udf"
"github.com/influxdata/kapacitor/wlog"
"github.com/influxdb/influxdb/client"
"github.com/influxdb/influxdb/influxql"
imodels "github.com/influxdb/influxdb/models"
)

var httpService *httpd.Service
Expand Down
2 changes: 1 addition & 1 deletion join.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"sync"
"time"

"github.com/influxdata/influxdb/influxql"
"github.com/influxdata/kapacitor/expvar"
"github.com/influxdata/kapacitor/models"
"github.com/influxdata/kapacitor/pipeline"
"github.com/influxdata/kapacitor/timer"
"github.com/influxdb/influxdb/influxql"
)

type JoinNode struct {
Expand Down
4 changes: 2 additions & 2 deletions models/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"sort"
"time"

client "github.com/influxdb/influxdb/client/v2"
"github.com/influxdb/influxdb/models"
client "github.com/influxdata/influxdb/client/v2"
"github.com/influxdata/influxdb/models"
)

// A point in batch, similar to Point but most information is
Expand Down
2 changes: 1 addition & 1 deletion models/point.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sort"
"time"

"github.com/influxdb/influxdb/models"
"github.com/influxdata/influxdb/models"
)

type GroupID string
Expand Down
2 changes: 1 addition & 1 deletion query.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"time"

"github.com/influxdata/influxdb/influxql"
"github.com/influxdata/kapacitor/tick"
"github.com/influxdb/influxdb/influxql"
)

type Query struct {
Expand Down
2 changes: 1 addition & 1 deletion replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"io"
"time"

dbmodels "github.com/influxdata/influxdb/models"
"github.com/influxdata/kapacitor/clock"
"github.com/influxdata/kapacitor/models"
dbmodels "github.com/influxdb/influxdb/models"
)

// Replay engine that can replay static data sets against a specific executor and its tasks.
Expand Down
2 changes: 1 addition & 1 deletion result.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io/ioutil"
"time"

"github.com/influxdb/influxdb/influxql"
"github.com/influxdata/influxdb/influxql"
)

// The result from an output.
Expand Down
14 changes: 7 additions & 7 deletions services/deadman/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package deadman
import (
"time"

"github.com/influxdb/influxdb/toml"
"github.com/influxdata/config"
)

const (
// Default deadman's switch interval
DefaultInterval = toml.Duration(time.Second * 10)
DefaultInterval = config.Duration(time.Second * 10)
// Default deadman's switch threshold
DefaultThreshold = float64(0)
// Default deadman's switch id
Expand All @@ -18,11 +18,11 @@ const (
)

type Config struct {
Interval toml.Duration `toml:"interval"`
Threshold float64 `toml:"threshold"`
Id string `toml:"id"`
Message string `toml:"message"`
Global bool `toml:"global"`
Interval config.Duration `toml:"interval"`
Threshold float64 `toml:"threshold"`
Id string `toml:"id"`
Message string `toml:"message"`
Global bool `toml:"global"`
}

func NewConfig() Config {
Expand Down
2 changes: 1 addition & 1 deletion services/httpd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package httpd
import (
"time"

"github.com/influxdb/influxdb/toml"
"github.com/influxdata/influxdb/toml"
)

const (
Expand Down
Loading