From dbbdf667760d89bd75a2b42e6b8c4d3dfa666489 Mon Sep 17 00:00:00 2001 From: Alexey Kirpichnikov Date: Thu, 23 May 2019 14:12:36 +0500 Subject: [PATCH] Switch to fork --- api/handler/trigger_render.go | 5 +-- interfaces.go | 2 +- notifier/plotting.go | 5 +-- plotting/curve.go | 5 +-- plotting/curve_test.go | 5 +-- plotting/helpers.go | 2 +- plotting/legend.go | 2 +- plotting/limits.go | 9 ++--- plotting/limits_test.go | 5 +-- plotting/plot.go | 5 +-- plotting/plot_test.go | 5 +-- plotting/themes/dark/dark.go | 5 +-- plotting/themes/light/light.go | 5 +-- plotting/threshold.go | 3 +- vendor/vendor.json | 72 +++++++++++++++++----------------- 15 files changed, 62 insertions(+), 73 deletions(-) diff --git a/api/handler/trigger_render.go b/api/handler/trigger_render.go index b1c0aacc8..a4c5b341e 100644 --- a/api/handler/trigger_render.go +++ b/api/handler/trigger_render.go @@ -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" ) diff --git a/interfaces.go b/interfaces.go index f75b5829a..10434d47d 100644 --- a/interfaces.go +++ b/interfaces.go @@ -3,7 +3,7 @@ package moira import ( "time" - "github.com/wcharczuk/go-chart" + "github.com/beevee/go-chart" "gopkg.in/tomb.v2" ) diff --git a/notifier/plotting.go b/notifier/plotting.go index 5a78b9019..595c389f9 100644 --- a/notifier/plotting.go +++ b/notifier/plotting.go @@ -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" ) diff --git a/plotting/curve.go b/plotting/curve.go index 5bb04ef26..7f237cf9c 100644 --- a/plotting/curve.go +++ b/plotting/curve.go @@ -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 diff --git a/plotting/curve_test.go b/plotting/curve_test.go index b378c2026..777b96802 100644 --- a/plotting/curve_test.go +++ b/plotting/curve_test.go @@ -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 ( diff --git a/plotting/helpers.go b/plotting/helpers.go index 8003179cc..7ea637473 100644 --- a/plotting/helpers.go +++ b/plotting/helpers.go @@ -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 diff --git a/plotting/legend.go b/plotting/legend.go index 000fccc0b..8ca7a39b4 100644 --- a/plotting/legend.go +++ b/plotting/legend.go @@ -3,7 +3,7 @@ package plotting import ( "sort" - "github.com/wcharczuk/go-chart" + "github.com/beevee/go-chart" ) const ( diff --git a/plotting/limits.go b/plotting/limits.go index a00fb8047..2018d080d 100644 --- a/plotting/limits.go +++ b/plotting/limits.go @@ -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 ( @@ -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) diff --git a/plotting/limits_test.go b/plotting/limits_test.go index 336bc8542..36a220d29 100644 --- a/plotting/limits_test.go +++ b/plotting/limits_test.go @@ -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 diff --git a/plotting/plot.go b/plotting/plot.go index 7c8e62a89..1246e52e0 100644 --- a/plotting/plot.go +++ b/plotting/plot.go @@ -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 diff --git a/plotting/plot_test.go b/plotting/plot_test.go index f3c0593db..6658754c6 100644 --- a/plotting/plot_test.go +++ b/plotting/plot_test.go @@ -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 ( diff --git a/plotting/themes/dark/dark.go b/plotting/themes/dark/dark.go index 0d197a3a5..27484118e 100644 --- a/plotting/themes/dark/dark.go +++ b/plotting/themes/dark/dark.go @@ -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 diff --git a/plotting/themes/light/light.go b/plotting/themes/light/light.go index 467bb96d7..90c65e03b 100644 --- a/plotting/themes/light/light.go +++ b/plotting/themes/light/light.go @@ -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 diff --git a/plotting/threshold.go b/plotting/threshold.go index 1680628ff..0372a9a2b 100644 --- a/plotting/threshold.go +++ b/plotting/threshold.go @@ -3,8 +3,7 @@ package plotting import ( "time" - "github.com/wcharczuk/go-chart" - + "github.com/beevee/go-chart" "github.com/moira-alert/moira" ) diff --git a/vendor/vendor.json b/vendor/vendor.json index b4f2fde81..853340a64 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -47,6 +47,42 @@ "revision": "1fca145dffbcaa8fe914309b1ec0cfc67500fe61", "revisionTime": "2017-07-27T15:54:43Z" }, + { + "checksumSHA1": "xc1qpskje1lGl9fDH4iKnolAyxk=", + "path": "github.com/beevee/go-chart", + "revision": "3a6bc1cbdb31d4a955a4789acd65b35f91c70822", + "revisionTime": "2019-05-23T09:00:23Z" + }, + { + "checksumSHA1": "EATdwpdmNIMoRH83jpegphBSLZ0=", + "path": "github.com/beevee/go-chart/drawing", + "revision": "3a6bc1cbdb31d4a955a4789acd65b35f91c70822", + "revisionTime": "2019-05-23T09:00:23Z" + }, + { + "checksumSHA1": "sQ45SWP3px236i69OrcwAQSY5es=", + "path": "github.com/beevee/go-chart/matrix", + "revision": "3a6bc1cbdb31d4a955a4789acd65b35f91c70822", + "revisionTime": "2019-05-23T09:00:23Z" + }, + { + "checksumSHA1": "R/SvHFvbFSZQuOO+QpozI/yV4VI=", + "path": "github.com/beevee/go-chart/roboto", + "revision": "3a6bc1cbdb31d4a955a4789acd65b35f91c70822", + "revisionTime": "2019-05-23T09:00:23Z" + }, + { + "checksumSHA1": "V7cWd6571hW+qFIs8m8zeNLenqA=", + "path": "github.com/beevee/go-chart/seq", + "revision": "3a6bc1cbdb31d4a955a4789acd65b35f91c70822", + "revisionTime": "2019-05-23T09:00:23Z" + }, + { + "checksumSHA1": "NMggTt9psQ+Vfilzg9swc4Rql3U=", + "path": "github.com/beevee/go-chart/util", + "revision": "3a6bc1cbdb31d4a955a4789acd65b35f91c70822", + "revisionTime": "2019-05-23T09:00:23Z" + }, { "checksumSHA1": "xM5+MU1gVB7+aGfVj+J57EgDcAE=", "path": "github.com/blevesearch/bleve", @@ -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",