Skip to content

Commit

Permalink
Fix typos and linter
Browse files Browse the repository at this point in the history
  • Loading branch information
rdner committed Jan 15, 2025
1 parent 9cc2b16 commit 1f497a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
2 changes: 1 addition & 1 deletion filebeat/input/container/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
)

var (
errDeprecated = errors.New("Container input is deprecated. Use Filestream input withe container parser instead. https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-filestream.html#_container")
errDeprecated = errors.New("Container input is deprecated. Use Filestream input with its container parser instead. https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-filestream.html#_container")
)

func init() {
Expand Down
30 changes: 3 additions & 27 deletions filebeat/input/filestream/legacy_metrics_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build integration
////go:build integration

package filestream

Expand Down Expand Up @@ -199,26 +199,6 @@ func waitForMetrics(t *testing.T, expect LegacyHarvesterMetrics, msgAndArgs ...a
}
}

func compareMetrics(t *testing.T, expect, got LegacyHarvesterMetrics) {
t.Helper()

if expect.Closed != got.Closed {
t.Errorf("expecting 'closed' to be %d, got %d instead", expect.Closed, got.Closed)
}

if expect.OpenFiles != got.OpenFiles {
t.Errorf("expecting 'open_files' to be %d, got %d instead", expect.OpenFiles, got.OpenFiles)
}

if expect.Running != got.Running {
t.Errorf("expecting 'running' to be %d, got %d instead", expect.Running, got.Running)
}

if expect.Started != got.Started {
t.Errorf("expecting 'started' to be %d, got %d instead", expect.Started, got.Started)
}
}

type LegacyHarvesterMetrics struct {
Closed int `json:"closed"`
OpenFiles int `json:"open_files"`
Expand All @@ -228,22 +208,18 @@ type LegacyHarvesterMetrics struct {

func getHarvesterMetrics(t *testing.T) LegacyHarvesterMetrics {
// The host is ignored because we're connecting via Unix sockets.
//nolint:noctx // it's okay for testing purposes
resp, err := http.Get("http://localhost:5066/stats")
if err != nil {
t.Fatalf("could not execute HTTP call: %s", err)
}
defer resp.Body.Close()

body, err := io.ReadAll(resp.Body)
if err != nil {
t.Fatalf("could not read request body: %s", err)
}

type foo struct {
F struct {
H LegacyHarvesterMetrics `json:"harvester"`
} `json:"filebeat"`
}

m := struct {
F struct {
H LegacyHarvesterMetrics `json:"harvester"`
Expand Down

0 comments on commit 1f497a9

Please sign in to comment.