fix hnt value factors
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
a177cdea3c
commit
4329a17991
2
Makefile
2
Makefile
|
@ -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);)
|
||||
|
||||
|
|
14
exporter.go
14
exporter.go
|
@ -68,6 +68,8 @@ func NewAccount(address string) Account {
|
|||
|
||||
const (
|
||||
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,
|
||||
)
|
||||
}
|
||||
|
|
Reference in New Issue