Skip to content

Commit

Permalink
Fix lag issue (#243)
Browse files Browse the repository at this point in the history
* Fix lag issue

by postponing url update to after 0.75 s  any change

* Intermediate step for url

Just changed the text to say the url is bookmarkable
(Should be updated dynamically too but later)
  • Loading branch information
ldemailly committed May 1, 2018
1 parent 9caaac8 commit c6cd9fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion ui/static/js/fortio_chart.js
Expand Up @@ -446,9 +446,13 @@ function getCurrentChart () {
return currentChart
}

var timeoutID = 0
function updateChart (chart = getCurrentChart()) {
updateQueryString()
updateChartOptions(chart)
if (timeoutID > 0) {
clearTimeout(timeoutID)
}
timeoutID = setTimeout("updateQueryString()", 750)
}

function multiLabel (res) {
Expand Down
4 changes: 2 additions & 2 deletions ui/templates/browse.html
Expand Up @@ -41,7 +41,7 @@ <h1>Φορτίο (fortio) v{{.Version}}{{.Extra}}</h1>
}).catch(err => { throw err })
} else {
var urldiv = document.getElementById('url')
urldiv.innerHTML = "Multiple runs..."
urldiv.innerHTML = "Multiple runs (URL is a permalink)..."
if (list.length == 2) {
var urlA = list[0].value
var dataPromiseA = fetch("data/"+urlA)
Expand Down Expand Up @@ -91,7 +91,7 @@ <h1>Φορτίο (fortio) v{{.Version}}{{.Extra}}</h1>
<br />
Filter:<form><input id="searchinp" name="s" type="text" size=20 value="{{.Search}}" /></form>
</td><td>
<select id="files" size=7 onchange="updateQueryString(); fortio_load(value);" multiple>
<select id="files" size=7 onchange="fortio_load(value);" multiple>
{{range .PreselectedDataList}}
<option value="{{.Value}}.json" {{if .Selected}} selected {{end}}>{{.Value}}</option>
{{end}}
Expand Down

0 comments on commit c6cd9fd

Please sign in to comment.