Skip to content

Commit bfe3938

Browse files
jkohenfabxc
authored andcommitted
Removed unused code detected by staticcheck. (#73)
1 parent a76ee9e commit bfe3938

File tree

5 files changed

+0
-28
lines changed

5 files changed

+0
-28
lines changed

cmd/stackdriver-prometheus-sidecar/main.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,6 @@ type genericConfig struct {
151151
namespace string
152152
}
153153

154-
type gceMetadata struct {
155-
projectID string
156-
location string
157-
cluster string
158-
}
159-
160154
type fileConfig struct {
161155
MetricRenames []struct {
162156
From string `json:"from"`

retrieval/transform.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
"github.com/prometheus/tsdb"
2828
tsdbLabels "github.com/prometheus/tsdb/labels"
2929
distribution_pb "google.golang.org/genproto/googleapis/api/distribution"
30-
metric_pb "google.golang.org/genproto/googleapis/api/metric"
3130
monitoring_pb "google.golang.org/genproto/googleapis/monitoring/v3"
3231
)
3332

@@ -152,20 +151,6 @@ func getMetricType(prefix string, promName string) string {
152151
return prefix + "/" + promName
153152
}
154153

155-
func getMetricKind(t textparse.MetricType) metric_pb.MetricDescriptor_MetricKind {
156-
if t == textparse.MetricTypeCounter || t == textparse.MetricTypeHistogram {
157-
return metric_pb.MetricDescriptor_CUMULATIVE
158-
}
159-
return metric_pb.MetricDescriptor_GAUGE
160-
}
161-
162-
func getValueType(t textparse.MetricType) metric_pb.MetricDescriptor_ValueType {
163-
if t == textparse.MetricTypeHistogram {
164-
return metric_pb.MetricDescriptor_DISTRIBUTION
165-
}
166-
return metric_pb.MetricDescriptor_DOUBLE
167-
}
168-
169154
// getTimestamp converts a millisecond timestamp into a protobuf timestamp.
170155
func getTimestamp(t int64) *timestamp_pb.Timestamp {
171156
return &timestamp_pb.Timestamp{

stackdriver/client.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import (
3737
)
3838

3939
const (
40-
metricsPrefix = "external.googleapis.com/prometheus"
4140
MaxTimeseriesesPerRequest = 200
4241
MonitoringWriteScope = "https://www.googleapis.com/auth/monitoring.write"
4342
)

stackdriver/client_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ func newLocalListener() net.Listener {
4141

4242
func TestStoreErrorHandling(t *testing.T) {
4343
tests := []struct {
44-
code int
4544
status *status.Status
4645
recoverable bool
4746
}{

stackdriver/queue_manager.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,6 @@ func newShard(cfg config.QueueConfig) shard {
408408

409409
type shardCollection struct {
410410
qm *QueueManager
411-
client StorageClient
412411
shards []shard
413412
done chan struct{}
414413
wg sync.WaitGroup
@@ -428,10 +427,6 @@ func (t *QueueManager) newShardCollection(numShards int) *shardCollection {
428427
return s
429428
}
430429

431-
func (s *shardCollection) len() int {
432-
return len(s.shards)
433-
}
434-
435430
func (s *shardCollection) start() {
436431
for i := range s.shards {
437432
go s.runShard(i)

0 commit comments

Comments
 (0)