diff --git a/cmd/kperf/commands/runner/runner.go b/cmd/kperf/commands/runner/runner.go index f7ada28..20c09ca 100644 --- a/cmd/kperf/commands/runner/runner.go +++ b/cmd/kperf/commands/runner/runner.go @@ -67,10 +67,6 @@ var runCommand = cli.Command{ Name: "result", Usage: "Path to the file which stores results", }, - cli.BoolFlag{ - Name: "raw-data", - Usage: "Exports raw data as .json to specified file", - }, }, Action: func(cliCtx *cli.Context) error { profileCfg, err := loadConfig(cliCtx) @@ -83,7 +79,6 @@ var runCommand = cli.Command{ kubeCfgPath := cliCtx.String("kubeconfig") userAgent := cliCtx.String("user-agent") outputFilePath := cliCtx.String("result") - //rawData := cliCtx.Bool("raw-data") conns := profileCfg.Spec.Conns rate := profileCfg.Spec.Rate @@ -159,5 +154,5 @@ func loadConfig(cliCtx *cli.Context) (*types.LoadProfile, error) { // TODO: Complete this function func printResponseStats(f *os.File, stats *request.Result) { - + fmt.Fprint(f, "Response Stat: \n") } diff --git a/metrics/request.go b/metrics/request.go index 874c3eb..6485304 100644 --- a/metrics/request.go +++ b/metrics/request.go @@ -2,8 +2,6 @@ package metrics import ( "container/list" - "math" - "sort" "sync" "sync/atomic" @@ -64,7 +62,6 @@ func (m *responseMetricImpl) Gather() types.ResponseStats { Latencies: latencies, TotalReceivedBytes: atomic.LoadInt64(&m.receivedBytes), } - //return latencies, buildPercentileLatencies(latencies), m.failureList, atomic.LoadInt64(&m.receivedBytes) } func (m *responseMetricImpl) dumpLatencies() []float64 { @@ -76,24 +73,3 @@ func (m *responseMetricImpl) dumpLatencies() []float64 { } return res } - -var percentiles = []float64{0, 50, 90, 95, 99, 100} - -func buildPercentileLatencies(latencies []float64) map[float64]float64 { - if len(latencies) == 0 { - return nil - } - - res := make(map[float64]float64, len(percentiles)) - - n := len(latencies) - sort.Float64s(latencies) - for _, p := range percentiles { - idx := int(math.Ceil(float64(n) * p / 100)) - if idx > 0 { - idx-- - } - res[p] = latencies[idx] - } - return res -}