(values, threshold = 300)
| 1322 | } |
| 1323 | |
| 1324 | function computeApdex(values, threshold = 300) { |
| 1325 | if (!values.length) { |
| 1326 | return null; |
| 1327 | } |
| 1328 | const satisfied = values.filter((value) => value <= threshold).length; |
| 1329 | const tolerated = values.filter((value) => value > threshold && value <= threshold * 4).length; |
| 1330 | return (satisfied + tolerated * 0.5) / values.length; |
| 1331 | } |
| 1332 | |
| 1333 | function floorMinute(timestamp) { |
| 1334 | const date = new Date(timestamp); |
no outgoing calls
no test coverage detected