MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / pct

Function pct

tests/loadtest/tools/k6_json_to_tpm.py:58–67  ·  view source on GitHub ↗
(values, p)

Source from the content-addressed store, hash-verified

56T = args.apdex_threshold
57
58def pct(values, p):
59 if not values:
60 return float("nan")
61 values = sorted(values)
62 k = (len(values) - 1) * (p / 100.0)
63 i = int(math.floor(k))
64 j = int(math.ceil(k))
65 if i == j:
66 return values[i]
67 return values[i] + (values[j] - values[i]) * (k - i)
68
69minutes = sorted(set(list(counts.keys()) + list(latencies.keys())))
70

Callers 1

k6_json_to_tpm.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected