tile render timing

This commit is contained in:
NatureFreshMilk 2019-01-21 16:27:31 +01:00
parent d0e23bb114
commit a2d8d3ba67
11 changed files with 36 additions and 32 deletions

View File

@ -5,8 +5,8 @@ import (
"mapserver/db"
"mapserver/mapblockaccessor"
"mapserver/mapblockrenderer"
"mapserver/params"
"mapserver/mapobjectdb"
"mapserver/params"
"mapserver/tilerenderer"
"mapserver/worldconfig"
)

View File

@ -5,8 +5,8 @@ import (
"mapserver/db"
"mapserver/mapblockaccessor"
"mapserver/mapblockrenderer"
"mapserver/params"
"mapserver/mapobjectdb"
"mapserver/params"
"mapserver/tilerenderer"
"mapserver/worldconfig"

View File

@ -4,6 +4,7 @@ import (
"github.com/sirupsen/logrus"
"mapserver/app"
"mapserver/coords"
"time"
)
func Job(ctx *app.App) {
@ -16,6 +17,8 @@ func Job(ctx *app.App) {
lastcoords := coords.NewMapBlockCoords(rstate.LastX, rstate.LastY, rstate.LastZ)
for true {
start := time.Now()
hasMore, newlastcoords, mblist, err := ctx.BlockAccessor.FindLegacyMapBlocks(lastcoords, ctx.Config.InitialRenderingFetchLimit, ctx.Config.Layers)
if err != nil {
@ -73,11 +76,15 @@ func Job(ctx *app.App) {
rstate.LastZ = lastcoords.Z
ctx.Config.Save()
t := time.Now()
elapsed := t.Sub(start)
fields = logrus.Fields{
"count": len(mblist),
"X": lastcoords.X,
"Y": lastcoords.Y,
"Z": lastcoords.Z,
"elapsed": elapsed,
}
logrus.WithFields(fields).Info("Initial rendering")
}

View File

@ -4,8 +4,8 @@ import (
"fmt"
"mapserver/coords"
"mapserver/db"
"mapserver/mapblockparser"
"mapserver/layer"
"mapserver/mapblockparser"
"time"
cache "github.com/patrickmn/go-cache"

View File

@ -10,7 +10,6 @@ type Tile struct {
Mtime int64
}
type MapObject struct {
//mapblock position
MBPos coords.MapBlockCoords

View File

@ -4,7 +4,6 @@ import (
"mapserver/coords"
)
func (db *Sqlite3Accessor) GetMapData(q SearchQuery) ([]MapObject, error) {
return nil, nil
}

View File

@ -6,7 +6,6 @@ import (
"mapserver/coords"
)
const getTileQuery = `
select data,mtime from tiles t
where t.layerid = ?

View File

@ -10,8 +10,8 @@ import (
"mapserver/layer"
"mapserver/mapblockaccessor"
"mapserver/mapblockrenderer"
"mapserver/testutils"
"mapserver/mapobjectdb"
"mapserver/testutils"
"os"
"testing"
)

View File

@ -1,10 +1,10 @@
package web
import (
"fmt"
"github.com/gorilla/websocket"
"mapserver/app"
"net/http"
"github.com/gorilla/websocket"
"fmt"
)
type WS struct {