MCPcopy Create free account
hub / github.com/prometheus/prometheus / TestBuildTimeSeries

Function TestBuildTimeSeries

storage/remote/queue_manager_test.go:2073–2255  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2071}
2072
2073func TestBuildTimeSeries(t *testing.T) {
2074 testCases := []struct {
2075 name string
2076 ts []prompb.TimeSeries
2077 filter func(ts prompb.TimeSeries) bool
2078 lowestTs int64
2079 highestTs int64
2080 droppedSamples int
2081 responseLen int
2082 }{
2083 {
2084 name: "No filter applied",
2085 ts: []prompb.TimeSeries{
2086 {
2087 Samples: []prompb.Sample{
2088 {
2089 Timestamp: 1234567890,
2090 Value: 1.23,
2091 },
2092 },
2093 },
2094 {
2095 Samples: []prompb.Sample{
2096 {
2097 Timestamp: 1234567891,
2098 Value: 2.34,
2099 },
2100 },
2101 },
2102 {
2103 Samples: []prompb.Sample{
2104 {
2105 Timestamp: 1234567892,
2106 Value: 3.34,
2107 },
2108 },
2109 },
2110 },
2111 filter: nil,
2112 responseLen: 3,
2113 lowestTs: 1234567890,
2114 highestTs: 1234567892,
2115 },
2116 {
2117 name: "Filter applied, samples in order",
2118 ts: []prompb.TimeSeries{
2119 {
2120 Samples: []prompb.Sample{
2121 {
2122 Timestamp: 1234567890,
2123 Value: 1.23,
2124 },
2125 },
2126 },
2127 {
2128 Samples: []prompb.Sample{
2129 {
2130 Timestamp: 1234567891,

Callers

nothing calls this directly

Calls 4

filterTsLimitFunction · 0.85
buildTimeSeriesFunction · 0.85
RunMethod · 0.65
LenMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…