I'd like to start `comment`ing in our code all the...
# suitescript
d
I'd like to start `comment`ing in our code all the UNIT usage (perhaps a summary at the top would be nice too). Anyone got some tried and true methods of doing so? Seems simply enough, just looking for some savvy vets to chime in with some thoughts.
t
@darrenhillconsulting I don't have any suggestions, but I really like this idea. I'd love to hear what you come up with!
d
Will do @tdietrich. I'm thinking something really easy using JSDoc. @units 10 (inside loop of <100) @maxUnits 1000.
b
expect to have a harder review process
its very easy for those to become outdated
s
yes, I agree with @battk and instead simply have automatic governance usage logging so it's easy to track the actual consumption both during and after development.
e
No autocalculation involved, but these are the JSDoc tags I use: https://www.npmjs.com/package/jsdoc-plugin-suitescript
If there's a looping structure, I just write a short formula like
Copy code
@gov 10*n for n elements in the input
👍 1
I've found that with the way I leverage small modules and tightly focused functions, the governance usage of any particular function rarely changes
It is harder to keep up at, say, the entry-point function though where that is more consistently in flux
especially if you're inheriting some code or tying into someone else's existing code, but that's pretty rare for me
d
Nice, thanks for all the feedback guys! The whole point of this that we've onboarding devs, and I want them to be aware of unit usage. We'll see where this advice lands us. Appreciated!