mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 15:16:42 +00:00
lib/promscrape: use strconv.Atoi instead of strconv.ParseInt for parsing -promscrape.cluster.memberNum
In this case there is no need in converting int64 to int
This commit is contained in:
parent
264b98192e
commit
386f6110ec
1 changed files with 2 additions and 2 deletions
|
@ -68,11 +68,11 @@ func mustInitClusterMemberID() {
|
||||||
if idx := strings.LastIndexByte(s, '-'); idx >= 0 {
|
if idx := strings.LastIndexByte(s, '-'); idx >= 0 {
|
||||||
s = s[idx+1:]
|
s = s[idx+1:]
|
||||||
}
|
}
|
||||||
n, err := strconv.ParseInt(s, 10, 64)
|
n, err := strconv.Atoi(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Fatalf("cannot parse -promscrape.cluster.memberNum=%q: %s", *clusterMemberNum, err)
|
logger.Fatalf("cannot parse -promscrape.cluster.memberNum=%q: %s", *clusterMemberNum, err)
|
||||||
}
|
}
|
||||||
clusterMemberID = int(n)
|
clusterMemberID = n
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config represents essential parts from Prometheus config defined at https://prometheus.io/docs/prometheus/latest/configuration/configuration/
|
// Config represents essential parts from Prometheus config defined at https://prometheus.io/docs/prometheus/latest/configuration/configuration/
|
||||||
|
|
Loading…
Reference in a new issue