mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 19:08:58 +00:00
all: Minor deprecation updates
This commit is contained in:
parent
5958f42294
commit
79f8bd0f33
@ -10,6 +10,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
|
"github.com/prometheus/client_golang/prometheus/collectors"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -109,7 +110,7 @@ func init() {
|
|||||||
databaseKeys, databaseStatisticsSeconds,
|
databaseKeys, databaseStatisticsSeconds,
|
||||||
databaseOperations, databaseOperationSeconds)
|
databaseOperations, databaseOperationSeconds)
|
||||||
|
|
||||||
processCollectorOpts := prometheus.ProcessCollectorOpts{
|
processCollectorOpts := collectors.ProcessCollectorOpts{
|
||||||
Namespace: "syncthing_discovery",
|
Namespace: "syncthing_discovery",
|
||||||
PidFn: func() (int, error) {
|
PidFn: func() (int, error) {
|
||||||
return os.Getpid(), nil
|
return os.Getpid(), nil
|
||||||
@ -117,7 +118,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
prometheus.MustRegister(
|
prometheus.MustRegister(
|
||||||
prometheus.NewProcessCollector(processCollectorOpts),
|
collectors.NewProcessCollector(processCollectorOpts),
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,8 @@ import (
|
|||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
"github.com/oschwald/geoip2-golang"
|
"github.com/oschwald/geoip2-golang"
|
||||||
|
"golang.org/x/text/cases"
|
||||||
|
"golang.org/x/text/language"
|
||||||
|
|
||||||
"github.com/syncthing/syncthing/lib/upgrade"
|
"github.com/syncthing/syncthing/lib/upgrade"
|
||||||
"github.com/syncthing/syncthing/lib/ur/contract"
|
"github.com/syncthing/syncthing/lib/ur/contract"
|
||||||
@ -773,7 +775,7 @@ func getReport(db *sql.DB) map[string]interface{} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for transport, count := range rep.TransportStats {
|
for transport, count := range rep.TransportStats {
|
||||||
add(featureGroups["Connection"]["v3"], "Transport", strings.Title(transport), count)
|
add(featureGroups["Connection"]["v3"], "Transport", cases.Title(language.English).String(transport), count)
|
||||||
if strings.HasSuffix(transport, "4") {
|
if strings.HasSuffix(transport, "4") {
|
||||||
add(featureGroups["Connection"]["v3"], "IP version", "IPv4", count)
|
add(featureGroups["Connection"]["v3"], "IP version", "IPv4", count)
|
||||||
} else if strings.HasSuffix(transport, "6") {
|
} else if strings.HasSuffix(transport, "6") {
|
||||||
|
Loading…
Reference in New Issue
Block a user