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 74c307f
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 24 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
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 74c307f

Please sign in to comment.