diff --git a/ChangeLog b/ChangeLog index 0d0e968..fe65182 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * FEATURE: source address supports cluster. * FEATURE: target address supports several proxies to write data in a round-robin way. +2019-05-11 Alibaba Cloud. + * VERSION: 1.4.3 + * BUGFIX: add add metric in restore mode. 2019-04-24 Alibaba Cloud. * VERSION: 1.4.2 * IMPROVE: improve rump to support fetching data from given keys in diff --git a/src/redis-shake/metric/variables.go b/src/redis-shake/metric/variables.go index 3f9d915..4e46bc3 100644 --- a/src/redis-shake/metric/variables.go +++ b/src/redis-shake/metric/variables.go @@ -34,6 +34,14 @@ type MetricRest struct { func NewMetricRest() []MetricRest { detailMapList := runner.GetDetailedInfo().([]map[string]interface{}) + if detailMapList == nil || len(detailMapList) == 0 { + return []{ + MetricRest{ + StartTime: utils.StartTime, + Status: base.Status, + }, + } + } total := utils.GetTotalLink() ret := make([]MetricRest, total) diff --git a/src/redis-shake/restore.go b/src/redis-shake/restore.go index ae2348a..d2294af 100644 --- a/src/redis-shake/restore.go +++ b/src/redis-shake/restore.go @@ -9,13 +9,13 @@ import ( "fmt" "io/ioutil" "time" + "strconv" "pkg/libs/atomic2" "pkg/libs/log" "pkg/redis" "redis-shake/configure" "redis-shake/common" - "strconv" "redis-shake/base" "sync" )