Skip to content

Commit

Permalink
chore: move some functions around
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwhitney committed Aug 1, 2024
1 parent 06269b0 commit 7d98cb0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions pkg/distributor/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func (v Validator) ValidateLabels(ctx validationContext, ls labels.Labels, strea
if ls.Has(push.LabelServiceName) {
numLabelNames--
}

if numLabelNames > ctx.maxLabelNamesPerSeries {
updateMetrics(validation.MaxLabelNamesPerSeries, ctx.userID, stream)
return fmt.Errorf(validation.MaxLabelNamesPerSeriesErrorMsg, stream.Labels, numLabelNames, ctx.maxLabelNamesPerSeries)
Expand Down
18 changes: 0 additions & 18 deletions pkg/pattern/flush.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,3 @@ func (i *Ingester) sweepInstance(instance *instance, _, mayRemoveStreams bool) {
return true, nil
})
}

func (i *Ingester) stopWriters() {
instances := i.getInstances()

for _, instance := range instances {
if instance.writer != nil {
instance.writer.Stop()
}
}
}

func (i *Ingester) downsampleMetrics(ts model.Time) {
instances := i.getInstances()

for _, instance := range instances {
instance.Downsample(ts)
}
}
18 changes: 18 additions & 0 deletions pkg/pattern/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,21 @@ func (i *Ingester) getInstances() []*instance {
}
return instances
}

func (i *Ingester) stopWriters() {
instances := i.getInstances()

for _, instance := range instances {
if instance.writer != nil {
instance.writer.Stop()
}
}
}

func (i *Ingester) downsampleMetrics(ts model.Time) {
instances := i.getInstances()

for _, instance := range instances {
instance.Downsample(ts)
}
}

0 comments on commit 7d98cb0

Please sign in to comment.