forked from TrueCloudLab/frostfs-node
[#782] locode: Add benchmark
Signed-off-by: nesterfifa <vemeyzer@gmail.com>
This commit is contained in:
parent
7578fd46e5
commit
cc27dbcb78
1 changed files with 30 additions and 0 deletions
30
cmd/frostfs-cli/modules/util/locode_generate_test.go
Normal file
30
cmd/frostfs-cli/modules/util/locode_generate_test.go
Normal file
|
@ -0,0 +1,30 @@
|
|||
package util
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var (
|
||||
in = flag.String(locodeGenerateInputFlag, "", "List of paths to UN/LOCODE tables (csv)")
|
||||
subdiv = flag.String(locodeGenerateSubDivFlag, "", "Path to UN/LOCODE subdivision database (csv)")
|
||||
airports = flag.String(locodeGenerateAirportsFlag, "", "Path to OpenFlights airport database (csv)")
|
||||
countries = flag.String(locodeGenerateCountriesFlag, "", "Path to OpenFlights country database (csv)")
|
||||
continents = flag.String(locodeGenerateContinentsFlag, "", "Path to continent polygons (GeoJSON)")
|
||||
out = flag.String(locodeGenerateOutputFlag, "", "Target path for generated database")
|
||||
)
|
||||
|
||||
func BenchmarkLocodeGenerate(b *testing.B) {
|
||||
locodeGenerateInPaths = append(locodeGenerateInPaths, *in)
|
||||
locodeGenerateSubDivPath = *subdiv
|
||||
locodeGenerateAirportsPath = *airports
|
||||
locodeGenerateCountriesPath = *countries
|
||||
locodeGenerateContinentsPath = *continents
|
||||
locodeGenerateOutPath = *out
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
locodeGenerateCmd.Run(locodeGenerateCmd, []string{})
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue