Skip to content

Commit aa8f3de

Browse files
committed
collectors: fix linter issues
1 parent f363224 commit aa8f3de

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

collectors/channels_collector.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/prometheus/client_golang/prometheus"
1212
)
1313

14-
// ChannelsCollector is a collector that keeps track of channel infromation.
14+
// ChannelsCollector is a collector that keeps track of channel information.
1515
type ChannelsCollector struct {
1616
channelBalanceDesc *prometheus.Desc
1717
pendingChannelBalanceDesc *prometheus.Desc
@@ -279,7 +279,7 @@ func (c *ChannelsCollector) Collect(ch chan<- prometheus.Metric) {
279279
initiator := initiatorLabel(channel)
280280
peer := channel.PubKeyBytes.String()
281281

282-
chanIdStr := strconv.Itoa(int(channel.ChannelID))
282+
chanIDStr := strconv.Itoa(int(channel.ChannelID))
283283

284284
primaryChannel := c.primaryNode != nil &&
285285
channel.PubKeyBytes == *c.primaryNode
@@ -292,57 +292,57 @@ func (c *ChannelsCollector) Collect(ch chan<- prometheus.Metric) {
292292

293293
ch <- prometheus.MustNewConstMetric(
294294
c.incomingChanSatDesc, prometheus.GaugeValue,
295-
float64(channel.RemoteBalance), chanIdStr, status,
295+
float64(channel.RemoteBalance), chanIDStr, status,
296296
initiator, peer,
297297
)
298298
ch <- prometheus.MustNewConstMetric(
299299
c.outgoingChanSatDesc, prometheus.GaugeValue,
300-
float64(channel.LocalBalance), chanIdStr, status,
300+
float64(channel.LocalBalance), chanIDStr, status,
301301
initiator, peer,
302302
)
303303
ch <- prometheus.MustNewConstMetric(
304304
c.numPendingHTLCsDesc, prometheus.GaugeValue,
305-
float64(channel.NumPendingHtlcs), chanIdStr, status,
305+
float64(channel.NumPendingHtlcs), chanIDStr, status,
306306
initiator, peer,
307307
)
308308
ch <- prometheus.MustNewConstMetric(
309309
c.satsSentDesc, prometheus.GaugeValue,
310-
float64(channel.TotalSent), chanIdStr, status,
310+
float64(channel.TotalSent), chanIDStr, status,
311311
initiator, peer,
312312
)
313313
ch <- prometheus.MustNewConstMetric(
314314
c.satsRecvDesc, prometheus.GaugeValue,
315-
float64(channel.TotalReceived), chanIdStr, status,
315+
float64(channel.TotalReceived), chanIDStr, status,
316316
initiator, peer,
317317
)
318318
ch <- prometheus.MustNewConstMetric(
319319
c.numUpdatesDesc, prometheus.GaugeValue,
320-
float64(channel.NumUpdates), chanIdStr, status,
320+
float64(channel.NumUpdates), chanIDStr, status,
321321
initiator, peer,
322322
)
323323
ch <- prometheus.MustNewConstMetric(
324324
c.csvDelayDesc, prometheus.GaugeValue,
325-
float64(channel.LocalConstraints.CsvDelay), chanIdStr,
325+
float64(channel.LocalConstraints.CsvDelay), chanIDStr,
326326
status, initiator, peer,
327327
)
328328
ch <- prometheus.MustNewConstMetric(
329329
c.unsettledBalanceDesc, prometheus.GaugeValue,
330-
float64(channel.UnsettledBalance), chanIdStr, status,
330+
float64(channel.UnsettledBalance), chanIDStr, status,
331331
initiator, peer,
332332
)
333333
ch <- prometheus.MustNewConstMetric(
334334
c.feePerKwDesc, prometheus.GaugeValue,
335-
float64(channel.FeePerKw), chanIdStr, status, initiator,
335+
float64(channel.FeePerKw), chanIDStr, status, initiator,
336336
peer,
337337
)
338338
ch <- prometheus.MustNewConstMetric(
339339
c.commitWeightDesc, prometheus.GaugeValue,
340-
float64(channel.CommitWeight), chanIdStr, status,
340+
float64(channel.CommitWeight), chanIDStr, status,
341341
initiator, peer,
342342
)
343343
ch <- prometheus.MustNewConstMetric(
344344
c.commitFeeDesc, prometheus.GaugeValue,
345-
float64(channel.CommitFee), chanIdStr, status,
345+
float64(channel.CommitFee), chanIDStr, status,
346346
initiator, peer,
347347
)
348348

@@ -351,7 +351,7 @@ func (c *ChannelsCollector) Collect(ch chan<- prometheus.Metric) {
351351
ch <- prometheus.MustNewConstMetric(
352352
c.channelUptimeDesc, prometheus.GaugeValue,
353353
float64(channel.Uptime)/float64(channel.LifeTime),
354-
chanIdStr, status, initiator, peer,
354+
chanIDStr, status, initiator, peer,
355355
)
356356
}
357357
}

collectors/graph_collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ func (g *GraphCollector) Collect(ch chan<- prometheus.Metric) {
316316

317317
ch <- prometheus.MustNewConstMetric(
318318
g.avgOutDegreeDesc, prometheus.GaugeValue,
319-
float64(networkInfo.AvgOutDegree),
319+
networkInfo.AvgOutDegree,
320320
)
321321
ch <- prometheus.MustNewConstMetric(
322322
g.maxOutDegreeDesc, prometheus.GaugeValue,

collectors/log.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ var (
2525
// initLogRotator initializes the logging rotator to write logs to logFile and
2626
// create roll files in the same directory. It must be called before the
2727
// package-global log rotator variables are used.
28-
func initLogRotator(logFile string, MaxLogFileSize int, MaxLogFiles int) error {
28+
func initLogRotator(logFile string, maxLogFileSize int, maxLogFiles int) error {
2929
logDir, _ := filepath.Split(logFile)
3030
err := os.MkdirAll(logDir, 0700)
3131
if err != nil {
3232
return fmt.Errorf("failed to create log directory: %v", err)
3333
}
3434

3535
r, err := rotator.New(
36-
logFile, int64(MaxLogFileSize*1024), false, MaxLogFiles,
36+
logFile, int64(maxLogFileSize*1024), false, maxLogFiles,
3737
)
3838
if err != nil {
3939
return fmt.Errorf("failed to create file rotator: %v", err)

collectors/stats_compiler.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ func newStatsCompiler(numSamples uint32) statsCompiler {
3939

4040
// Observe logs a new value in the set of existing samples.
4141
func (s *statsCompiler) Observe(value float64) {
42-
4342
// First, we'll update our min/max, if needed.
4443
if value > s.max {
4544
s.max = value

collectors/wallet_collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func (u *WalletCollector) Collect(ch chan<- prometheus.Metric) {
164164
)
165165

166166
ch <- prometheus.MustNewConstMetric(
167-
u.avgUtxoSizeDesc, prometheus.GaugeValue, float64(avg),
167+
u.avgUtxoSizeDesc, prometheus.GaugeValue, avg,
168168
)
169169

170170
// Next, we'll query the wallet to determine our confirmed and unconf

0 commit comments

Comments
 (0)