Skip to content

Commit

Permalink
Rebase and adopt changes from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklas-dohrn committed Sep 12, 2024
1 parent 419f450 commit 8fcac9f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
9 changes: 4 additions & 5 deletions src/pkg/egress/syslog/https.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (w *HTTPSWriter) sendHttpRequest(msg []byte, msgCount float64) error {
req.SetBody(msg)

resp := fasthttp.AcquireResponse()
defer fasthttp.ReleaseResponse(resp)

err := w.client.Do(req, resp)
if err != nil {
Expand Down Expand Up @@ -100,12 +101,10 @@ func (*HTTPSWriter) Close() error {
return nil
}

func httpClient(netConf NetworkTimeoutConfig, tlsConf *tls.Config) *fasthttp.Client {
func httpClient(_ NetworkTimeoutConfig, tlsConf *tls.Config) *fasthttp.Client {
return &fasthttp.Client{
MaxConnsPerHost: 5,
MaxIdleConnDuration: 90 * time.Second,
MaxConnsPerHost: 100,
MaxIdleConnDuration: 10 * time.Second,
TLSConfig: tlsConf,
ReadTimeout: 20 * time.Second,
WriteTimeout: 20 * time.Second,
}
}
6 changes: 3 additions & 3 deletions src/pkg/egress/syslog/https_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"crypto/tls"
"time"

"code.cloudfoundry.org/go-loggregator/v9/rpc/loggregator_v2"
"code.cloudfoundry.org/go-loggregator/v10/rpc/loggregator_v2"
metrics "code.cloudfoundry.org/go-metric-registry"
"code.cloudfoundry.org/loggregator-agent-release/src/pkg/egress"
)

const BATCHSIZE = 256 * 1024
const BATCHSIZE = 1024 * 1024

type HTTPSBatchWriter struct {
HTTPSWriter
Expand Down Expand Up @@ -39,7 +39,7 @@ func NewHTTPSBatchWriter(
syslogConverter: c,
},
batchSize: BATCHSIZE,
sendInterval: 1 * time.Second,
sendInterval: 3 * time.Second,
egrMsgCount: 0,
msgs: make(chan []byte),
}
Expand Down
4 changes: 2 additions & 2 deletions src/pkg/egress/syslog/https_batch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"net/http/httptest"
"time"

"code.cloudfoundry.org/go-loggregator/v9/rfc5424"
"code.cloudfoundry.org/go-loggregator/v9/rpc/loggregator_v2"
"code.cloudfoundry.org/go-loggregator/v10/rfc5424"
"code.cloudfoundry.org/go-loggregator/v10/rpc/loggregator_v2"
metricsHelpers "code.cloudfoundry.org/go-metric-registry/testhelpers"
"code.cloudfoundry.org/loggregator-agent-release/src/pkg/egress"
"code.cloudfoundry.org/loggregator-agent-release/src/pkg/egress/syslog"
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/ingress/bindings/filtered_binding_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

//go:generate hel --type IPChecker

var allowedSchemes = []string{"syslog", "syslog-tls", "https"}
var allowedSchemes = []string{"syslog", "syslog-tls", "https", "https-batch"}

type IPChecker interface {
ResolveAddr(host string) (net.IP, error)
Expand Down

0 comments on commit 8fcac9f

Please sign in to comment.