Add stopswatch for speed of Get()
This commit is contained in:
parent
ca8afb0cbe
commit
cdc7f1a30c
4
file.go
4
file.go
|
@ -151,6 +151,8 @@ func convertBlocksToListItems(current string, blocks BlockResponse, indent int)
|
|||
}
|
||||
|
||||
func (fp *FilePages) Get(title string) Page {
|
||||
var sw stopwatch
|
||||
sw.Start("Get " + title)
|
||||
// TODO: cleanup loading of pages
|
||||
// TODO: convert all pages to blocks
|
||||
name := title
|
||||
|
@ -206,6 +208,8 @@ func (fp *FilePages) Get(title string) Page {
|
|||
|
||||
err = json.NewEncoder(&buf).Encode(&listItems)
|
||||
|
||||
sw.Stop()
|
||||
|
||||
return Page{
|
||||
Name: name,
|
||||
Title: blocks.Texts[name],
|
||||
|
|
Loading…
Reference in New Issue
Block a user