Copy PrettyPrintJSON to core framework

PrettyPrintJSON is most used e2emetrics function and that doesn't seem
specific for metrics. The implementation itself is generic, so it is
nice to move it to core framework for avoiding circular dependency.
This commit is contained in:
Kenichi Omichi
2019-08-29 00:11:53 +00:00
parent d62ebe31f0
commit 7c23ba1b34
12 changed files with 29 additions and 18 deletions

View File

@@ -540,7 +540,7 @@ func logAndVerifyLatency(batchLag time.Duration, e2eLags []e2emetrics.PodLatency
// TODO(coufon): do not trust 'kubelet' metrics since they are not reset!
latencyMetrics, _ := getPodStartLatency(kubeletAddr)
framework.Logf("Kubelet Prometheus metrics (not reset):\n%s", e2emetrics.PrettyPrintJSON(latencyMetrics))
framework.Logf("Kubelet Prometheus metrics (not reset):\n%s", framework.PrettyPrintJSON(latencyMetrics))
podStartupLatency := e2emetrics.ExtractLatencyMetrics(e2eLags)