Skip to content

Commit

Permalink
Revert "collector: add tasks API collection (prometheus-community#778)"
Browse files Browse the repository at this point in the history
This reverts commit 7a98b17.
  • Loading branch information
jaimeyh authored Jun 14, 2024
1 parent 3dc7c43 commit e7f263f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 260 deletions.
2 changes: 1 addition & 1 deletion collector/cluster_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type VersionInfo struct {
LuceneVersion semver.Version `json:"lucene_version"`
}

func (c *ClusterInfoCollector) Update(_ context.Context, ch chan<- prometheus.Metric) error {
func (c *ClusterInfoCollector) Update(ctx context.Context, ch chan<- prometheus.Metric) error {
resp, err := c.hc.Get(c.u.String())
if err != nil {
return err
Expand Down
13 changes: 13 additions & 0 deletions collector/cluster_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package collector

import (
"context"
"io"
"net/http"
"net/http/httptest"
Expand All @@ -23,9 +24,21 @@ import (
"testing"

"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/testutil"
)

type wrapCollector struct {
c Collector
}

func (w wrapCollector) Describe(ch chan<- *prometheus.Desc) {
}

func (w wrapCollector) Collect(ch chan<- prometheus.Metric) {
w.c.Update(context.Background(), ch)
}

func TestClusterSettingsStats(t *testing.T) {
// Testcases created using:
// docker run -d -p 9200:9200 elasticsearch:VERSION-alpine
Expand Down
36 changes: 0 additions & 36 deletions collector/collector_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion collector/nodes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ type basicAuth struct {
Next http.Handler
}

func (h *basicAuth) checkAuth(_ http.ResponseWriter, r *http.Request) bool {
func (h *basicAuth) checkAuth(w http.ResponseWriter, r *http.Request) bool {
s := strings.SplitN(r.Header.Get("Authorization"), " ", 2)
if len(s) != 2 {
return false
Expand Down
143 changes: 0 additions & 143 deletions collector/tasks.go

This file was deleted.

78 changes: 0 additions & 78 deletions collector/tasks_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/clusterinfo/clusterinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const (

type mockES struct{}

func (mockES) ServeHTTP(w http.ResponseWriter, _ *http.Request) {
func (mockES) ServeHTTP(w http.ResponseWriter, r *http.Request) {

fmt.Fprintf(w, `{
"name" : "%s",
Expand Down

0 comments on commit e7f263f

Please sign in to comment.