From bf187cf9fc6f657c9256052d8f7e06354b9a214c Mon Sep 17 00:00:00 2001 From: vinllen Date: Fri, 21 Jun 2019 19:08:12 +0800 Subject: [PATCH] add metric in mode --- src/redis-shake/metric/variables.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/redis-shake/metric/variables.go b/src/redis-shake/metric/variables.go index 163cfcd..51aa486 100644 --- a/src/redis-shake/metric/variables.go +++ b/src/redis-shake/metric/variables.go @@ -34,7 +34,10 @@ type MetricRest struct { } func NewMetricRest() []MetricRest { - detailMapList := runner.GetDetailedInfo().([]map[string]interface{}) + var detailMapList []map[string]interface{} + if rawInfo := runner.GetDetailedInfo(); rawInfo != nil { + detailMapList = runner.GetDetailedInfo().([]map[string]interface{}) + } if detailMapList == nil || len(detailMapList) == 0 { return []MetricRest{ {