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
|
||||
}
|
||||
|
||||
func newSolanaCollector(rpcAddr string) *solanaCollector {
|
||||
func NewSolanaCollector(rpcAddr string) *solanaCollector {
|
||||
return &solanaCollector{
|
||||
rpcClient: rpc.NewRPCClient(rpcAddr),
|
||||
totalValidatorsDesc: prometheus.NewDesc(
|
||||
|
@ -132,7 +132,7 @@ func main() {
|
|||
|
||||
httpTimeout = time.Duration(*httpTimeoutSecs) * time.Second
|
||||
|
||||
collector := newSolanaCollector(*rpcAddr)
|
||||
collector := NewSolanaCollector(*rpcAddr)
|
||||
|
||||
go collector.WatchSlots()
|
||||
|
||||
|
|
|
@ -87,11 +87,8 @@ func (c *Client) rpcRequest(ctx context.Context, data io.Reader) ([]byte, error)
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer func() {
|
||||
if err := resp.Body.Close(); err != nil {
|
||||
klog.Errorf("could not close response body: %v", err)
|
||||
}
|
||||
}()
|
||||
//goland:noinspection GoUnhandledErrorResult
|
||||
defer resp.Body.Close()
|
||||
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue