2024-07-03 02:56:48 -07:00
|
|
|
// Copyright 2024 The Prometheus Authors
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package textparse
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"io"
|
|
|
|
"math"
|
|
|
|
"strconv"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/prometheus/common/model"
|
|
|
|
|
|
|
|
"github.com/prometheus/prometheus/model/exemplar"
|
|
|
|
"github.com/prometheus/prometheus/model/histogram"
|
|
|
|
"github.com/prometheus/prometheus/model/labels"
|
|
|
|
"github.com/prometheus/prometheus/util/convertnhcb"
|
|
|
|
)
|
|
|
|
|
2024-10-22 09:49:25 -07:00
|
|
|
type collectionState int
|
|
|
|
|
|
|
|
const (
|
|
|
|
stateStart collectionState = iota
|
|
|
|
stateCollecting
|
|
|
|
stateEmitting
|
|
|
|
)
|
|
|
|
|
2024-10-14 05:35:11 -07:00
|
|
|
// The NHCBParser wraps a Parser and converts classic histograms to native
|
|
|
|
// histograms with custom buckets.
|
|
|
|
//
|
|
|
|
// Since Parser interface is line based, this parser needs to keep track
|
|
|
|
// of the last classic histogram series it saw to collate them into a
|
|
|
|
// single native histogram.
|
|
|
|
//
|
|
|
|
// Note:
|
2024-10-21 02:00:41 -07:00
|
|
|
// - Only series that have the histogram metadata type are considered for
|
|
|
|
// conversion.
|
|
|
|
// - The classic series are also returned if keepClassicHistograms is true.
|
2024-07-03 02:56:48 -07:00
|
|
|
type NHCBParser struct {
|
2024-07-03 02:56:48 -07:00
|
|
|
// The parser we're wrapping.
|
|
|
|
parser Parser
|
|
|
|
// Option to keep classic histograms along with converted histograms.
|
2024-07-03 02:56:48 -07:00
|
|
|
keepClassicHistograms bool
|
|
|
|
|
2024-10-09 03:29:59 -07:00
|
|
|
// Labels builder.
|
|
|
|
builder labels.ScratchBuilder
|
|
|
|
|
2024-10-22 09:49:25 -07:00
|
|
|
// State of the parser.
|
|
|
|
state collectionState
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
// Caches the values from the underlying parser.
|
|
|
|
// For Series and Histogram.
|
2024-07-03 02:56:48 -07:00
|
|
|
bytes []byte
|
|
|
|
ts *int64
|
|
|
|
value float64
|
|
|
|
h *histogram.Histogram
|
|
|
|
fh *histogram.FloatHistogram
|
2024-07-03 02:56:48 -07:00
|
|
|
// For Metric.
|
2024-07-03 02:56:48 -07:00
|
|
|
lset labels.Labels
|
|
|
|
metricString string
|
2024-07-03 02:56:48 -07:00
|
|
|
// For Type.
|
2024-10-07 02:31:43 -07:00
|
|
|
bName []byte
|
2024-07-03 02:56:48 -07:00
|
|
|
typ model.MetricType
|
2024-07-03 02:56:48 -07:00
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
// Caches the entry itself if we are inserting a converted NHCB
|
|
|
|
// halfway through.
|
2024-10-22 09:49:25 -07:00
|
|
|
entry Entry
|
|
|
|
err error
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
// Caches the values and metric for the inserted converted NHCB.
|
2024-07-03 02:56:48 -07:00
|
|
|
bytesNHCB []byte
|
|
|
|
hNHCB *histogram.Histogram
|
|
|
|
fhNHCB *histogram.FloatHistogram
|
|
|
|
lsetNHCB labels.Labels
|
2024-10-09 02:08:08 -07:00
|
|
|
exemplars []exemplar.Exemplar
|
2024-10-23 22:38:58 -07:00
|
|
|
ctNHCB *int64
|
2024-07-03 02:56:48 -07:00
|
|
|
metricStringNHCB string
|
2024-07-03 02:56:48 -07:00
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
// Collates values from the classic histogram series to build
|
|
|
|
// the converted histogram later.
|
2024-10-22 09:49:25 -07:00
|
|
|
tempLsetNHCB labels.Labels
|
|
|
|
tempNHCB convertnhcb.TempHistogram
|
|
|
|
tempExemplars []exemplar.Exemplar
|
|
|
|
tempExemplarCount int
|
2024-10-23 22:38:58 -07:00
|
|
|
tempCT *int64
|
2024-07-03 02:56:48 -07:00
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
// Remembers the last base histogram metric name (assuming it's
|
|
|
|
// a classic histogram) so we can tell if the next float series
|
|
|
|
// is part of the same classic histogram.
|
2024-10-24 09:14:05 -07:00
|
|
|
lastHistogramName string
|
|
|
|
lastHistogramLabelsHash uint64
|
|
|
|
lastHistogramExponential bool
|
|
|
|
// Reused buffer for hashing labels.
|
|
|
|
hBuffer []byte
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
|
|
|
|
2024-10-09 03:29:59 -07:00
|
|
|
func NewNHCBParser(p Parser, st *labels.SymbolTable, keepClassicHistograms bool) Parser {
|
2024-07-03 02:56:48 -07:00
|
|
|
return &NHCBParser{
|
2024-07-03 02:56:48 -07:00
|
|
|
parser: p,
|
|
|
|
keepClassicHistograms: keepClassicHistograms,
|
2024-10-09 03:29:59 -07:00
|
|
|
builder: labels.NewScratchBuilderWithSymbolTable(st, 16),
|
2024-07-03 02:56:48 -07:00
|
|
|
tempNHCB: convertnhcb.NewTempHistogram(),
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
func (p *NHCBParser) Series() ([]byte, *int64, float64) {
|
2024-07-03 02:56:48 -07:00
|
|
|
return p.bytes, p.ts, p.value
|
|
|
|
}
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
func (p *NHCBParser) Histogram() ([]byte, *int64, *histogram.Histogram, *histogram.FloatHistogram) {
|
2024-10-22 09:49:25 -07:00
|
|
|
if p.state == stateEmitting {
|
2024-07-03 02:56:48 -07:00
|
|
|
return p.bytesNHCB, p.ts, p.hNHCB, p.fhNHCB
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
2024-07-03 02:56:48 -07:00
|
|
|
return p.bytes, p.ts, p.h, p.fh
|
|
|
|
}
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
func (p *NHCBParser) Help() ([]byte, []byte) {
|
2024-07-03 02:56:48 -07:00
|
|
|
return p.parser.Help()
|
|
|
|
}
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
func (p *NHCBParser) Type() ([]byte, model.MetricType) {
|
2024-10-07 02:31:43 -07:00
|
|
|
return p.bName, p.typ
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
func (p *NHCBParser) Unit() ([]byte, []byte) {
|
2024-07-03 02:56:48 -07:00
|
|
|
return p.parser.Unit()
|
|
|
|
}
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
func (p *NHCBParser) Comment() []byte {
|
2024-07-03 02:56:48 -07:00
|
|
|
return p.parser.Comment()
|
|
|
|
}
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
func (p *NHCBParser) Metric(l *labels.Labels) string {
|
2024-10-22 09:49:25 -07:00
|
|
|
if p.state == stateEmitting {
|
2024-07-03 02:56:48 -07:00
|
|
|
*l = p.lsetNHCB
|
|
|
|
return p.metricStringNHCB
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
2024-07-03 02:56:48 -07:00
|
|
|
*l = p.lset
|
|
|
|
return p.metricString
|
|
|
|
}
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
func (p *NHCBParser) Exemplar(ex *exemplar.Exemplar) bool {
|
2024-10-22 09:49:25 -07:00
|
|
|
if p.state == stateEmitting {
|
2024-10-09 02:08:08 -07:00
|
|
|
if len(p.exemplars) == 0 {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
*ex = p.exemplars[0]
|
|
|
|
p.exemplars = p.exemplars[1:]
|
|
|
|
return true
|
|
|
|
}
|
2024-07-03 02:56:48 -07:00
|
|
|
return p.parser.Exemplar(ex)
|
|
|
|
}
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
func (p *NHCBParser) CreatedTimestamp() *int64 {
|
2024-10-23 22:38:58 -07:00
|
|
|
switch p.state {
|
|
|
|
case stateStart:
|
|
|
|
if p.entry == EntrySeries || p.entry == EntryHistogram {
|
|
|
|
return p.parser.CreatedTimestamp()
|
|
|
|
}
|
|
|
|
case stateCollecting:
|
2024-10-28 00:31:43 -07:00
|
|
|
return p.tempCT
|
2024-10-23 22:38:58 -07:00
|
|
|
case stateEmitting:
|
|
|
|
return p.ctNHCB
|
|
|
|
}
|
2024-10-09 02:08:08 -07:00
|
|
|
return nil
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
func (p *NHCBParser) Next() (Entry, error) {
|
2024-10-22 09:49:25 -07:00
|
|
|
if p.state == stateEmitting {
|
|
|
|
p.state = stateStart
|
2024-07-03 02:56:48 -07:00
|
|
|
if p.entry == EntrySeries {
|
2024-10-09 04:08:54 -07:00
|
|
|
isNHCB := p.handleClassicHistogramSeries(p.lset)
|
|
|
|
if isNHCB && !p.keepClassicHistograms {
|
|
|
|
// Do not return the classic histogram series if it was converted to NHCB and we are not keeping classic histograms.
|
2024-07-03 02:56:48 -07:00
|
|
|
return p.Next()
|
|
|
|
}
|
|
|
|
}
|
2024-07-03 02:56:48 -07:00
|
|
|
return p.entry, p.err
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
2024-10-23 22:38:58 -07:00
|
|
|
|
|
|
|
p.entry, p.err = p.parser.Next()
|
|
|
|
if p.err != nil {
|
|
|
|
if errors.Is(p.err, io.EOF) && p.processNHCB() {
|
2024-07-03 02:56:48 -07:00
|
|
|
return EntryHistogram, nil
|
|
|
|
}
|
2024-10-23 22:38:58 -07:00
|
|
|
return EntryInvalid, p.err
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
2024-10-23 22:38:58 -07:00
|
|
|
switch p.entry {
|
2024-07-03 02:56:48 -07:00
|
|
|
case EntrySeries:
|
|
|
|
p.bytes, p.ts, p.value = p.parser.Series()
|
|
|
|
p.metricString = p.parser.Metric(&p.lset)
|
2024-10-07 06:41:54 -07:00
|
|
|
// Check the label set to see if we can continue or need to emit the NHCB.
|
2024-10-24 09:14:05 -07:00
|
|
|
var isNHCB bool
|
|
|
|
if p.compareLabels() {
|
|
|
|
// Labels differ. Check if we can emit the NHCB.
|
|
|
|
if p.processNHCB() {
|
|
|
|
return EntryHistogram, nil
|
|
|
|
}
|
|
|
|
isNHCB = p.handleClassicHistogramSeries(p.lset)
|
|
|
|
} else {
|
|
|
|
// Labels are the same. Check if after an exponential histogram.
|
|
|
|
if p.lastHistogramExponential {
|
|
|
|
isNHCB = false
|
|
|
|
} else {
|
|
|
|
isNHCB = p.handleClassicHistogramSeries(p.lset)
|
|
|
|
}
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
2024-10-09 04:08:54 -07:00
|
|
|
if isNHCB && !p.keepClassicHistograms {
|
|
|
|
// Do not return the classic histogram series if it was converted to NHCB and we are not keeping classic histograms.
|
2024-07-03 02:56:48 -07:00
|
|
|
return p.Next()
|
|
|
|
}
|
2024-10-23 22:38:58 -07:00
|
|
|
return p.entry, p.err
|
2024-07-03 02:56:48 -07:00
|
|
|
case EntryHistogram:
|
|
|
|
p.bytes, p.ts, p.h, p.fh = p.parser.Histogram()
|
|
|
|
p.metricString = p.parser.Metric(&p.lset)
|
2024-10-24 09:14:05 -07:00
|
|
|
p.storeExponentialLabels()
|
2024-07-03 02:56:48 -07:00
|
|
|
case EntryType:
|
2024-10-07 02:31:43 -07:00
|
|
|
p.bName, p.typ = p.parser.Type()
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
2024-07-03 02:56:48 -07:00
|
|
|
if p.processNHCB() {
|
2024-07-03 02:56:48 -07:00
|
|
|
return EntryHistogram, nil
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
2024-10-23 22:38:58 -07:00
|
|
|
return p.entry, p.err
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
|
|
|
|
2024-10-08 01:12:25 -07:00
|
|
|
// Return true if labels have changed and we should emit the NHCB.
|
|
|
|
func (p *NHCBParser) compareLabels() bool {
|
2024-10-22 09:49:25 -07:00
|
|
|
if p.state != stateCollecting {
|
2024-10-08 01:12:25 -07:00
|
|
|
return false
|
|
|
|
}
|
|
|
|
if p.typ != model.MetricTypeHistogram {
|
2024-10-22 09:49:25 -07:00
|
|
|
// Different metric type.
|
2024-10-08 01:12:25 -07:00
|
|
|
return true
|
|
|
|
}
|
2024-10-09 06:16:46 -07:00
|
|
|
if p.lastHistogramName != convertnhcb.GetHistogramMetricBaseName(p.lset.Get(labels.MetricName)) {
|
2024-10-09 03:29:59 -07:00
|
|
|
// Different metric name.
|
|
|
|
return true
|
|
|
|
}
|
2024-10-09 06:16:46 -07:00
|
|
|
nextHash, _ := p.lset.HashWithoutLabels(p.hBuffer, labels.BucketLabel)
|
2024-10-22 09:49:25 -07:00
|
|
|
// Different label values.
|
|
|
|
return p.lastHistogramLabelsHash != nextHash
|
2024-10-08 01:12:25 -07:00
|
|
|
}
|
|
|
|
|
2024-10-07 06:41:54 -07:00
|
|
|
// Save the label set of the classic histogram without suffix and bucket `le` label.
|
2024-10-24 09:14:05 -07:00
|
|
|
func (p *NHCBParser) storeClassicLabels() {
|
2024-10-09 06:16:46 -07:00
|
|
|
p.lastHistogramName = convertnhcb.GetHistogramMetricBaseName(p.lset.Get(labels.MetricName))
|
|
|
|
p.lastHistogramLabelsHash, _ = p.lset.HashWithoutLabels(p.hBuffer, labels.BucketLabel)
|
2024-10-24 09:14:05 -07:00
|
|
|
p.lastHistogramExponential = false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *NHCBParser) storeExponentialLabels() {
|
|
|
|
p.lastHistogramName = p.lset.Get(labels.MetricName)
|
|
|
|
p.lastHistogramLabelsHash, _ = p.lset.HashWithoutLabels(p.hBuffer)
|
|
|
|
p.lastHistogramExponential = true
|
2024-10-07 06:41:54 -07:00
|
|
|
}
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
// handleClassicHistogramSeries collates the classic histogram series to be converted to NHCB
|
|
|
|
// if it is actually a classic histogram series (and not a normal float series) and if there
|
|
|
|
// isn't already a native histogram with the same name (assuming it is always processed
|
|
|
|
// right before the classic histograms) and returns true if the collation was done.
|
2024-07-03 02:56:48 -07:00
|
|
|
func (p *NHCBParser) handleClassicHistogramSeries(lset labels.Labels) bool {
|
2024-07-03 02:56:48 -07:00
|
|
|
if p.typ != model.MetricTypeHistogram {
|
|
|
|
return false
|
|
|
|
}
|
2024-07-03 02:56:48 -07:00
|
|
|
mName := lset.Get(labels.MetricName)
|
2024-10-07 06:41:54 -07:00
|
|
|
// Sanity check to ensure that the TYPE metadata entry name is the same as the base name.
|
2024-10-07 02:31:43 -07:00
|
|
|
if convertnhcb.GetHistogramMetricBaseName(mName) != string(p.bName) {
|
2024-07-03 02:56:48 -07:00
|
|
|
return false
|
|
|
|
}
|
2024-07-03 02:56:48 -07:00
|
|
|
switch {
|
|
|
|
case strings.HasSuffix(mName, "_bucket") && lset.Has(labels.BucketLabel):
|
|
|
|
le, err := strconv.ParseFloat(lset.Get(labels.BucketLabel), 64)
|
|
|
|
if err == nil && !math.IsNaN(le) {
|
2024-07-03 02:56:48 -07:00
|
|
|
p.processClassicHistogramSeries(lset, "_bucket", func(hist *convertnhcb.TempHistogram) {
|
2024-10-25 00:42:46 -07:00
|
|
|
_ = hist.SetBucketCount(le, p.value)
|
2024-07-03 02:56:48 -07:00
|
|
|
})
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
case strings.HasSuffix(mName, "_count"):
|
2024-07-03 02:56:48 -07:00
|
|
|
p.processClassicHistogramSeries(lset, "_count", func(hist *convertnhcb.TempHistogram) {
|
2024-10-25 00:42:46 -07:00
|
|
|
_ = hist.SetCount(p.value)
|
2024-07-03 02:56:48 -07:00
|
|
|
})
|
|
|
|
return true
|
|
|
|
case strings.HasSuffix(mName, "_sum"):
|
2024-07-03 02:56:48 -07:00
|
|
|
p.processClassicHistogramSeries(lset, "_sum", func(hist *convertnhcb.TempHistogram) {
|
2024-10-25 00:42:46 -07:00
|
|
|
_ = hist.SetSum(p.value)
|
2024-07-03 02:56:48 -07:00
|
|
|
})
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
func (p *NHCBParser) processClassicHistogramSeries(lset labels.Labels, suffix string, updateHist func(*convertnhcb.TempHistogram)) {
|
2024-10-22 09:49:25 -07:00
|
|
|
if p.state != stateCollecting {
|
2024-10-24 09:14:05 -07:00
|
|
|
p.storeClassicLabels()
|
2024-10-23 22:38:58 -07:00
|
|
|
p.tempCT = p.parser.CreatedTimestamp()
|
|
|
|
p.state = stateCollecting
|
2024-10-25 00:42:46 -07:00
|
|
|
p.tempLsetNHCB = convertnhcb.GetHistogramMetricBase(lset, suffix)
|
2024-10-22 09:49:25 -07:00
|
|
|
}
|
2024-10-09 02:08:08 -07:00
|
|
|
p.storeExemplars()
|
2024-07-03 02:56:48 -07:00
|
|
|
updateHist(&p.tempNHCB)
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
|
|
|
|
2024-10-09 02:08:08 -07:00
|
|
|
func (p *NHCBParser) storeExemplars() {
|
|
|
|
for ex := p.nextExemplarPtr(); p.parser.Exemplar(ex); ex = p.nextExemplarPtr() {
|
|
|
|
p.tempExemplarCount++
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *NHCBParser) nextExemplarPtr() *exemplar.Exemplar {
|
|
|
|
switch {
|
|
|
|
case p.tempExemplarCount == len(p.tempExemplars)-1:
|
|
|
|
// Reuse the previously allocated exemplar, it was not filled up.
|
|
|
|
case len(p.tempExemplars) == cap(p.tempExemplars):
|
|
|
|
// Let the runtime grow the slice.
|
|
|
|
p.tempExemplars = append(p.tempExemplars, exemplar.Exemplar{})
|
|
|
|
default:
|
|
|
|
// Take the next element into use.
|
|
|
|
p.tempExemplars = p.tempExemplars[:len(p.tempExemplars)+1]
|
|
|
|
}
|
|
|
|
return &p.tempExemplars[len(p.tempExemplars)-1]
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *NHCBParser) swapExemplars() {
|
|
|
|
p.exemplars = p.tempExemplars[:p.tempExemplarCount]
|
|
|
|
p.tempExemplars = p.tempExemplars[:0]
|
|
|
|
}
|
|
|
|
|
2024-07-03 02:56:48 -07:00
|
|
|
// processNHCB converts the collated classic histogram series to NHCB and caches the info
|
2024-10-22 09:49:25 -07:00
|
|
|
// to be returned to callers. Retruns true if the conversion was successful.
|
2024-07-03 02:56:48 -07:00
|
|
|
func (p *NHCBParser) processNHCB() bool {
|
2024-10-22 09:49:25 -07:00
|
|
|
if p.state != stateCollecting {
|
2024-07-03 02:56:48 -07:00
|
|
|
return false
|
|
|
|
}
|
2024-10-25 00:42:46 -07:00
|
|
|
h, fh, err := p.tempNHCB.Convert()
|
|
|
|
if err == nil {
|
|
|
|
if h != nil {
|
|
|
|
if err := h.Validate(); err != nil {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
p.hNHCB = h
|
|
|
|
p.fhNHCB = nil
|
|
|
|
} else if fh != nil {
|
|
|
|
if err := fh.Validate(); err != nil {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
p.hNHCB = nil
|
|
|
|
p.fhNHCB = fh
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
2024-10-25 00:42:46 -07:00
|
|
|
p.metricStringNHCB = p.tempLsetNHCB.Get(labels.MetricName) + strings.ReplaceAll(p.tempLsetNHCB.DropMetricName().String(), ", ", ",")
|
|
|
|
p.bytesNHCB = []byte(p.metricStringNHCB)
|
|
|
|
p.lsetNHCB = p.tempLsetNHCB
|
|
|
|
p.swapExemplars()
|
|
|
|
p.ctNHCB = p.tempCT
|
|
|
|
p.state = stateEmitting
|
|
|
|
} else {
|
|
|
|
p.state = stateStart
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|
2024-10-25 00:42:46 -07:00
|
|
|
p.tempNHCB.Reset()
|
|
|
|
p.tempExemplarCount = 0
|
2024-10-23 22:38:58 -07:00
|
|
|
p.tempCT = nil
|
2024-10-25 00:42:46 -07:00
|
|
|
return err == nil
|
2024-07-03 02:56:48 -07:00
|
|
|
}
|