From 919bcb370fa00b5f37d09b9031a199672880860b Mon Sep 17 00:00:00 2001 From: jeffail Date: Fri, 20 Jul 2018 15:35:56 +0100 Subject: [PATCH] Remove redundant parts field from http --- config/everything.yaml | 1 - config/processors/http.json | 1 - config/processors/http.yaml | 1 - docs/processors/README.md | 1 - lib/processor/http.go | 14 -------------- 5 files changed, 18 deletions(-) diff --git a/config/everything.yaml b/config/everything.yaml index 3ed507999d..c490163b35 100644 --- a/config/everything.yaml +++ b/config/everything.yaml @@ -319,7 +319,6 @@ pipeline: parts: - 0 http: - parts: [] request: url: http://localhost:4195/post verb: POST diff --git a/config/processors/http.json b/config/processors/http.json index 6c855e2289..8b98c477f5 100644 --- a/config/processors/http.json +++ b/config/processors/http.json @@ -22,7 +22,6 @@ { "type": "http", "http": { - "parts": [], "request": { "backoff_on": [ 429 diff --git a/config/processors/http.yaml b/config/processors/http.yaml index 89fe73f71c..f1e4870887 100644 --- a/config/processors/http.yaml +++ b/config/processors/http.yaml @@ -17,7 +17,6 @@ pipeline: processors: - type: http http: - parts: [] request: backoff_on: - 429 diff --git a/docs/processors/README.md b/docs/processors/README.md index f6d89dea0c..f9885c5ba2 100644 --- a/docs/processors/README.md +++ b/docs/processors/README.md @@ -383,7 +383,6 @@ the last element with be selected, and so on. ``` yaml type: http http: - parts: [] request: backoff_on: - 429 diff --git a/lib/processor/http.go b/lib/processor/http.go index b93f697a58..8123aaa964 100644 --- a/lib/processor/http.go +++ b/lib/processor/http.go @@ -59,14 +59,12 @@ can use the ` + "[`process_map`](#process_map)" + ` or // HTTPConfig contains any configuration for the HTTP processor. type HTTPConfig struct { - Parts []int `json:"parts" yaml:"parts"` Client client.Config `json:"request" yaml:"request"` } // NewHTTPConfig returns a HTTPConfig with default values. func NewHTTPConfig() HTTPConfig { return HTTPConfig{ - Parts: []int{}, Client: client.NewConfig(), } } @@ -76,7 +74,6 @@ func NewHTTPConfig() HTTPConfig { // HTTP is a processor that executes HTTP queries on a message part and // replaces the contents with the result. type HTTP struct { - parts []int client *client.Type conf Config @@ -95,7 +92,6 @@ func NewHTTP( conf Config, mgr types.Manager, log log.Modular, stats metrics.Type, ) (Type, error) { g := &HTTP{ - parts: conf.HTTP.Parts, conf: conf, log: log.NewModule(".processor.http"), @@ -121,16 +117,6 @@ func NewHTTP( func (h *HTTP) ProcessMessage(msg types.Message) ([]types.Message, types.Response) { h.mCount.Incr(1) - newMsg := msg.ShallowCopy() - - targetParts := h.parts - if len(targetParts) == 0 { - targetParts = make([]int, newMsg.Len()) - for i := range targetParts { - targetParts[i] = i - } - } - responseMsg, err := h.client.Send(msg) if err != nil { h.mErr.Incr(1)