This is a translation of the original English documentation page. Help us make it better.

8 Előrejelző funkciók

Az itt felsorolt összes funkció támogatott:

Néhány általános megjegyzés a funkcióparaméterekkel kapcsolatban:

  • A funkció paramétereit vessző választja el
  • Az opcionális funkcióparamétereket (vagy paraméterrészeket) a jelzi < >
  • A funkcióspecifikus paraméterek leírása minden funkcióhoz tartozik
  • A /host/key és a (sec|#num)<:time shift> paraméterek soha nem lehetnek idézett
Általános paraméterek
  • A /host/key a függvények általános kötelező első paramétere hivatkozva a gazdagép elem előzményeire
  • A (sec|#num)<:time shift> egy gyakori második paraméter a a gazdagép elem történetére hivatkozó függvények, ahol:
    • mp - maximum értékelés időszak másodpercben (idő utótagok használhatók), ill
    • #szám - maximum értékelés range a legfrissebb összegyűjtött értékek (ha hash jel előzi meg)
    • time shift (opcionális) lehetővé teszi az értékelési pont mozgatását vissza az időben. Többet látni részletek](/manual/config/triggers/expression#time_shift) bekapcsolva időeltolás megadása.

Prediction functions

FUNCTION
Description Function-specific parameters Comments
forecast (/host/key,(sec|#num)<:time shift>,time,<fit>,<mode>)
Future value, max, min, delta or avg of the item. See common parameters.

time - forecasting horizon in seconds (time suffixes can be used); negative values are supported

fit (optional; must be double-quoted) - function used to fit historical data

Supported fits:
linear - linear function
polynomialN - polynomial of degree N (1 <= N <= 6)
exponential - exponential function
logarithmic - logarithmic function
power - power function

Note that:
linear is default, polynomial1 is equivalent to linear

mode (optional; must be double-quoted) - demanded output

Supported modes:
value - value (default)
max - maximum
min - minimum
delta - max-min
avg - average

Note that:
value estimates item value at the moment now + time
max, min, delta and avg investigate item value estimate on the interval between now and now + time
Supported value types: float, int

If value to return is larger than 1.7976931348623157E+308 or less than -1.7976931348623157E+308, return value is cropped to 1.7976931348623157E+308 or -1.7976931348623157E+308 correspondingly.

Becomes unsupported only if misused in expression (wrong item type, invalid parameters), otherwise returns -1 in case of errors.

Examples:
=> forecast(/host/key,#10,1h) → forecast item value in one hour based on the last 10 values
=> forecast(/host/key,1h,30m) → forecast item value in 30 minutes based on the last hour data
=> forecast(/host/key,1h:now-1d,12h) → forecast item value in 12 hours based on one hour one day ago
=> forecast(/host/key,1h,10m,"exponential") → forecast item value in 10 minutes based on the last hour data and exponential function
=> forecast(/host/key,1h,2h,"polynomial3","max") → forecast the maximum value the item can reach in the next two hours based on last hour data and cubic (third degree) polynomial
=> forecast(/host/key,#2,-20m) → estimate the item value 20 minutes ago based on the last two values (this can be more precise than using last(), especially if item is updated rarely, say, once an hour)

See also additional information on predictive trigger functions.
timeleft (/host/key,(sec|#num)<:time shift>,threshold,<fit>)
Time in seconds needed for an item to reach a specified threshold. See common parameters.

threshold - value to reach (unit suffixes can be used)

fit (optional; must be double-quoted) - see forecast()
Supported value types: float, int

If value to return is larger than 1.7976931348623157E+308, return value is cropped to 1.7976931348623157E+308.

Returns 1.7976931348623157E+308 if threshold cannot be reached.

Becomes unsupported only if misused in the expression (wrong item type, invalid parameters), otherwise returns -1 in case of errors.

Examples:
=> timeleft(/host/key,#10,0) → time until the item value reaches zero based on the last 10 values
=> timeleft(/host/key,1h,100) → time until the item value reaches 100 based on the last hour data
=> timeleft(/host/key,1h:now-1d,100) → time until the item value reaches 100 based on one hour one day ago
=> timeleft(/host/key,1h,200,"polynomial2") → time until the item value reaches 200 based on the last hour data and assumption that the item behaves like quadratic (second degree) polynomial
See also additional information on predictive trigger functions.