Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
matevz committed Mar 26, 2020
1 parent a1373a4 commit 8faf335
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 32 deletions.
11 changes: 6 additions & 5 deletions .changelog/2687.feature.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
- `oasis-test-runner` now accepts `--metrics.address` and
`--metrics.push.interval` paramaters which are forwarded to `oasis-node`
workers.
- `oasis-test-runner` now signals `up` metric to Prometheus when a test is started
and finished.
- `oasis-test-runner` now signals `up` metric to Prometheus when a test is
started and finished.
- `--num_runs` parameter added which specifies how many times each test should
be run.
- E2E scenario parameters can now be exposed and set via CLI by reimplementing
Expand All @@ -18,7 +18,8 @@ and finished.
- If metrics enabled, call `oasis-node` with new labels `instance`, `run`,
`test`,`software_version`,`git_branch`,`runtime_tee_hardware` and test-
specific parameter set.
- New `version.GitBranch` determined during compilation and send it as metric label.
- New `version.GitBranch` determined during compilation and send it as metric
label.
- Current parameter set, run number, and test name dumped to
`test_instance_info.json` in corresponding datadir. Useful when packing whole
datadir for external debugging.
`test_instance_info.json` in corresponding datadir. Useful when packing
whole datadir for external debugging.
10 changes: 5 additions & 5 deletions .changelog/2687.feature.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
- Replaces `--metrics.push.instance_label` with `--metrics.push.labels` map
parameter where `instance` is just one of them.
- New Prometheus metrics for:
- datadir space usage,
- I/O (read/written bytes),
- memory usage (VMSize, RssAnon, RssFile, RssShmem),
- CPU (utime and stime),
- network interfaces (rx/tx bytes/packets),
- datadir space usage,
- I/O (read/written bytes),
- memory usage (VMSize, RssAnon, RssFile, RssShmem),
- CPU (utime and stime),
- network interfaces (rx/tx bytes/packets),
- Bumps `prometheus/go_client` to latest version which fixes sending label
values containing non-url characters.
- Bumps `spf13/viper` to contain a fix for `IsSet()` which correctly returns,
4 changes: 4 additions & 0 deletions .changelog/2687.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
buildkite: New benchmarks pipeline has been added

This pipeline runs all E2E tests and compares the benchmark results from the
previous batch using the new `ba` tool.
2 changes: 1 addition & 1 deletion go/extra/ba/cmd/ba.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ func runCmp(cmd *cobra.Command, args []string) {
for k := range testCmd.Scenarios[test].Parameters() {
param := fmt.Sprintf(testCmd.TestParamsMask, test, k)
if viper.IsSet(param) {
// TODO: Check exploded-like parameter sets like we run the tests in oasis-test-runner.
// TODO: We should support all parameter set combinations in the future like we do in oasis-test-runner.
labels[metrics.EscapeLabelCharacters(k)] = viper.GetStringSlice(param)[0]
}
}
Expand Down
11 changes: 3 additions & 8 deletions go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ
github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
Expand Down Expand Up @@ -385,8 +386,6 @@ github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFSt
github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.4.0 h1:u3Z1r+oOXJIkxqw34zVhyPgjBsm6X2wn21NWs/HfSeg=
github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo=
github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4=
github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys=
github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ=
Expand All @@ -398,8 +397,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_golang v0.9.4 h1:Y8E/JaaPbmFSW2V81Ab/d8yZFYQQGbni1b1jPcG9Y6A=
github.com/prometheus/client_golang v0.9.4/go.mod h1:oCXIBxdI62A4cR6aTRJCgetEjecSIYzOEaeAn4iYEpM=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.4.1 h1:FFSuS004yOQEtDdTq+TAOLP5xUq63KqAFYyOi8zA+Y8=
github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
Expand Down Expand Up @@ -442,8 +439,7 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1
github.com/smartystreets/assertions v1.0.0 h1:UVQPSSmc3qtTi+zPPkCXvZX9VvW/xT/NsRvKfwY81a8=
github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff/go.mod h1:KSQcGKpxUMHk3nbYzs/tIBAM2iDooCn0BmttHOJEbLs=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
Expand Down Expand Up @@ -601,8 +597,6 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190912141932-bc967efca4b8 h1:41hwlulw1prEMBxLQSlMSux1zxJf07B3WPsdjJlKZxE=
golang.org/x/sys v0.0.0-20190912141932-bc967efca4b8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82 h1:ywK/j/KkyTHcdyYSZNXGjMwgmDSfjglYZ3vStQ/gSCU=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -620,6 +614,7 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
Expand Down
6 changes: 3 additions & 3 deletions go/oasis-node/cmd/common/pprof/pprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ type pprofService struct {
errCh chan error
}

/// Writes the current process heap to given file with unique suffix.
func WriteHeap(name string) error {
/// DumpHeapToFile writes the current process heap to given file with unique suffix.
func DumpHeapToFile(name string) error {
// Find unique filename.
var filename string
i := 1
for {
filename = name + ".prof." + strconv.Itoa(i)
filename = name + "." + strconv.Itoa(i) + ".pb"
if _, err := os.Stat(filename); err != nil {
break
}
Expand Down
6 changes: 0 additions & 6 deletions go/oasis-test-runner/scenario/e2e/multiple_runtimes.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ package e2e
import (
"context"
"fmt"
"strconv"
"time"

"github.com/oasislabs/oasis-core/go/common"
"github.com/oasislabs/oasis-core/go/common/logging"
epochtime "github.com/oasislabs/oasis-core/go/epochtime/api"
"github.com/oasislabs/oasis-core/go/oasis-node/cmd/common/pprof"
"github.com/oasislabs/oasis-core/go/oasis-test-runner/env"
"github.com/oasislabs/oasis-core/go/oasis-test-runner/oasis"
"github.com/oasislabs/oasis-core/go/oasis-test-runner/scenario"
Expand Down Expand Up @@ -174,14 +172,10 @@ func (mr *multipleRuntimesImpl) Run(childEnv *env.Env) error {
"runtime_id", rt.ID,
)

_ = pprof.WriteHeap("multiple-runtimes.runtime_" + strconv.Itoa(i) + ".beforeSubmitRuntimeTx")

if err := mr.submitRuntimeTx(ctx, rt.ID, "hello", fmt.Sprintf("world at iteration %d from %s", i, rt.ID)); err != nil {
return err
}

_ = pprof.WriteHeap("multiple-runtimes.runtime_" + strconv.Itoa(i) + ".afterSubmitRuntimeTx")

mr.logger.Info("triggering epoch transition",
"epoch", epoch,
)
Expand Down
4 changes: 0 additions & 4 deletions go/worker/compute/txnscheduler/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package txnscheduler
import (
"context"

"github.com/oasislabs/oasis-core/go/oasis-node/cmd/common/pprof"
"github.com/oasislabs/oasis-core/go/worker/compute/txnscheduler/api"
)

Expand All @@ -16,12 +15,9 @@ func (w *Worker) SubmitTx(ctx context.Context, rq *api.SubmitTxRequest) (*api.Su
return nil, api.ErrUnknownRuntime
}

rtid, _ := rq.RuntimeID.MarshalText()
_ = pprof.WriteHeap("multiple-runtimes.worker_" + string(rtid) + ".beforeSubmitRuntimeTx")
if err := runtime.QueueCall(ctx, rq.ExpectedEpochNumber, rq.Data); err != nil {
return nil, err
}
_ = pprof.WriteHeap("multiple-runtimes.worker_" + string(rtid) + ".afterSubmitRuntimeTx")

return &api.SubmitTxResponse{}, nil
}
Expand Down

0 comments on commit 8faf335

Please sign in to comment.