Skip to content

Commit

Permalink
Change config names serialization to persistence. (#1916)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattdurham authored Oct 17, 2024
1 parent 05a9670 commit 1ac8416
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions internal/component/prometheus/write/queue/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ func (s *Queue) createEndpoints() error {
return err
}
serial, err := serialization.NewSerializer(types.SerializerConfig{
MaxSignalsInBatch: uint32(s.args.Serialization.MaxSignalsToBatch),
FlushFrequency: s.args.Serialization.BatchInterval,
MaxSignalsInBatch: uint32(s.args.Persistence.MaxSignalsToBatch),
FlushFrequency: s.args.Persistence.BatchInterval,
}, fq, stats.UpdateSerializer, s.opts.Logger)
if err != nil {
return err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func newComponentBenchmark(t *testing.B, l log.Logger, url string, exp chan Expo
Tracer: nil,
}, Arguments{
TTL: 2 * time.Hour,
Serialization: Serialization{
Persistence: Persistence{
MaxSignalsToBatch: 100_000,
BatchInterval: 1 * time.Second,
},
Expand Down
2 changes: 1 addition & 1 deletion internal/component/prometheus/write/queue/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ func newComponent(t *testing.T, l *logging.Logger, url string, exp chan Exports,
Tracer: nil,
}, Arguments{
TTL: 2 * time.Hour,
Serialization: Serialization{
Persistence: Persistence{
MaxSignalsToBatch: 10_000,
BatchInterval: 1 * time.Second,
},
Expand Down
10 changes: 5 additions & 5 deletions internal/component/prometheus/write/queue/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
func defaultArgs() Arguments {
return Arguments{
TTL: 2 * time.Hour,
Serialization: Serialization{
Persistence: Persistence{
MaxSignalsToBatch: 10_000,
BatchInterval: 5 * time.Second,
},
Expand All @@ -22,12 +22,12 @@ func defaultArgs() Arguments {

type Arguments struct {
// TTL is how old a series can be.
TTL time.Duration `alloy:"ttl,attr,optional"`
Serialization Serialization `alloy:"serialization,block,optional"`
Endpoints []EndpointConfig `alloy:"endpoint,block"`
TTL time.Duration `alloy:"ttl,attr,optional"`
Persistence Persistence `alloy:"persistence,block,optional"`
Endpoints []EndpointConfig `alloy:"endpoint,block"`
}

type Serialization struct {
type Persistence struct {
// The batch size to persist to the file queue.
MaxSignalsToBatch int `alloy:"max_signals_to_batch,attr,optional"`
// How often to flush to the file queue if BatchSize isn't met.
Expand Down

0 comments on commit 1ac8416

Please sign in to comment.