mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-22 18:33:34 +08:00
refactoring
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package weed_server
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
@@ -88,15 +87,7 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
|
||||
readonlyMux.HandleFunc("/", fs.readonlyFilerHandler)
|
||||
}
|
||||
|
||||
stats.StartPushingMetric("filer", sourceName(option.Port), stats.FilerGather, option.MetricsAddress, option.MetricsIntervalSec)
|
||||
stats.StartPushingMetric("filer", stats.SourceName(option.Port), stats.FilerGather, option.MetricsAddress, option.MetricsIntervalSec)
|
||||
|
||||
return fs, nil
|
||||
}
|
||||
|
||||
func sourceName(port int) string {
|
||||
hostname, err := os.Hostname()
|
||||
if err != nil {
|
||||
return "unknown"
|
||||
}
|
||||
return fmt.Sprintf("%s_%d", hostname, port)
|
||||
}
|
||||
|
Reference in New Issue
Block a user