{
  "comment" : "This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.",
  "type" : "time_series_agg",
  "name" : "rate",
  "description" : "Calculates the per-second average rate of increase of a counter. Rate calculations account for breaks in monotonicity, such as counter resets when a service restarts, and extrapolate values within each bucketed time interval. Rate is the most appropriate aggregate function for counters. It is only allowed in a STATS command under a `TS` source command, to be properly applied per time series.",
  "signatures" : [
    {
      "params" : [
        {
          "name" : "field",
          "type" : "counter_double",
          "optional" : false,
          "description" : "the counter field whose per-second average rate of increase is computed"
        },
        {
          "name" : "window",
          "type" : "time_duration",
          "optional" : true,
          "description" : "the time window over which the rate is computed"
        }
      ],
      "variadic" : false,
      "returnType" : "double"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "counter_integer",
          "optional" : false,
          "description" : "the counter field whose per-second average rate of increase is computed"
        },
        {
          "name" : "window",
          "type" : "time_duration",
          "optional" : true,
          "description" : "the time window over which the rate is computed"
        }
      ],
      "variadic" : false,
      "returnType" : "double"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "counter_long",
          "optional" : false,
          "description" : "the counter field whose per-second average rate of increase is computed"
        },
        {
          "name" : "window",
          "type" : "time_duration",
          "optional" : true,
          "description" : "the time window over which the rate is computed"
        }
      ],
      "variadic" : false,
      "returnType" : "double"
    }
  ],
  "examples" : [
    "TS k8s\n| STATS max_rate=MAX(RATE(network.total_bytes_in)) BY time_bucket = TBUCKET(5minute)"
  ],
  "preview" : true,
  "snapshot_only" : false
}
