Skip to content

Commit ac1b4e0

Browse files
committed
optimize graphs scaling and some linting
1 parent fbef498 commit ac1b4e0

File tree

4 files changed

+30
-34
lines changed

4 files changed

+30
-34
lines changed

fioviewer.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,34 @@
44
package main
55

66
import (
7-
"flag"
7+
"flag"
88

9-
gin "gopkg.in/gin-gonic/gin.v1"
9+
gin "gopkg.in/gin-gonic/gin.v1"
1010

11-
"github.com/project0/fioviewer/pkg/fiolog"
12-
"github.com/project0/fioviewer/pkg/api"
11+
"github.com/project0/fioviewer/pkg/api"
12+
"github.com/project0/fioviewer/pkg/fiolog"
1313
)
1414

1515
func main() {
1616

17-
dir := flag.String("dir", ".", "Path to the fio log files")
18-
listen := flag.String("listen", ":8080", "Listen to this ip:port")
19-
staticDir := flag.String("static", ".", "Path to the static (dist) files of the WebUI")
17+
dir := flag.String("dir", ".", "Path to the fio log files")
18+
listen := flag.String("listen", ":8080", "Listen to this ip:port")
19+
staticDir := flag.String("static", ".", "Path to the static (dist) files of the WebUI")
2020

21-
flag.Parse()
21+
flag.Parse()
2222

23-
fiolog.Register(dir)
23+
fiolog.Register(dir)
2424

25-
gin.SetMode(gin.DebugMode)
26-
router := gin.Default()
25+
gin.SetMode(gin.DebugMode)
26+
router := gin.Default()
2727

28-
// Serve static files for UI components.
29-
router.StaticFile("/index.html", *staticDir+"/index.html")
30-
router.StaticFile("/", *staticDir+"/index.html")
31-
router.Static("/static/", *staticDir+"/static/")
28+
// Serve static files for UI components.
29+
router.StaticFile("/index.html", *staticDir+"/index.html")
30+
router.StaticFile("/", *staticDir+"/index.html")
31+
router.Static("/static/", *staticDir+"/static/")
3232

33-
// add api routes
34-
api.Register(router)
33+
// add api routes
34+
api.Register(router)
3535

36-
router.Run(*listen)
36+
router.Run(*listen)
3737
}

pkg/fiolog/fiodir.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package fiolog
22

33
import (
4-
"os"
5-
"strings"
64
"fmt"
5+
"os"
76
"path/filepath"
7+
"strings"
88
)
99

1010
// FioPathHandler provides handy mechanism to fio log paths

src/components/Graph.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</label>
3535
</div>
3636

37-
Start offset: <input class="form-control" type="text" v-model="range.start">
37+
Start offset: <input class="form-control" type="text" v-model="range.start"> End <input class="form-control" type="text" v-model="range.end">
3838
<hr>
3939
<div v-for="n, i in files">
4040
<select class="custom-select" v-model.trim="files[i]">
@@ -85,6 +85,9 @@
8585
yAxes: [
8686
{
8787
ticks: {
88+
min: 0,
89+
suggestedMin: 0,
90+
beginAtZero: true,
8891
callback: function (label, index, labels) {
8992
return label
9093
}

src/components/chartjs/LineChart.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,13 @@ export default Vue.extend({
6363
'hour': 'H:mm [h]'
6464
}
6565
}
66-
}]
67-
},
68-
yAxes: [{
69-
ticks: {
70-
beginAtZero: false,
71-
callback: function (value, index, values) {
72-
return value + ' KiB'
66+
}],
67+
yAxes: [{
68+
gridLines: {
69+
display: true
7370
}
74-
},
75-
gridLines: {
76-
display: true
77-
},
78-
format: 'SSS [ms]'
79-
}]
71+
}]
72+
}
8073
}
8174
}
8275
},

0 commit comments

Comments
 (0)