1
0
Fork 0

fix hnt value factors
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Massaki Archambault 2021-09-26 17:37:33 -04:00
parent a177cdea3c
commit 4329a17991
2 changed files with 10 additions and 8 deletions

View File

@ -96,7 +96,7 @@ dist: $(TARGET_DIR) $(SRC)
# docker: build the docker image
.PHONY: docker
docker: $(BIN)
docker:
$(DOCKERBUILD) -t $(PROGRAM) .
$(foreach tag,$(DOCKER_TAGS),$(DOCKERTAG) $(PROGRAM) $(tag);)

View File

@ -67,7 +67,9 @@ func NewAccount(address string) Account {
}
const (
namespace = "helium"
namespace = "helium"
blockchain_oracle_factor = 100000000
blockchain_hnt_factor = 100000000
)
var (
@ -348,7 +350,7 @@ func (e *Exporter) collectOracleMetrics(wg *sync.WaitGroup, ch chan<- prometheus
}
ch <- prometheus.MustNewConstMetric(
oraclePrice.Desc, oraclePrice.Type, float64(currentOraclePrice.Price)/100000000,
oraclePrice.Desc, oraclePrice.Type, float64(currentOraclePrice.Price)/blockchain_oracle_factor,
)
}
@ -405,7 +407,7 @@ func (e *Exporter) collectAccountMetrics(wg *sync.WaitGroup, ch chan<- prometheu
}
ch <- prometheus.MustNewConstMetric(
accountBalanceHnt.Desc, accountBalanceHnt.Type, float64(accountForAddress.Balance),
accountBalanceHnt.Desc, accountBalanceHnt.Type, float64(accountForAddress.Balance)/blockchain_hnt_factor,
account.Address,
)
}
@ -439,7 +441,7 @@ func (e *Exporter) collectAccountRewardsTotalMetrics(wg *sync.WaitGroup, ch chan
}
ch <- prometheus.MustNewConstMetric(
accountRewardsHnt.Desc, accountRewardsHnt.Type, accountRewardTotalsForAddress.Sum,
accountRewardsHnt.Desc, accountRewardsHnt.Type, accountRewardTotalsForAddress.Sum/blockchain_hnt_factor,
account.Address,
)
}
@ -521,11 +523,11 @@ func (e *Exporter) collectAccountTransactionsMetrics(wg *sync.WaitGroup, ch chan
account.Tx.LastUpdate = now
ch <- prometheus.MustNewConstMetric(
accountDepositsHnt.Desc, accountDepositsHnt.Type, float64(account.Tx.DepositTotal),
accountDepositsHnt.Desc, accountDepositsHnt.Type, float64(account.Tx.DepositTotal)/blockchain_hnt_factor,
account.Address,
)
ch <- prometheus.MustNewConstMetric(
accountWithdrawalsHnt.Desc, accountWithdrawalsHnt.Type, float64(account.Tx.WithdrawalTotal),
accountWithdrawalsHnt.Desc, accountWithdrawalsHnt.Type, float64(account.Tx.WithdrawalTotal)/blockchain_hnt_factor,
account.Address,
)
}
@ -602,7 +604,7 @@ func (e *Exporter) collectHotspotRewardsMetrics(wg *sync.WaitGroup, ch chan<- pr
}
ch <- prometheus.MustNewConstMetric(
hotspotRewardsHnt.Desc, hotspotRewardsHnt.Type, hotspotRewardTotalsForAddress.Sum,
hotspotRewardsHnt.Desc, hotspotRewardsHnt.Type, hotspotRewardTotalsForAddress.Sum/blockchain_hnt_factor,
account.Address, hotspotData.Address, hotspotData.Name,
)
}