mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 10:28:49 -07:00
all: Minor deprecation updates
This commit is contained in:
parent
5958f42294
commit
79f8bd0f33
@ -10,6 +10,7 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/collectors"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -109,7 +110,7 @@ func init() {
|
||||
databaseKeys, databaseStatisticsSeconds,
|
||||
databaseOperations, databaseOperationSeconds)
|
||||
|
||||
processCollectorOpts := prometheus.ProcessCollectorOpts{
|
||||
processCollectorOpts := collectors.ProcessCollectorOpts{
|
||||
Namespace: "syncthing_discovery",
|
||||
PidFn: func() (int, error) {
|
||||
return os.Getpid(), nil
|
||||
@ -117,7 +118,7 @@ func init() {
|
||||
}
|
||||
|
||||
prometheus.MustRegister(
|
||||
prometheus.NewProcessCollector(processCollectorOpts),
|
||||
collectors.NewProcessCollector(processCollectorOpts),
|
||||
)
|
||||
|
||||
}
|
||||
|
@ -26,6 +26,8 @@ import (
|
||||
"unicode"
|
||||
|
||||
"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/ur/contract"
|
||||
@ -773,7 +775,7 @@ func getReport(db *sql.DB) map[string]interface{} {
|
||||
}
|
||||
|
||||
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") {
|
||||
add(featureGroups["Connection"]["v3"], "IP version", "IPv4", count)
|
||||
} else if strings.HasSuffix(transport, "6") {
|
||||
|
Loading…
Reference in New Issue
Block a user