reverted NewSolanaCollector name + more of Jeff's nits
This commit is contained in:
parent
8601796d18
commit
05a5c6d710
|
@ -0,0 +1,6 @@
|
||||||
|
# for prometheus configs:
|
||||||
|
.prometheus
|
||||||
|
|
||||||
|
# builds:
|
||||||
|
.builds
|
||||||
|
solana_exporter
|
|
@ -35,7 +35,7 @@ type solanaCollector struct {
|
||||||
solanaVersion *prometheus.Desc
|
solanaVersion *prometheus.Desc
|
||||||
}
|
}
|
||||||
|
|
||||||
func newSolanaCollector(rpcAddr string) *solanaCollector {
|
func NewSolanaCollector(rpcAddr string) *solanaCollector {
|
||||||
return &solanaCollector{
|
return &solanaCollector{
|
||||||
rpcClient: rpc.NewRPCClient(rpcAddr),
|
rpcClient: rpc.NewRPCClient(rpcAddr),
|
||||||
totalValidatorsDesc: prometheus.NewDesc(
|
totalValidatorsDesc: prometheus.NewDesc(
|
||||||
|
@ -132,7 +132,7 @@ func main() {
|
||||||
|
|
||||||
httpTimeout = time.Duration(*httpTimeoutSecs) * time.Second
|
httpTimeout = time.Duration(*httpTimeoutSecs) * time.Second
|
||||||
|
|
||||||
collector := newSolanaCollector(*rpcAddr)
|
collector := NewSolanaCollector(*rpcAddr)
|
||||||
|
|
||||||
go collector.WatchSlots()
|
go collector.WatchSlots()
|
||||||
|
|
||||||
|
|
|
@ -87,11 +87,8 @@ func (c *Client) rpcRequest(ctx context.Context, data io.Reader) ([]byte, error)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer func() {
|
//goland:noinspection GoUnhandledErrorResult
|
||||||
if err := resp.Body.Close(); err != nil {
|
defer resp.Body.Close()
|
||||||
klog.Errorf("could not close response body: %v", err)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
body, err := io.ReadAll(resp.Body)
|
body, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue