➡ī¸Submitting Metrics

Metrics API is the same among all different chains.

Metrics have 2 types: Counter and Gauge.

 const totalSupply = (await ctx.contract.totalSupply()).scaleDown(tokenInfo.decimal)
 ctx.meter.Gauge("total_supply").record(totalSupply, {token: tokenInfo.symbol})
 
 const amount = event.args.amount.scaleDown(tokenInfo.decimal)
 ctx.meter.Counter("mint_acc").add(amount, {token: tokenInfo.symbol})

Please refer to Metrics in processorsfor more definitions.

Please refer to Metricsfor the definitions.

Last updated