Skip to content

Commit

Permalink
optimize graphs scaling and some linting
Browse files Browse the repository at this point in the history
  • Loading branch information
project0 committed Aug 4, 2017
1 parent fbef498 commit ac1b4e0
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 34 deletions.
36 changes: 18 additions & 18 deletions fioviewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@
package main

import (
"flag"
"flag"

gin "gopkg.in/gin-gonic/gin.v1"
gin "gopkg.in/gin-gonic/gin.v1"

"github.com/project0/fioviewer/pkg/fiolog"
"github.com/project0/fioviewer/pkg/api"
"github.com/project0/fioviewer/pkg/api"
"github.com/project0/fioviewer/pkg/fiolog"
)

func main() {

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

flag.Parse()
flag.Parse()

fiolog.Register(dir)
fiolog.Register(dir)

gin.SetMode(gin.DebugMode)
router := gin.Default()
gin.SetMode(gin.DebugMode)
router := gin.Default()

// Serve static files for UI components.
router.StaticFile("/index.html", *staticDir+"/index.html")
router.StaticFile("/", *staticDir+"/index.html")
router.Static("/static/", *staticDir+"/static/")
// Serve static files for UI components.
router.StaticFile("/index.html", *staticDir+"/index.html")
router.StaticFile("/", *staticDir+"/index.html")
router.Static("/static/", *staticDir+"/static/")

// add api routes
api.Register(router)
// add api routes
api.Register(router)

router.Run(*listen)
router.Run(*listen)
}
4 changes: 2 additions & 2 deletions pkg/fiolog/fiodir.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package fiolog

import (
"os"
"strings"
"fmt"
"os"
"path/filepath"
"strings"
)

// FioPathHandler provides handy mechanism to fio log paths
Expand Down
5 changes: 4 additions & 1 deletion src/components/Graph.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</label>
</div>

Start offset: <input class="form-control" type="text" v-model="range.start">
Start offset: <input class="form-control" type="text" v-model="range.start"> End <input class="form-control" type="text" v-model="range.end">
<hr>
<div v-for="n, i in files">
<select class="custom-select" v-model.trim="files[i]">
Expand Down Expand Up @@ -85,6 +85,9 @@
yAxes: [
{
ticks: {
min: 0,
suggestedMin: 0,
beginAtZero: true,
callback: function (label, index, labels) {
return label
}
Expand Down
19 changes: 6 additions & 13 deletions src/components/chartjs/LineChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,13 @@ export default Vue.extend({
'hour': 'H:mm [h]'
}
}
}]
},
yAxes: [{
ticks: {
beginAtZero: false,
callback: function (value, index, values) {
return value + ' KiB'
}],
yAxes: [{
gridLines: {
display: true
}
},
gridLines: {
display: true
},
format: 'SSS [ms]'
}]
}]
}
}
}
},
Expand Down

0 comments on commit ac1b4e0

Please sign in to comment.