cgewecke / eth-gas-reporter

Gas usage per unit test. Average gas usage per method. A mocha reporter.
MIT License
603 stars 94 forks source link

Record every call on a csv file. #213

Closed ccolorado closed 4 years ago

ccolorado commented 4 years ago

I have been using ether gas reporter for a while. It is very useful, but sometimes I would want to have more information about my tests other than just the min, max, and average cost.

I could use the beforeEach and afterEach to try to deduct myself but that solution doesn't seem to scale all that good. (multiple test files, duped code, etc).

I got asked to extract the standard deviation. It would be awesome to be able to config new formulas on the truffle config. But perhaps just dumping the data is easier/faster/cheaper.

cgewecke commented 4 years ago

Hi @ccolorado.

When the environment variable CI is set to true, a JSON object containing all the gas data is written to the root directory of your project. There's an example of the output here. (It might have changed a little since that documentation was written...)

Being able to pass the gas data to an arbitrary function defined in the config is a really cool idea though...

ccolorado commented 4 years ago

Thanks, I was able to solve my issue with the CI data.