You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most histograms I've seen are able to return the sum of all added values since the last reset. This is even mentioned in the Prometheus docs. While this could be done in a wrapper over this library, having it built-in would be a nice addition (no pun intended).
Given that the maximum integer in JavaScript is very low, this cannot really be correctly implemented for large numbers using Number. However, I've seen in the backlog that BigInt support is planned, so maybe that would be an option to store the sum? Right now BigInt is not really optimized and is pretty slow, but computing the sum could always be an option disabled by default that can be enabled when needed. It may also be possible to use a Number up to a point where it would overflow and then switch to a BigInt.
The text was updated successfully, but these errors were encountered:
Most histograms I've seen are able to return the sum of all added values since the last reset. This is even mentioned in the Prometheus docs. While this could be done in a wrapper over this library, having it built-in would be a nice addition (no pun intended).
Given that the maximum integer in JavaScript is very low, this cannot really be correctly implemented for large numbers using
Number
. However, I've seen in the backlog that BigInt support is planned, so maybe that would be an option to store the sum? Right nowBigInt
is not really optimized and is pretty slow, but computing the sum could always be an option disabled by default that can be enabled when needed. It may also be possible to use aNumber
up to a point where it would overflow and then switch to aBigInt
.The text was updated successfully, but these errors were encountered: