Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ticks better #371

Merged
merged 2 commits into from
Jun 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions api/handler/trigger_render.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import (
"strconv"
"time"

"github.com/beevee/go-chart"
"github.com/go-chi/render"
"github.com/go-graphite/carbonapi/date"
"github.com/moira-alert/moira/metric_source"
"github.com/wcharczuk/go-chart"

"github.com/moira-alert/moira"
"github.com/moira-alert/moira/api"
"github.com/moira-alert/moira/api/controller"
"github.com/moira-alert/moira/api/middleware"
"github.com/moira-alert/moira/metric_source"
"github.com/moira-alert/moira/plotting"
)

Expand Down
2 changes: 1 addition & 1 deletion interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package moira
import (
"time"

"github.com/wcharczuk/go-chart"
"github.com/beevee/go-chart"
"gopkg.in/tomb.v2"
)

Expand Down
5 changes: 2 additions & 3 deletions notifier/plotting.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import (
"fmt"
"time"

"github.com/beevee/go-chart"
"github.com/moira-alert/moira"
"github.com/moira-alert/moira/metric_source"
"github.com/moira-alert/moira/metric_source/local"
"github.com/wcharczuk/go-chart"

"github.com/moira-alert/moira"
"github.com/moira-alert/moira/plotting"
)

Expand Down
Binary file modified plotting/_examples/dark.expression.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.expression.humanized.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.falling.error.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.falling.error.humanized.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.falling.stateOk.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.falling.stateOk.humanized.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.falling.warn.error.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.falling.warn.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.falling.warn.humanized.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.rising.error.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.rising.error.humanized.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.rising.stateOk.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.rising.stateOk.humanized.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.rising.warn.error.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.rising.warn.error.humanized.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.rising.warn.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/dark.rising.warn.humanized.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/light.expression.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/light.expression.humanized.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/light.falling.error.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/light.falling.error.humanized.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/light.falling.stateOk.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/light.falling.stateOk.humanized.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/light.falling.warn.error.example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified plotting/_examples/light.falling.warn.example.png
Binary file modified plotting/_examples/light.falling.warn.humanized.example.png
Binary file modified plotting/_examples/light.rising.error.example.png
Binary file modified plotting/_examples/light.rising.error.humanized.example.png
Binary file modified plotting/_examples/light.rising.stateOk.example.png
Binary file modified plotting/_examples/light.rising.stateOk.humanized.example.png
Binary file modified plotting/_examples/light.rising.warn.error.example.png
Binary file modified plotting/_examples/light.rising.warn.example.png
Binary file modified plotting/_examples/light.rising.warn.humanized.example.png
5 changes: 2 additions & 3 deletions plotting/curve.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import (
"math"
"time"

"github.com/moira-alert/moira/metric_source"
"github.com/wcharczuk/go-chart"

"github.com/beevee/go-chart"
"github.com/moira-alert/moira"
"github.com/moira-alert/moira/metric_source"
)

// plotCurve is a single curve for given timeserie
Expand Down
5 changes: 2 additions & 3 deletions plotting/curve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import (
"testing"
"time"

"github.com/beevee/go-chart"
"github.com/moira-alert/moira"
"github.com/moira-alert/moira/metric_source"
. "github.com/smartystreets/goconvey/convey"
"github.com/wcharczuk/go-chart"

"github.com/moira-alert/moira"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion plotting/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"time"
"unicode/utf8"

"github.com/beevee/go-chart"
"github.com/dustin/go-humanize"
"github.com/wcharczuk/go-chart"
)

// sortedByLen represents string array to be sorted by length
Expand Down
2 changes: 1 addition & 1 deletion plotting/legend.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package plotting
import (
"sort"

"github.com/wcharczuk/go-chart"
"github.com/beevee/go-chart"
)

const (
Expand Down
9 changes: 4 additions & 5 deletions plotting/limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import (
"math"
"time"

"github.com/moira-alert/moira/metric_source"
"github.com/wcharczuk/go-chart"
"github.com/wcharczuk/go-chart/util"

"github.com/beevee/go-chart"
"github.com/beevee/go-chart/util"
"github.com/moira-alert/moira"
"github.com/moira-alert/moira/metric_source"
)

const (
Expand Down Expand Up @@ -42,7 +41,7 @@ func resolveLimits(metricsData []*metricSource.MetricData) plotLimits {
allTimes = append(allTimes, moira.Int64ToTime(metricData.StartTime))
allTimes = append(allTimes, moira.Int64ToTime(metricData.StopTime))
}
from, to := util.Math.MinAndMaxOfTime(allTimes...)
from, to := util.Time.StartAndEnd(allTimes...)
lowest, highest := util.Math.MinAndMax(allValues...)
if highest == lowest {
highest = highest + (defaultRangeDelta / 2)
Expand Down
5 changes: 2 additions & 3 deletions plotting/limits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import (
"testing"
"time"

"github.com/beevee/go-chart"
"github.com/moira-alert/moira"
"github.com/moira-alert/moira/metric_source"
. "github.com/smartystreets/goconvey/convey"
"github.com/wcharczuk/go-chart"

"github.com/moira-alert/moira"
)

// TestResolveLimits tests plot limits will be calculated correctly for any metricData array
Expand Down
6 changes: 3 additions & 3 deletions plotting/plot.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import (
"fmt"
"time"

"github.com/moira-alert/moira/metric_source"
"github.com/wcharczuk/go-chart"

"github.com/beevee/go-chart"
"github.com/moira-alert/moira"
"github.com/moira-alert/moira/metric_source"
)

// ErrNoPointsToRender is used to prevent unnecessary render calls
Expand Down Expand Up @@ -110,6 +109,7 @@ func (plot *Plot) GetRenderable(trigger *moira.Trigger, metricsData []*metricSou
Max: limits.highest,
Min: limits.lowest,
},
EnablePrettyTicks: true,
},

Series: plotSeries,
Expand Down
5 changes: 2 additions & 3 deletions plotting/plot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ import (
"testing"
"time"

"github.com/beevee/go-chart"
"github.com/gotokatsuya/ipare"
"github.com/gotokatsuya/ipare/util"
"github.com/moira-alert/moira"
"github.com/moira-alert/moira/metric_source"
. "github.com/smartystreets/goconvey/convey"
"github.com/wcharczuk/go-chart"

"github.com/moira-alert/moira"
)

const (
Expand Down
5 changes: 2 additions & 3 deletions plotting/themes/dark/dark.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package dark

import (
"github.com/beevee/go-chart"
"github.com/beevee/go-chart/drawing"
"github.com/golang/freetype/truetype"

"github.com/wcharczuk/go-chart"
"github.com/wcharczuk/go-chart/drawing"
)

// PlotTheme implements moira.PlotTheme interface
Expand Down
5 changes: 2 additions & 3 deletions plotting/themes/light/light.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package light

import (
"github.com/beevee/go-chart"
"github.com/beevee/go-chart/drawing"
"github.com/golang/freetype/truetype"

"github.com/wcharczuk/go-chart"
"github.com/wcharczuk/go-chart/drawing"
)

// PlotTheme implements moira.PlotTheme interface
Expand Down
3 changes: 1 addition & 2 deletions plotting/threshold.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package plotting
import (
"time"

"github.com/wcharczuk/go-chart"

"github.com/beevee/go-chart"
"github.com/moira-alert/moira"
)

Expand Down
72 changes: 36 additions & 36 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,42 @@
"revision": "1fca145dffbcaa8fe914309b1ec0cfc67500fe61",
"revisionTime": "2017-07-27T15:54:43Z"
},
{
"checksumSHA1": "lJvgxnk2MNkNL01vM28mW3YOk7E=",
"path": "github.com/beevee/go-chart",
"revision": "273a59e48bccb0668388eb89faeaba1e061fc823",
"revisionTime": "2019-05-23T09:00:23Z"
},
{
"checksumSHA1": "EATdwpdmNIMoRH83jpegphBSLZ0=",
"path": "github.com/beevee/go-chart/drawing",
"revision": "273a59e48bccb0668388eb89faeaba1e061fc823",
"revisionTime": "2019-05-23T09:00:23Z"
},
{
"checksumSHA1": "sQ45SWP3px236i69OrcwAQSY5es=",
"path": "github.com/beevee/go-chart/matrix",
"revision": "273a59e48bccb0668388eb89faeaba1e061fc823",
"revisionTime": "2019-05-23T09:00:23Z"
},
{
"checksumSHA1": "R/SvHFvbFSZQuOO+QpozI/yV4VI=",
"path": "github.com/beevee/go-chart/roboto",
"revision": "273a59e48bccb0668388eb89faeaba1e061fc823",
"revisionTime": "2019-05-23T09:00:23Z"
},
{
"checksumSHA1": "V7cWd6571hW+qFIs8m8zeNLenqA=",
"path": "github.com/beevee/go-chart/seq",
"revision": "273a59e48bccb0668388eb89faeaba1e061fc823",
"revisionTime": "2019-05-23T09:00:23Z"
},
{
"checksumSHA1": "NMggTt9psQ+Vfilzg9swc4Rql3U=",
"path": "github.com/beevee/go-chart/util",
"revision": "273a59e48bccb0668388eb89faeaba1e061fc823",
"revisionTime": "2019-05-23T09:00:23Z"
},
{
"checksumSHA1": "xM5+MU1gVB7+aGfVj+J57EgDcAE=",
"path": "github.com/blevesearch/bleve",
Expand Down Expand Up @@ -1034,42 +1070,6 @@
"revision": "ccac7217894801a5a6ceb8602a70ea0d79e975cf",
"revisionTime": "2018-07-29T13:10:59Z"
},
{
"checksumSHA1": "qBezoyl/lOefhEanygFUC+VBGpY=",
"path": "github.com/wcharczuk/go-chart",
"revision": "9e3a080aa3e7573281cf8d65a55305e1148d857d",
"revisionTime": "2018-04-15T23:53:01Z"
},
{
"checksumSHA1": "/Amn4XivPItINSALiV/uQF8ogNw=",
"path": "github.com/wcharczuk/go-chart/drawing",
"revision": "9e3a080aa3e7573281cf8d65a55305e1148d857d",
"revisionTime": "2018-04-15T23:53:01Z"
},
{
"checksumSHA1": "kPqs986jHunAn+grWysGPIABnQc=",
"path": "github.com/wcharczuk/go-chart/matrix",
"revision": "9e3a080aa3e7573281cf8d65a55305e1148d857d",
"revisionTime": "2018-04-15T23:53:01Z"
},
{
"checksumSHA1": "XJZ8xjTjszuaBenrG5kB+jO1w/o=",
"path": "github.com/wcharczuk/go-chart/roboto",
"revision": "9e3a080aa3e7573281cf8d65a55305e1148d857d",
"revisionTime": "2018-04-15T23:53:01Z"
},
{
"checksumSHA1": "Nvz05DuOqW3vgIJ6JekXqD0jP20=",
"path": "github.com/wcharczuk/go-chart/seq",
"revision": "9e3a080aa3e7573281cf8d65a55305e1148d857d",
"revisionTime": "2018-04-15T23:53:01Z"
},
{
"checksumSHA1": "Mzvq7OaP/22QA81qZZ48u0e6rX4=",
"path": "github.com/wcharczuk/go-chart/util",
"revision": "9e3a080aa3e7573281cf8d65a55305e1148d857d",
"revisionTime": "2018-04-15T23:53:01Z"
},
{
"checksumSHA1": "hmFg3XngBr7UwrCBQve5JW/gl88=",
"path": "github.com/willf/bitset",
Expand Down