Skip to content

Commit

Permalink
remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryk-dk committed Aug 30, 2023
1 parent 43fc08b commit 272fc67
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions push.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ func InitPush(pushURL string, interval time.Duration, extraLabels string, pushPr
//
// It is OK calling InitPushWithConfig multiple times with different pushURL -
// in this case metrics are pushed to all the provided pushURL urls.
func InitPushWithConfig(requestConfig *RequestConfig, pushProcessMetrics bool) error {
func InitPushWithConfig(requestConfig *RequestConfig, pushProcessMetrics bool) {
requestConfig.writeMetrics = func(w io.Writer) {
WritePrometheus(w, pushProcessMetrics)

Check warning on line 59 in push.go

View check run for this annotation

Codecov / codecov/patch

push.go#L57-L59

Added lines #L57 - L59 were not covered by tests
}
return InitPushExtWithConfig(requestConfig)
go requestConfig.Request()

Check warning on line 61 in push.go

View check run for this annotation

Codecov / codecov/patch

push.go#L61

Added line #L61 was not covered by tests
}

// InitPush sets up periodic push for metrics from s to the given pushURL with the given interval.
Expand Down Expand Up @@ -86,11 +86,11 @@ func (s *Set) InitPush(pushURL string, interval time.Duration, extraLabels strin
//
// It is OK calling InitPushWithConfig multiple times with different pushURL -
// in this case metrics are pushed to all the provided pushURL urls.
func (s *Set) InitPushWithConfig(requestConfig *RequestConfig) error {
func (s *Set) InitPushWithConfig(requestConfig *RequestConfig) {
requestConfig.writeMetrics = func(w io.Writer) {
s.WritePrometheus(w)

Check warning on line 91 in push.go

View check run for this annotation

Codecov / codecov/patch

push.go#L89-L91

Added lines #L89 - L91 were not covered by tests
}
return InitPushExtWithConfig(requestConfig)
go requestConfig.Request()

Check warning on line 93 in push.go

View check run for this annotation

Codecov / codecov/patch

push.go#L93

Added line #L93 was not covered by tests
}

// InitPushExt sets up periodic push for metrics obtained by calling writeMetrics with the given interval.
Expand Down Expand Up @@ -118,16 +118,6 @@ func InitPushExt(pushURL string, interval time.Duration, extraLabels string, wri
return nil
}

// InitPushExtWithConfig sets up periodic push for metrics obtained by calling writeMetrics with the given interval.
// defined in the RequestConfig
//
// It is OK calling InitPushExt multiple times with different writeMetrics -
// in this case all the metrics generated by writeMetrics callbacks are written to pushURL.
func InitPushExtWithConfig(requestConfig *RequestConfig) error {
go requestConfig.Request()
return nil
}

var pushMetrics = NewSet()

func writePushMetrics(w io.Writer) {
Expand Down

0 comments on commit 272fc67

Please sign in to comment.