astro / astro/node-collectdout

Control Number.MAX_VALUE

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Hello:

It is not clear to me if you are taking into consideration Number.MAX_VALUE for counters.
I mean, if I'm counting values for a long period of time, I might get to an invalid value for a javascript number, so I'd need to revert counter to 0.

This is the code for addCounter function:

```
addCounter: function(name, instance, increments) {
if (increments.constructor !== Array)
increments = [increments];

doubleHashUpdate(this.counters, name, instance, function(counters) {
return increments.map(function(increment) {
var counter = counters && counters[0] || 0;
return counter + increment;
});
});
}
```

Where do you store the result of "counter + increment" of the map function?

Thanks

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names the addCounter function and its doubleHashUpdate call, but no file or test. Start by locating addCounter, trace where counter + increment is stored, and check behavior when a counter approaches Number.MAX_VALUE; done requires a documented or tested decision for that boundary case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.