Comcast / Comcast/Surf-N-Perf

Single Mark Helper

Open
#55 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
90
Forks
20
PR merge metrics
No merged PRs in 30d

Description

Since it's currently only possible to have one value for a key (see Issue #54), that results in code like this when you only want to mark a key the first time it happens:

```js
if (!surfnperf.getMark('fetchData')) {
surfnperf.mark('fetchData');
}
```

A `markOnce` helper method to provide that same functionality would be useful.

We should determine a plan around this & #54 before our next release.

Contributor guide

Open the contributing guide

Research direction

Start by locating the implementations of getMark and mark, then check whether the project has tests covering mark behavior. Add coverage for the requested markOnce helper and confirm it marks a key only on its first call. Review Issue #54 as part of deciding how this fits before the next release.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
performance
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.