From 602d2b8ad50b7bd707c123cd4e01a5c989870191 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Tue, 13 Oct 2020 21:24:56 -0700 Subject: [PATCH] record datastore metrics after successful run --- cmd/lotus-bench/import.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmd/lotus-bench/import.go b/cmd/lotus-bench/import.go index de3a0ea45..681d7ede2 100644 --- a/cmd/lotus-bench/import.go +++ b/cmd/lotus-bench/import.go @@ -320,6 +320,21 @@ var importBenchCmd = &cli.Command{ pprof.StopCPUProfile() + if true { + resp, err := http.Get("http://localhost:6060/debug/metrics/prometheus") + if err != nil { + return err + } + + metricsfi, err := os.Create("import-bench.metrics") + if err != nil { + return err + } + + io.Copy(metricsfi, resp.Body) + metricsfi.Close() + } + return nil },