Current section

Files

Jump to
new_relic_agent lib new_relic util apdex.ex
Raw

lib/new_relic/util/apdex.ex

defmodule NewRelic.Util.Apdex do
@moduledoc false
# https://en.wikipedia.org/wiki/Apdex
def calculate(dur, apdex_t) when dur < apdex_t, do: :satisfying
def calculate(dur, apdex_t) when dur < apdex_t * 4, do: :tolerating
def calculate(_dur, _apdex_t), do: :frustrating
def label(:satisfying), do: "S"
def label(:tolerating), do: "T"
def label(:frustrating), do: "F"
def label(:ignore), do: nil
end