Commit 793ce7c4 authored by Kevin Di Lallo's avatar Kevin Di Lallo
Browse files

code review updates

parent 6fafc83f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ func (ms *MetricStore) GetLastEventMetric(eventType string) (event string, err e
	return event, nil
}

// GetLatencyMetrics
// GetEventMetrics
func (ms *MetricStore) GetEventMetrics(eventType string, duration string, count int) (metrics []map[string]interface{}, err error) {
	// Make sure we have set a store
	if ms.name == "" {
+2 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import (

// var start time.Time

const defaultInfluxDBAddr = "http://meep-influxdb:8086"
const dbMaxRetryCount = 2

// MetricStore - Implements a metric store
@@ -67,7 +68,7 @@ func NewMetricStore(name string, addr string) (ms *MetricStore, err error) {

func (ms *MetricStore) connectDB(addr string) error {
	if addr == "" {
		ms.addr = "http://meep-influxdb:8086"
		ms.addr = defaultInfluxDBAddr
	} else {
		ms.addr = addr
	}
+1 −1
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ func (ms *MetricStore) GetLastTrafficMetric(src string, dest string) (tput float
	return
}

// GetLatencyMetrics
// GetTrafficMetrics
func (ms *MetricStore) GetTrafficMetrics(src string, dest string, duration string, count int) (metrics []map[string]interface{}, err error) {
	// Make sure we have set a store
	if ms.name == "" {
+0 −2
Original line number Diff line number Diff line
@@ -185,8 +185,6 @@ func TestNetworkMetricGetSet(t *testing.T) {
	if !validateTrafficMetric(result[1], 1.1, 1.2) {
		t.Errorf("Invalid result")
	}

	// t.Errorf("DONE")
}

func validateLatencyMetric(result map[string]interface{}, v1 int32) bool {