CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/golang-github-com-prometheus--client-model

Data model artifacts for Prometheus

Overall
score

93%

Evaluation93%

1.13x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-10/

Float-Precise Histogram Encoder

Produce a serialized histogram metric payload that honors fractional overrides for overall and per-bucket counts so the encoded data exposes the higher-precision values.

Capabilities

Sample total override

  • When both an integer total and a fractional override are provided, the encoded histogram exposes the fractional total instead of the integer one, while retaining the provided sample sum and bucket layout. @test

Bucket override precedence

  • For any bucket that includes both an integer cumulative count and a fractional override, the encoded bucket exposes the fractional count while buckets without overrides keep their integer totals. @test

Mixed monotonic buckets

  • When combining fractional and integer bucket counts, the encoded cumulative counts remain non-decreasing in order of upper bounds and the final bucket aligns with the chosen total count. @test

Integer fallback

  • If no fractional overrides are supplied, the encoded histogram uses the integer totals unchanged for the overall sample count and every bucket. @test

Implementation

@generates

API

// Bucket-level input with optional fractional cumulative count override.
type BucketInput struct {
	UpperBound float64
	CumulativeCount uint64
	CumulativeCountOverride *float64
}

// Histogram input supporting fractional overrides for totals and buckets.
type HistogramInput struct {
	Name string
	Help string
	Unit string
	Buckets []BucketInput
	SampleCount uint64
	SampleCountOverride *float64
	SampleSum float64
	TimestampMs int64
}

// EncodeHistogram produces a serialized histogram metric using the provided inputs,
// preferring fractional overrides for totals and bucket counts when present.
func EncodeHistogram(input HistogramInput) ([]byte, error)

Dependencies { .dependencies }

Prometheus client model { .dependency }

Provides metric protobuf structures needed to encode histograms with fractional count overrides. @satisfied-by

Install with Tessl CLI

npx tessl i tessl/golang-github-com-prometheus--client-model

tile.json