github.com/m3db/m3@v1.5.1-0.20231129193456-75a402aa583b/src/query/test/compatibility/testdata/functions.test (about)

     1  # Testdata for resets() and changes().
     2  load 5m
     3  	http_requests{path="/foo"}	1 2 3 0 1 0 0 1 2 0
     4  	http_requests{path="/bar"}	1 2 3 4 5 1 2 3 4 5
     5  	http_requests{path="/biz"}	0 0 0 0 0 1 1 1 1 1
     6  
     7  # Tests for resets().
     8  # FAILING issue #16
     9  #eval instant at 50m resets(http_requests[5m])
    10  #	{path="/foo"} 0
    11  #	{path="/bar"} 0
    12  #	{path="/biz"} 0
    13  
    14  eval instant at 50m resets(http_requests[20m])
    15  	{path="/foo"} 1
    16  	{path="/bar"} 0
    17  	{path="/biz"} 0
    18  
    19  eval instant at 50m resets(http_requests[30m])
    20  	{path="/foo"} 2
    21  	{path="/bar"} 1
    22  	{path="/biz"} 0
    23  
    24  eval instant at 50m resets(http_requests[50m])
    25  	{path="/foo"} 3
    26  	{path="/bar"} 1
    27  	{path="/biz"} 0
    28  
    29  eval instant at 50m resets(nonexistent_metric[50m])
    30  
    31  # Tests for changes().
    32  # FAILING issue #17
    33  #eval instant at 50m changes(http_requests[5m])
    34  #	{path="/foo"} 0
    35  #	{path="/bar"} 0
    36  #	{path="/biz"} 0
    37  
    38  eval instant at 50m changes(http_requests[20m])
    39  	{path="/foo"} 3
    40  	{path="/bar"} 3
    41  	{path="/biz"} 0
    42  
    43  eval instant at 50m changes(http_requests[30m])
    44  	{path="/foo"} 4
    45  	{path="/bar"} 5
    46  	{path="/biz"} 1
    47  
    48  #eval instant at 50m changes(http_requests[50m])
    49  #	{path="/foo"} 8
    50  #	{path="/bar"} 9
    51  #	{path="/biz"} 1
    52  
    53  #eval instant at 50m changes((http_requests[50m]))
    54  #	{path="/foo"} 8
    55  #	{path="/bar"} 9
    56  #	{path="/biz"} 1
    57  
    58  eval instant at 50m changes(nonexistent_metric[50m])
    59  
    60  clear
    61  
    62  load 5m
    63    x{a="b"} NaN NaN NaN
    64    x{a="c"} 0 NaN 0
    65  
    66  # FAILING
    67  #eval instant at 15m changes(x[15m])
    68  #  {a="b"} 0
    69  #  {a="c"} 2
    70  
    71  clear
    72  
    73  # Tests for increase().
    74  load 5m
    75  	http_requests{path="/foo"}	0+10x10
    76  	http_requests{path="/bar"}	0+10x5 0+10x5
    77  
    78  # Tests for increase().
    79  eval instant at 50m increase(http_requests[50m])
    80  	{path="/foo"} 100
    81  	{path="/bar"}  90
    82  
    83  eval instant at 50m increase(http_requests[100m])
    84  	{path="/foo"} 100
    85  	{path="/bar"}  90
    86  
    87  clear
    88  
    89  # Test for increase() with counter reset.
    90  # When the counter is reset, it always starts at 0.
    91  # So the sequence 3 2 (decreasing counter = reset) is interpreted the same as 3 0 1 2.
    92  # Prometheus assumes it missed the intermediate values 0 and 1.
    93  load 5m
    94  	http_requests{path="/foo"}	0 1 2 3 2 3 4
    95  
    96  eval instant at 30m increase(http_requests[30m])
    97      {path="/foo"} 7
    98  
    99  clear
   100  
   101  # Tests for irate().
   102  load 5m
   103  	http_requests{path="/foo"}	0+10x10
   104  	http_requests{path="/bar"}	0+10x5 0+10x5
   105  
   106  eval instant at 50m irate(http_requests[50m])
   107  	{path="/foo"} .03333333333333333333
   108  	{path="/bar"} .03333333333333333333
   109  
   110  # Counter reset.
   111  eval instant at 30m irate(http_requests[50m])
   112  	{path="/foo"} .03333333333333333333
   113  	{path="/bar"} 0
   114  
   115  clear
   116  
   117  # Tests for delta().
   118  load 5m
   119  	http_requests{path="/foo"}	0 50 100 150 200
   120  	http_requests{path="/bar"}	200 150 100 50 0
   121  
   122  eval instant at 20m delta(http_requests[20m])
   123  	{path="/foo"} 200
   124  	{path="/bar"} -200
   125  
   126  clear
   127  
   128  # Tests for idelta().
   129  load 5m
   130  	http_requests{path="/foo"}	0 50 100 150
   131  	http_requests{path="/bar"}	0 50 100 50
   132  
   133  eval instant at 20m idelta(http_requests[20m])
   134  	{path="/foo"} 50
   135  	{path="/bar"} -50
   136  
   137  clear
   138  
   139  # Tests for deriv() and predict_linear().
   140  load 5m
   141  	testcounter_reset_middle	0+10x4 0+10x5
   142  	http_requests{job="app-server", instance="1", group="canary"}		0+80x10
   143  
   144  # deriv should return the same as rate in simple cases.
   145  eval instant at 50m rate(http_requests{group="canary", instance="1", job="app-server"}[50m])
   146  	{group="canary", instance="1", job="app-server"} 0.26666666666666666
   147  
   148  eval instant at 50m deriv(http_requests{group="canary", instance="1", job="app-server"}[50m])
   149  	{group="canary", instance="1", job="app-server"} 0.26666666666666666
   150  
   151  # deriv should return correct result.
   152  eval instant at 50m deriv(testcounter_reset_middle[100m])
   153  	{} 0.010606060606060607
   154  
   155  # predict_linear should return correct result.
   156  # X/s = [  0, 300, 600, 900,1200,1500,1800,2100,2400,2700,3000]
   157  # Y   = [  0,  10,  20,  30,  40,   0,  10,  20,  30,  40,  50]
   158  # sumX  = 16500
   159  # sumY  = 250
   160  # sumXY = 480000
   161  # sumX2 = 34650000
   162  # n     = 11
   163  # covXY = 105000
   164  # varX  = 9900000
   165  # slope = 0.010606060606060607
   166  # intercept at t=0: 6.818181818181818
   167  # intercept at t=3000: 38.63636363636364
   168  # intercept at t=3000+3600: 76.81818181818181
   169  eval instant at 50m predict_linear(testcounter_reset_middle[100m], 3600)
   170  	{} 76.81818181818181
   171  
   172  # With http_requests, there is a sample value exactly at the end of
   173  # the range, and it has exactly the predicted value, so predict_linear
   174  # can be emulated with deriv.
   175  eval instant at 50m predict_linear(http_requests[50m], 3600) - (http_requests + deriv(http_requests[50m]) * 3600)
   176  	{group="canary", instance="1", job="app-server"} 0
   177  
   178  clear
   179  
   180  # Tests for label_replace.
   181  load 5m
   182    testmetric{src="source-value-10",dst="original-destination-value"} 0
   183    testmetric{src="source-value-20",dst="original-destination-value"} 1
   184  
   185  # label_replace does a full-string match and replace.
   186  eval instant at 0m label_replace(testmetric, "dst", "destination-value-$1", "src", "source-value-(.*)")
   187    testmetric{src="source-value-10",dst="destination-value-10"} 0
   188    testmetric{src="source-value-20",dst="destination-value-20"} 1
   189  
   190  # FAILING. label_replace does not do a sub-string match.
   191  #eval instant at 0m label_replace(testmetric, "dst", "destination-value-$1", "src", "value-(.*)")
   192  #  testmetric{src="source-value-10",dst="original-destination-value"} 0
   193  #  testmetric{src="source-value-20",dst="original-destination-value"} 1
   194  
   195  # label_replace works with multiple capture groups.
   196  eval instant at 0m label_replace(testmetric, "dst", "$1-value-$2", "src", "(.*)-value-(.*)")
   197    testmetric{src="source-value-10",dst="source-value-10"} 0
   198    testmetric{src="source-value-20",dst="source-value-20"} 1
   199  
   200  # label_replace does not overwrite the destination label if the source label
   201  # does not exist.
   202  eval instant at 0m label_replace(testmetric, "dst", "value-$1", "nonexistent-src", "source-value-(.*)")
   203    testmetric{src="source-value-10",dst="original-destination-value"} 0
   204    testmetric{src="source-value-20",dst="original-destination-value"} 1
   205  
   206  # FAILING. label_replace overwrites the destination label if the source label is empty,
   207  # but matched.
   208  #eval instant at 0m label_replace(testmetric, "dst", "value-$1", "nonexistent-src", "(.*)")
   209  #  testmetric{src="source-value-10",dst="value-"} 0
   210  #  testmetric{src="source-value-20",dst="value-"} 1
   211  
   212  # label_replace does not overwrite the destination label if the source label
   213  # is not matched.
   214  eval instant at 0m label_replace(testmetric, "dst", "value-$1", "src", "non-matching-regex")
   215    testmetric{src="source-value-10",dst="original-destination-value"} 0
   216    testmetric{src="source-value-20",dst="original-destination-value"} 1
   217  
   218  # FAILING. eval instant at 0m label_replace((((testmetric))), (("dst")), (("value-$1")), (("src")), (("non-matching-regex")))
   219  #  testmetric{src="source-value-10",dst="original-destination-value"} 0
   220  #  testmetric{src="source-value-20",dst="original-destination-value"} 1
   221  
   222  # FAILING. label_replace drops labels that are set to empty values.
   223  #eval instant at 0m label_replace(testmetric, "dst", "", "dst", ".*")
   224  #  testmetric{src="source-value-10"} 0
   225  #  testmetric{src="source-value-20"} 1
   226  
   227  # label_replace fails when the regex is invalid.
   228  eval_fail instant at 0m label_replace(testmetric, "dst", "value-$1", "src", "(.*")
   229  
   230  # FAILING. label_replace fails when the destination label name is not a valid Prometheus label name.
   231  #eval_fail instant at 0m label_replace(testmetric, "invalid-label-name", "", "src", "(.*)")
   232  
   233  # FAILING. label_replace fails when there would be duplicated identical output label sets.
   234  #eval_fail instant at 0m label_replace(testmetric, "src", "", "", "")
   235  
   236  clear
   237  
   238  # Tests for vector, time and timestamp.
   239  load 10s
   240    metric 1 1
   241  
   242  # FAILING issue #23. eval instant at 0s timestamp(metric)
   243  #  {} 0
   244  
   245  # FAILING issue #23. eval instant at 5s timestamp(metric)
   246  #  {} 0
   247  
   248  # FAILING issue #23. eval instant at 10s timestamp(metric)
   249  #  {} 10
   250  
   251  # FAILING issue #23. eval instant at 10s timestamp(((metric)))
   252  #  {} 10
   253  
   254  # Tests for label_join.
   255  load 5m
   256    testmetric{src="a",src1="b",src2="c",dst="original-destination-value"} 0
   257    testmetric{src="d",src1="e",src2="f",dst="original-destination-value"} 1
   258  
   259  # label_join joins all src values in order.
   260  eval instant at 0m label_join(testmetric, "dst", "-", "src", "src1", "src2")
   261    testmetric{src="a",src1="b",src2="c",dst="a-b-c"} 0
   262    testmetric{src="d",src1="e",src2="f",dst="d-e-f"} 1
   263  
   264  # FAILING. label_join treats non existent src labels as empty strings.
   265  #eval instant at 0m label_join(testmetric, "dst", "-", "src", "src3", "src1")
   266  #  testmetric{src="a",src1="b",src2="c",dst="a--b"} 0
   267  #  testmetric{src="d",src1="e",src2="f",dst="d--e"} 1
   268  
   269  # FAILING. label_join overwrites the destination label even if the resulting dst label is empty string
   270  #eval instant at 0m label_join(testmetric, "dst", "", "emptysrc", "emptysrc1", "emptysrc2")
   271  #  testmetric{src="a",src1="b",src2="c"} 0
   272  #  testmetric{src="d",src1="e",src2="f"} 1
   273  
   274  # test without src label for label_join
   275  # FAILING. eval instant at 0m label_join(testmetric, "dst", ", ")
   276  #	  testmetric{src="a",src1="b",src2="c"} 0
   277  #	  testmetric{src="d",src1="e",src2="f"} 1
   278  
   279  # test without dst label for label_join
   280  load 5m
   281    testmetric1{src="foo",src1="bar",src2="foobar"} 0
   282    testmetric1{src="fizz",src1="buzz",src2="fizzbuzz"} 1
   283  
   284  # label_join creates dst label if not present.
   285  eval instant at 0m label_join(testmetric1, "dst", ", ", "src", "src1", "src2")
   286    testmetric1{src="foo",src1="bar",src2="foobar",dst="foo, bar, foobar"} 0
   287    testmetric1{src="fizz",src1="buzz",src2="fizzbuzz",dst="fizz, buzz, fizzbuzz"} 1
   288  
   289  clear
   290  
   291  # Tests for vector.
   292  # FAILING issue #51. eval instant at 0m vector(1)
   293  #  {} 1
   294  
   295  # FAILING issue #27. eval instant at 0s vector(time())
   296  #  {} 0
   297  
   298  # FAILING issue #27. eval instant at 5s vector(time())
   299  #  {} 5
   300  
   301  # FAILING issue #27. eval instant at 60m vector(time())
   302  #  {} 3600
   303  
   304  
   305  # Tests for clamp_max, clamp_min(), and clamp().
   306  load 5m
   307  	test_clamp{src="clamp-a"}	-50
   308  	test_clamp{src="clamp-b"}	0
   309  	test_clamp{src="clamp-c"}	100
   310  
   311  eval instant at 0m clamp_max(test_clamp, 75)
   312  	{src="clamp-a"}	-50
   313  	{src="clamp-b"}	0
   314  	{src="clamp-c"}	75
   315  
   316  eval instant at 0m clamp_min(test_clamp, -25)
   317  	{src="clamp-a"}	-25
   318  	{src="clamp-b"}	0
   319  	{src="clamp-c"}	100
   320  
   321  #eval instant at 0m clamp(test_clamp, -25, 75)
   322  #	{src="clamp-a"}	-25
   323  #	{src="clamp-c"}	75
   324  
   325  eval instant at 0m clamp_max(clamp_min(test_clamp, -20), 70)
   326  	{src="clamp-a"}	-20
   327  	{src="clamp-b"}	0
   328  	{src="clamp-c"}	70
   329  
   330  eval instant at 0m clamp_max((clamp_min(test_clamp, (-20))), (70))
   331  	{src="clamp-a"}	-20
   332  	{src="clamp-b"}	0
   333  	{src="clamp-c"}	70
   334  
   335  #eval instant at 0m clamp(test_clamp, 0, NaN)
   336  #	{src="clamp-b"}	NaN
   337  #	{src="clamp-c"}	NaN
   338  
   339  #eval instant at 0m clamp(test_clamp, NaN, 0)
   340  #	{src="clamp-a"}	NaN
   341  #	{src="clamp-b"}	NaN
   342  #	{src="clamp-c"}	NaN
   343  
   344  #eval instant at 0m clamp(test_clamp, 5, -5)
   345  
   346  # Test cases for sgn.
   347  #clear
   348  #load 5m
   349  #	test_sgn{src="sgn-a"}	-Inf
   350  #	test_sgn{src="sgn-b"}	Inf
   351  #	test_sgn{src="sgn-c"}	NaN
   352  #	test_sgn{src="sgn-d"}	-50
   353  #	test_sgn{src="sgn-e"}	0
   354  #	test_sgn{src="sgn-f"}	100
   355  
   356  #eval instant at 0m sgn(test_sgn)
   357  #	{src="sgn-a"}	-1
   358  #	{src="sgn-b"}	1
   359  #	{src="sgn-c"}	NaN
   360  #	{src="sgn-d"}	-1
   361  #	{src="sgn-e"}	0
   362  #	{src="sgn-f"}	1
   363  
   364  # Tests for sort/sort_desc.
   365  clear
   366  load 5m
   367  	http_requests{job="api-server", instance="0", group="production"}	0+10x10
   368  	http_requests{job="api-server", instance="1", group="production"}	0+20x10
   369  	http_requests{job="api-server", instance="0", group="canary"}		0+30x10
   370  	http_requests{job="api-server", instance="1", group="canary"}		0+40x10
   371  	http_requests{job="api-server", instance="2", group="canary"}		NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
   372  	http_requests{job="app-server", instance="0", group="production"}	0+50x10
   373  	http_requests{job="app-server", instance="1", group="production"}	0+60x10
   374  	http_requests{job="app-server", instance="0", group="canary"}		0+70x10
   375  	http_requests{job="app-server", instance="1", group="canary"}		0+80x10
   376  
   377  eval_ordered instant at 50m sort(http_requests)
   378  	http_requests{group="production", instance="0", job="api-server"} 100
   379  	http_requests{group="production", instance="1", job="api-server"} 200
   380  	http_requests{group="canary", instance="0", job="api-server"} 300
   381  	http_requests{group="canary", instance="1", job="api-server"} 400
   382  	http_requests{group="production", instance="0", job="app-server"} 500
   383  	http_requests{group="production", instance="1", job="app-server"} 600
   384  	http_requests{group="canary", instance="0", job="app-server"} 700
   385  	http_requests{group="canary", instance="1", job="app-server"} 800
   386  	http_requests{group="canary", instance="2", job="api-server"} NaN
   387  
   388  eval_ordered instant at 50m sort_desc(http_requests)
   389  	http_requests{group="canary", instance="1", job="app-server"} 800
   390  	http_requests{group="canary", instance="0", job="app-server"} 700
   391  	http_requests{group="production", instance="1", job="app-server"} 600
   392  	http_requests{group="production", instance="0", job="app-server"} 500
   393  	http_requests{group="canary", instance="1", job="api-server"} 400
   394  	http_requests{group="canary", instance="0", job="api-server"} 300
   395  	http_requests{group="production", instance="1", job="api-server"} 200
   396  	http_requests{group="production", instance="0", job="api-server"} 100
   397  	http_requests{group="canary", instance="2", job="api-server"} NaN
   398  
   399  # Tests for holt_winters
   400  clear
   401  
   402  # positive trends
   403  load 10s
   404  	http_requests{job="api-server", instance="0", group="production"}	0+10x1000 100+30x1000
   405  	http_requests{job="api-server", instance="1", group="production"}	0+20x1000 200+30x1000
   406  	http_requests{job="api-server", instance="0", group="canary"}		0+30x1000 300+80x1000
   407  	http_requests{job="api-server", instance="1", group="canary"}		0+40x2000
   408  
   409  eval instant at 8000s holt_winters(http_requests[1m], 0.01, 0.1)
   410  	{job="api-server", instance="0", group="production"} 8000
   411  	{job="api-server", instance="1", group="production"} 16000
   412  	{job="api-server", instance="0", group="canary"} 24000
   413  	{job="api-server", instance="1", group="canary"} 32000
   414  
   415  # negative trends
   416  clear
   417  load 10s
   418  	http_requests{job="api-server", instance="0", group="production"}	8000-10x1000
   419  	http_requests{job="api-server", instance="1", group="production"}	0-20x1000
   420  	http_requests{job="api-server", instance="0", group="canary"}		0+30x1000 300-80x1000
   421  	http_requests{job="api-server", instance="1", group="canary"}		0-40x1000 0+40x1000
   422  
   423  eval instant at 8000s holt_winters(http_requests[1m], 0.01, 0.1)
   424  	{job="api-server", instance="0", group="production"} 0
   425  	{job="api-server", instance="1", group="production"} -16000
   426  	{job="api-server", instance="0", group="canary"} 24000
   427  	{job="api-server", instance="1", group="canary"} -32000
   428  
   429  # Tests for avg_over_time
   430  clear
   431  load 10s
   432    metric 1 2 3 4 5
   433  
   434  eval instant at 1m avg_over_time(metric[1m])
   435    {} 3
   436  
   437  # Tests for stddev_over_time and stdvar_over_time.
   438  clear
   439  load 10s
   440    metric 0 8 8 2 3
   441  
   442  eval instant at 1m stdvar_over_time(metric[1m])
   443    {} 10.56
   444  
   445  eval instant at 1m stddev_over_time(metric[1m])
   446    {} 3.249615
   447  
   448  eval instant at 1m stddev_over_time((metric[1m]))
   449    {} 3.249615
   450  
   451  # Tests for stddev_over_time and stdvar_over_time #4927.
   452  clear
   453  load 10s
   454    metric 1.5990505637277868 1.5990505637277868 1.5990505637277868
   455  
   456  eval instant at 1m stdvar_over_time(metric[1m])
   457    {} 0
   458  
   459  eval instant at 1m stddev_over_time(metric[1m])
   460    {} 0
   461  
   462  # Tests for quantile_over_time
   463  clear
   464  
   465  load 10s
   466  	data{test="two samples"} 0 1
   467  	data{test="three samples"} 0 1 2
   468  	data{test="uneven samples"} 0 1 4
   469  
   470  eval instant at 1m quantile_over_time(0, data[1m])
   471  	{test="two samples"} 0
   472  	{test="three samples"} 0
   473  	{test="uneven samples"} 0
   474  
   475  eval instant at 1m quantile_over_time(0.5, data[1m])
   476  	{test="two samples"} 0.5
   477  	{test="three samples"} 1
   478  	{test="uneven samples"} 1
   479  
   480  eval instant at 1m quantile_over_time(0.75, data[1m])
   481  	{test="two samples"} 0.75
   482  	{test="three samples"} 1.5
   483  	{test="uneven samples"} 2.5
   484  
   485  eval instant at 1m quantile_over_time(0.8, data[1m])
   486  	{test="two samples"} 0.8
   487  	{test="three samples"} 1.6
   488  	{test="uneven samples"} 2.8
   489  
   490  eval instant at 1m quantile_over_time(1, data[1m])
   491  	{test="two samples"} 1
   492  	{test="three samples"} 2
   493  	{test="uneven samples"} 4
   494  
   495  eval instant at 1m quantile_over_time(-1, data[1m])
   496  	{test="two samples"} -Inf
   497  	{test="three samples"} -Inf
   498  	{test="uneven samples"} -Inf
   499  
   500  eval instant at 1m quantile_over_time(2, data[1m])
   501  	{test="two samples"} +Inf
   502  	{test="three samples"} +Inf
   503  	{test="uneven samples"} +Inf
   504  
   505  eval instant at 1m (quantile_over_time(2, (data[1m])))
   506  	{test="two samples"} +Inf
   507  	{test="three samples"} +Inf
   508  	{test="uneven samples"} +Inf
   509  
   510  clear
   511  
   512  # FAILING issue #30. Test time-related functions.
   513  #eval instant at 0m year()
   514  #  {} 1970
   515  
   516  #eval instant at 1ms time()
   517  #  0.001
   518  
   519  eval instant at 0m year(vector(1136239445))
   520    {} 2006
   521  
   522  #eval instant at 0m month()
   523  #  {} 1
   524  
   525  eval instant at 0m month(vector(1136239445))
   526    {} 1
   527  
   528  #eval instant at 0m day_of_month()
   529  #  {} 1
   530  
   531  eval instant at 0m day_of_month(vector(1136239445))
   532    {} 2
   533  
   534  # Thursday.
   535  #eval instant at 0m day_of_week()
   536  #  {} 4
   537  
   538  eval instant at 0m day_of_week(vector(1136239445))
   539    {} 1
   540  
   541  #eval instant at 0m hour()
   542  #  {} 0
   543  
   544  eval instant at 0m hour(vector(1136239445))
   545    {} 22
   546  
   547  #eval instant at 0m minute()
   548  #  {} 0
   549  
   550  eval instant at 0m minute(vector(1136239445))
   551    {} 4
   552  
   553  # 2008-12-31 23:59:59 just before leap second.
   554  eval instant at 0m year(vector(1230767999))
   555    {} 2008
   556  
   557  # 2009-01-01 00:00:00 just after leap second.
   558  eval instant at 0m year(vector(1230768000))
   559    {} 2009
   560  
   561  # 2016-02-29 23:59:59 February 29th in leap year.
   562  eval instant at 0m month(vector(1456790399)) + day_of_month(vector(1456790399)) / 100
   563    {} 2.29
   564  
   565  # 2016-03-01 00:00:00 March 1st in leap year.
   566  eval instant at 0m month(vector(1456790400)) + day_of_month(vector(1456790400)) / 100
   567    {} 3.01
   568  
   569  # February 1st 2016 in leap year.
   570  eval instant at 0m days_in_month(vector(1454284800))
   571    {} 29
   572  
   573  # February 1st 2017 not in leap year.
   574  eval instant at 0m days_in_month(vector(1485907200))
   575    {} 28
   576  
   577  clear
   578  
   579  # Test duplicate labelset in promql output.
   580  load 5m
   581    testmetric1{src="a",dst="b"} 0
   582    testmetric2{src="a",dst="b"} 1
   583  
   584  # FAILING. eval_fail instant at 0m changes({__name__=~'testmetric1|testmetric2'}[5m])
   585  
   586  # Tests for *_over_time
   587  clear
   588  
   589  load 10s
   590  	data{type="numbers"} 2 0 3
   591  	data{type="some_nan"} 2 0 NaN
   592  	data{type="some_nan2"} 2 NaN 1
   593  	data{type="some_nan3"} NaN 0 1
   594  	data{type="only_nan"} NaN NaN NaN
   595  
   596  eval instant at 1m min_over_time(data[1m])
   597  	{type="numbers"} 0
   598  	{type="some_nan"} 0
   599  	{type="some_nan2"} 1
   600  	{type="some_nan3"} 0
   601  	# Failing with keepNaN feature. {type="only_nan"} NaN
   602  
   603  eval instant at 1m max_over_time(data[1m])
   604  	{type="numbers"} 3
   605  	{type="some_nan"} 2
   606  	{type="some_nan2"} 2
   607  	{type="some_nan3"} 1
   608  	# Failing with keepNaN feature. {type="only_nan"} NaN
   609  
   610  eval instant at 1m last_over_time(data[1m])
   611  	data{type="numbers"} 3
   612  	data{type="some_nan2"} 1
   613  	data{type="some_nan3"} 1
   614  	# Failing with keepNaN feature. data{type="some_nan"} NaN
   615  	# Failing with keepNaN feature. data{type="only_nan"} NaN
   616  
   617  clear
   618  
   619  # FAILING issue #6. Testdata for absent_over_time()
   620  #eval instant at 1m absent_over_time(http_requests[5m])
   621  #    {} 1
   622  
   623  # FAILING issue #6. eval instant at 1m absent_over_time(http_requests{handler="/foo"}[5m])
   624  #    {handler="/foo"} 1
   625  
   626  # FAILING issue #6. eval instant at 1m absent_over_time(http_requests{handler!="/foo"}[5m])
   627  #    {} 1
   628  
   629  # FAILING issue #6. eval instant at 1m absent_over_time(http_requests{handler="/foo", handler="/bar", handler="/foobar"}[5m])
   630  #    {} 1
   631  
   632  # FAILING issue #6. eval instant at 1m absent_over_time(rate(nonexistant[5m])[5m:])
   633  #    {} 1
   634  
   635  # FAILING issue #6. eval instant at 1m absent_over_time(http_requests{handler="/foo", handler="/bar", instance="127.0.0.1"}[5m])
   636  #    {instance="127.0.0.1"} 1
   637  
   638  load 1m
   639  	http_requests{path="/foo",instance="127.0.0.1",job="httpd"}	1+1x10
   640  	http_requests{path="/bar",instance="127.0.0.1",job="httpd"}	1+1x10
   641  	httpd_handshake_failures_total{instance="127.0.0.1",job="node"}	1+1x15
   642  	httpd_log_lines_total{instance="127.0.0.1",job="node"}	1
   643  	ssl_certificate_expiry_seconds{job="ingress"} NaN NaN NaN NaN NaN
   644  
   645  # FAILING issue #6. eval instant at 5m absent_over_time(http_requests[5m])
   646  
   647  # FAILING issue #6. eval instant at 5m absent_over_time(rate(http_requests[5m])[5m:1m])
   648  
   649  # FAILING issue #6. eval instant at 0m absent_over_time(httpd_log_lines_total[30s])
   650  
   651  # FAILING issue #6. eval instant at 1m absent_over_time(httpd_log_lines_total[30s])
   652  #    {} 1
   653  
   654  # FAILING issue #6. eval instant at 15m absent_over_time(http_requests[5m])
   655  
   656  # FAILING issue #6. eval instant at 16m absent_over_time(http_requests[5m])
   657  #    {} 1
   658  
   659  # FAILING issue #6. eval instant at 16m absent_over_time(http_requests[6m])
   660  
   661  # FAILING issue #6. eval instant at 16m absent_over_time(httpd_handshake_failures_total[1m])
   662  
   663  # FAILING issue #6. eval instant at 16m absent_over_time({instance="127.0.0.1"}[5m])
   664  
   665  # FAILING issue #6. eval instant at 16m absent_over_time({instance="127.0.0.1"}[5m])
   666  
   667  # FAILING issue #6. eval instant at 21m absent_over_time({instance="127.0.0.1"}[5m])
   668  # FAILING issue #6.     {instance="127.0.0.1"} 1
   669  
   670  # FAILING issue #6. eval instant at 21m absent_over_time({instance="127.0.0.1"}[20m])
   671  
   672  # FAILING issue #6. eval instant at 21m absent_over_time({job="grok"}[20m])
   673  # FAILING issue #6.     {job="grok"} 1
   674  
   675  # FAILING issue #6. eval instant at 30m absent_over_time({instance="127.0.0.1"}[5m:5s])
   676  # FAILING issue #6.     {} 1
   677  
   678  # FAILING issue #6. eval instant at 5m absent_over_time({job="ingress"}[4m])
   679  
   680  # FAILING issue #6. eval instant at 10m absent_over_time({job="ingress"}[4m])
   681  # FAILING issue #6. 	{job="ingress"} 1