Repository: prometheus/prometheus
File: tsdb/head_append.go (Go)

Code before:
			// meantime. (This will probably lead to OOO shenanigans
			// anyway, but that's a different story.)
			//
			// If the last sample in the memSeries is indeed a
			// float, we don't have to do anything special here and
			// just go on with the normal commit for a float sample.
			// However, if the last sample in the memSeries is a
			// histogram or float histogram, we have to convert the
			// staleness marker to a histogram (or float histogram,
			// respectively), and just add it at the end of the
			// histograms (or float histograms) in the same batch,
			// to be committed later in commitHistograms (or
			// commitFloatHistograms). The latter is fine because we
			// know there is no other histogram (or float histogram)
			// sample for this same series in this same batch
			// (because any such sample would have triggered a new
			// batch).
			switch {
			case series.lastHistogramValue != nil:
				b.histograms = append(b.histograms, record.RefHistogramSample{
					Ref: series.ref,
					T:   s.T,
					H:   &histogram.Histogram{Sum: s.V},
				})
				b.histogramSeries = append(b.histogramSeries, series)
				// This sample was counted as a float but is now a histogram
				acc.floatsAppended--
				acc.histogramsAppended++
				series.Unlock()
				continue
			case series.lastFloatHistogramValue != nil:
				b.floatHistograms = append(b.floatHistograms, record.RefFloatHistogramSample{
					Ref: series.ref,
					T:   s.T,
					FH:  &histogram.FloatHistogram{Sum: s.V},
				})
				b.floatHistogramSeries = append(b.floatHistogramSeries, series)
				// This sample was counted as a float but is now a float histogram
				acc.floatsAppended--
				acc.histogramsAppended++
				series.Unlock()
				continue
			}
		}
		oooSample, _, err := series.appendable(s.T, s.V, a.headMaxt, a.minValidTime, a.oooTimeWindow)
		if err != nil {
			handleAppendableError(err, &acc.floatsAppended, &acc.floatOOORejected, &acc.floatOOBRejected, &acc.floatTooOldRejected)
		}

		switch {
		case err != nil:

Review comment (suggestion):
Nit: End the sentence with a period.

```suggestion
				// This sample was counted as a float but is now a histogram.
```

Code after:
			// meantime. (This will probably lead to OOO shenanigans
			// anyway, but that's a different story.)
			//
			// If the last sample in the memSeries is indeed a
			// float, we don't have to do anything special here and
			// just go on with the normal commit for a float sample.
			// However, if the last sample in the memSeries is a
			// histogram or float histogram, we have to convert the
			// staleness marker to a histogram (or float histogram,
			// respectively), and just add it at the end of the
			// histograms (or float histograms) in the same batch,
			// to be committed later in commitHistograms (or
			// commitFloatHistograms). The latter is fine because we
			// know there is no other histogram (or float histogram)
			// sample for this same series in this same batch
			// (because any such sample would have triggered a new
			// batch).
			switch {
			case series.lastHistogramValue != nil:
				b.histograms = append(b.histograms, record.RefHistogramSample{
					Ref: series.ref,
					T:   s.T,
					H:   &histogram.Histogram{Sum: s.V},
				})
				b.histogramSeries = append(b.histogramSeries, series)
				// This sample was counted as a float but is now a histogram.
				acc.floatsAppended--
				acc.histogramsAppended++
				series.Unlock()
				continue
			case series.lastFloatHistogramValue != nil:
				b.floatHistograms = append(b.floatHistograms, record.RefFloatHistogramSample{
					Ref: series.ref,
					T:   s.T,
					FH:  &histogram.FloatHistogram{Sum: s.V},
				})
				b.floatHistogramSeries = append(b.floatHistogramSeries, series)
				// This sample was counted as a float but is now a float histogram.
				acc.floatsAppended--
				acc.histogramsAppended++
				series.Unlock()
				continue
			}
		}
		oooSample, _, err := series.appendable(s.T, s.V, a.headMaxt, a.minValidTime, a.oooTimeWindow)
		if err != nil {
			handleAppendableError(err, &acc.floatsAppended, &acc.floatOOORejected, &acc.floatOOBRejected, &acc.floatTooOldRejected)
		}

		switch {
		case err != nil: