allow -httpprofile for diff import
parent
0461fd56fe
commit
60a4eb7f4d
|
@ -32,6 +32,7 @@ type _BaseOptions struct {
|
||||||
LimitTo string
|
LimitTo string
|
||||||
LimitToCacheBuffer float64
|
LimitToCacheBuffer float64
|
||||||
ConfigFile string
|
ConfigFile string
|
||||||
|
Httpprofile string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *_BaseOptions) updateFromConfig() error {
|
func (o *_BaseOptions) updateFromConfig() error {
|
||||||
|
@ -88,9 +89,6 @@ func (o *_BaseOptions) check() []error {
|
||||||
}
|
}
|
||||||
|
|
||||||
type _ImportOptions struct {
|
type _ImportOptions struct {
|
||||||
Cpuprofile string
|
|
||||||
Httpprofile string
|
|
||||||
Memprofile string
|
|
||||||
Overwritecache bool
|
Overwritecache bool
|
||||||
Appendcache bool
|
Appendcache bool
|
||||||
Read string
|
Read string
|
||||||
|
@ -113,6 +111,7 @@ func addBaseFlags(flags *flag.FlagSet) {
|
||||||
flags.IntVar(&BaseOptions.Srid, "srid", defaultSrid, "srs id")
|
flags.IntVar(&BaseOptions.Srid, "srid", defaultSrid, "srs id")
|
||||||
flags.StringVar(&BaseOptions.LimitTo, "limitto", "", "limit to geometries")
|
flags.StringVar(&BaseOptions.LimitTo, "limitto", "", "limit to geometries")
|
||||||
flags.StringVar(&BaseOptions.ConfigFile, "config", "", "config (json)")
|
flags.StringVar(&BaseOptions.ConfigFile, "config", "", "config (json)")
|
||||||
|
flags.StringVar(&BaseOptions.Httpprofile, "httpprofile", "", "bind address for profile server")
|
||||||
}
|
}
|
||||||
|
|
||||||
func UsageImport() {
|
func UsageImport() {
|
||||||
|
@ -133,9 +132,6 @@ func init() {
|
||||||
|
|
||||||
addBaseFlags(DiffFlags)
|
addBaseFlags(DiffFlags)
|
||||||
addBaseFlags(ImportFlags)
|
addBaseFlags(ImportFlags)
|
||||||
ImportFlags.StringVar(&ImportOptions.Cpuprofile, "cpuprofile", "", "filename of cpu profile output")
|
|
||||||
ImportFlags.StringVar(&ImportOptions.Httpprofile, "httpprofile", "", "bind address for profile server")
|
|
||||||
ImportFlags.StringVar(&ImportOptions.Memprofile, "memprofile", "", "dir name of mem profile output and interval (fname:interval)")
|
|
||||||
ImportFlags.BoolVar(&ImportOptions.Overwritecache, "overwritecache", false, "overwritecache")
|
ImportFlags.BoolVar(&ImportOptions.Overwritecache, "overwritecache", false, "overwritecache")
|
||||||
ImportFlags.BoolVar(&ImportOptions.Appendcache, "appendcache", false, "append cache")
|
ImportFlags.BoolVar(&ImportOptions.Appendcache, "appendcache", false, "append cache")
|
||||||
ImportFlags.StringVar(&ImportOptions.Read, "read", "", "read")
|
ImportFlags.StringVar(&ImportOptions.Read, "read", "", "read")
|
||||||
|
|
|
@ -42,13 +42,15 @@ func main() {
|
||||||
switch os.Args[1] {
|
switch os.Args[1] {
|
||||||
case "import":
|
case "import":
|
||||||
config.ParseImport(os.Args[2:])
|
config.ParseImport(os.Args[2:])
|
||||||
if config.ImportOptions.Httpprofile != "" {
|
if config.BaseOptions.Httpprofile != "" {
|
||||||
stats.StartHttpPProf(config.ImportOptions.Httpprofile)
|
stats.StartHttpPProf(config.BaseOptions.Httpprofile)
|
||||||
}
|
}
|
||||||
import_.Import()
|
import_.Import()
|
||||||
case "diff":
|
case "diff":
|
||||||
config.ParseDiffImport(os.Args[2:])
|
config.ParseDiffImport(os.Args[2:])
|
||||||
|
if config.BaseOptions.Httpprofile != "" {
|
||||||
|
stats.StartHttpPProf(config.BaseOptions.Httpprofile)
|
||||||
|
}
|
||||||
var geometryLimiter *limit.Limiter
|
var geometryLimiter *limit.Limiter
|
||||||
if config.BaseOptions.LimitTo != "" {
|
if config.BaseOptions.LimitTo != "" {
|
||||||
var err error
|
var err error
|
||||||
|
|
Loading…
Reference in New Issue