Skip to content

Commit

Permalink
decoderPoolSize metric
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryRomanov committed Sep 27, 2024
1 parent 27114a5 commit 6e1e851
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ require (
sigs.k8s.io/yaml v1.3.0
)

replace github.com/vitkovskii/insane-json => github.com/DmitryRomanov/insane-json v0.1.6-0.20240926122634-ddd151e16a6e

require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/ClickHouse/ch-go v0.58.2 h1:jSm2szHbT9MCAB1rJ3WuCJqmGLi5UTjlNu+f530UTS0=
github.com/ClickHouse/ch-go v0.58.2/go.mod h1:Ap/0bEmiLa14gYjCiRkYGbXvbe8vwdrfTYWhsuQ99aw=
github.com/DmitryRomanov/insane-json v0.1.6-0.20240926122634-ddd151e16a6e h1:RSaL4V1x1McvmpbZDcGF1i03q9ZiwT0yJ6NYEl5ipxA=
github.com/DmitryRomanov/insane-json v0.1.6-0.20240926122634-ddd151e16a6e/go.mod h1:xQyYcnFJ8ElboaEZG805SrQ7I4QupForGkm0/TnRaZ8=
github.com/KimMachineGun/automemlimit v0.2.6 h1:tQFriVTcIteUkV5EgU9iz03eDY36T8JU5RAjP2r6Kt0=
github.com/KimMachineGun/automemlimit v0.2.6/go.mod h1:pJhTW/nWJMj6SnWSU2TEKSlCaM+1N5Mej+IfS/5/Ol0=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
Expand Down Expand Up @@ -389,8 +391,6 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.48.0 h1:oJWvHb9BIZToTQS3MuQ2R3bJZiNSa2KiNdeI8A+79Tc=
github.com/valyala/fasthttp v1.48.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA=
github.com/vitkovskii/insane-json v0.1.7 h1:A84WpQ/xGw8SSzzbLTkTI6PD2IYAVWjTlgaxN/rCAnw=
github.com/vitkovskii/insane-json v0.1.7/go.mod h1:xQyYcnFJ8ElboaEZG805SrQ7I4QupForGkm0/TnRaZ8=
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
Expand Down
4 changes: 4 additions & 0 deletions pipeline/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ type Pipeline struct {

// all pipeline`s metrics
inUseEventsMetric prometheus.Gauge
decoderPoolSize prometheus.Gauge
eventPoolCapacityMetric prometheus.Gauge
inputEventsCountMetric prometheus.Counter
inputEventSizeMetric prometheus.Counter
Expand Down Expand Up @@ -225,6 +226,7 @@ func (p *Pipeline) IncMaxEventSizeExceeded() {
func (p *Pipeline) registerMetrics() {
m := p.actionParams.MetricCtl
p.inUseEventsMetric = m.RegisterGauge("event_pool_in_use_events", "Count of pool events which is used for processing")
p.decoderPoolSize = m.RegisterGauge("decoder_pool_size", "Size of decoder pool")
p.eventPoolCapacityMetric = m.RegisterGauge("event_pool_capacity", "Pool capacity value")
p.inputEventsCountMetric = m.RegisterCounter("input_events_count", "Count of events on pipeline input")
p.inputEventSizeMetric = m.RegisterCounter("input_events_size", "Size of events on pipeline input")
Expand Down Expand Up @@ -838,6 +840,8 @@ func (p *Pipeline) maintenance() {
myDeltas := p.incMetrics(inputEvents, inputSize, outputEvents, outputSize, readOps)
p.setMetrics(p.eventPool.inUseEvents.Load())
p.logChanges(myDeltas)

p.decoderPoolSize.Set(float64(insaneJSON.LenghtDecoderPool()))
}
}

Expand Down

0 comments on commit 6e1e851

Please sign in to comment.