benchmark.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/sh
  2. # Here we test the limit of the number of layers
  3. # @preprocess
  4. # The region setting should work for UTM and LL test locations
  5. # temporary disabled test for performance reason
  6. g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
  7. export GRASS_OVERWRITE=1
  8. MAP_LIST="map_list.txt"
  9. rm ${MAP_LIST}
  10. NUM_MAPS=10000
  11. echo "### Generate raster maps"
  12. count=1
  13. while [ $count -lt ${NUM_MAPS} ]; do
  14. name="test_bench_${count}"
  15. r.mapcalc --quiet expr="${name} = ${count}"
  16. echo ${name} >> ${MAP_LIST}
  17. count=$((count + 1))
  18. done
  19. echo "### Create space time datasets"
  20. time t.create type=strds temporaltype=absolute output=bench1 title="Bench1" descr="Bench1"
  21. time t.create type=strds temporaltype=absolute output=bench2 title="Bench2" descr="Bench2"
  22. time t.create type=strds temporaltype=absolute output=bench3 title="Bench3" descr="Bench3"
  23. time t.create type=strds temporaltype=absolute output=bench4 title="Bench4" descr="Bench4"
  24. echo "### Register maps"
  25. time t.register -i input=bench1 file=${MAP_LIST} start="2001-01-01 00:00:00" increment="1 day"
  26. echo "### Register maps again"
  27. time t.register input=bench2 file=${MAP_LIST}
  28. echo "### Register maps again"
  29. time t.register input=bench3 file=${MAP_LIST}
  30. echo "### Register maps again"
  31. time t.register input=bench4 file=${MAP_LIST}
  32. echo "### List maps"
  33. time t.rast.list input=bench1 column=name,start_time > "/dev/null"
  34. time t.rast.list input=bench2 column=name,start_time > "/dev/null"
  35. time t.rast.list input=bench3 column=name,start_time,end_time \
  36. where="start_time > '2001-01-01'" > "/dev/null"
  37. time t.rast.list input=bench4 column=name,start_time,end_time,min,max \
  38. where="start_time > '2001-01-01'" > "/dev/null"
  39. echo "### STRDS Infos"
  40. t.info bench1
  41. t.info bench2
  42. t.info bench3
  43. t.info bench4
  44. echo "### Remove STRDS and maps"
  45. time t.remove type=strds input=bench1
  46. time t.remove type=strds input=bench2
  47. time t.remove type=strds input=bench3
  48. time t.remove -rf type=strds input=bench4