Skip to content

Commit

Permalink
gen
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Mar 21, 2022
1 parent 5365ccf commit cca69a6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
Binary file modified build/openrpc/miner.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion cmd/lotus-miner/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"context"
"fmt"
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
"math"
corebig "math/big"
"os"
Expand Down Expand Up @@ -36,6 +35,7 @@ import (
"github.com/filecoin-project/lotus/chain/actors/builtin/reward"
"github.com/filecoin-project/lotus/chain/types"
lcli "github.com/filecoin-project/lotus/cli"
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
"github.com/filecoin-project/lotus/journal/alerting"
)

Expand Down
1 change: 1 addition & 0 deletions documentation/en/api-v0-methods-miner.md
Original file line number Diff line number Diff line change
Expand Up @@ -4617,6 +4617,7 @@ Response:
}
}
},
"Tasks": null,
"Enabled": true,
"MemUsedMin": 0,
"MemUsedMax": 0,
Expand Down
18 changes: 9 additions & 9 deletions extern/sector-storage/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ func TestRestartWorker(t *testing.T) {

//stm: @WORKER_STATS_001
for {
if len(m.WorkerStats()) == 0 {
if len(m.WorkerStats(ctx)) == 0 {
break
}

Expand Down Expand Up @@ -576,13 +576,13 @@ func TestReenableWorker(t *testing.T) {

//stm: @WORKER_STATS_001
for i := 0; i < 100; i++ {
if !m.WorkerStats()[w.session].Enabled {
if !m.WorkerStats(ctx)[w.session].Enabled {
break
}

time.Sleep(time.Millisecond * 3)
}
require.False(t, m.WorkerStats()[w.session].Enabled)
require.False(t, m.WorkerStats(ctx)[w.session].Enabled)

i, _ = m.sched.Info(ctx)
require.Len(t, i.(SchedDiagInfo).OpenWindows, 0)
Expand All @@ -591,13 +591,13 @@ func TestReenableWorker(t *testing.T) {
atomic.StoreInt64(&w.testDisable, 0)

for i := 0; i < 100; i++ {
if m.WorkerStats()[w.session].Enabled {
if m.WorkerStats(ctx)[w.session].Enabled {
break
}

time.Sleep(time.Millisecond * 3)
}
require.True(t, m.WorkerStats()[w.session].Enabled)
require.True(t, m.WorkerStats(ctx)[w.session].Enabled)

for i := 0; i < 100; i++ {
info, _ := m.sched.Info(ctx)
Expand Down Expand Up @@ -653,7 +653,7 @@ func TestResUse(t *testing.T) {

l:
for {
st := m.WorkerStats()
st := m.WorkerStats(ctx)
require.Len(t, st, 1)
for _, w := range st {
if w.MemUsedMax > 0 {
Expand All @@ -663,7 +663,7 @@ l:
}
}

st := m.WorkerStats()
st := m.WorkerStats(ctx)
require.Len(t, st, 1)
for _, w := range st {
require.Equal(t, storiface.ResourceTable[sealtasks.TTAddPiece][abi.RegisteredSealProof_StackedDrg2KiBV1].MaxMemory, w.MemUsedMax)
Expand Down Expand Up @@ -715,7 +715,7 @@ func TestResOverride(t *testing.T) {

l:
for {
st := m.WorkerStats()
st := m.WorkerStats(ctx)
require.Len(t, st, 1)
for _, w := range st {
if w.MemUsedMax > 0 {
Expand All @@ -725,7 +725,7 @@ l:
}
}

st := m.WorkerStats()
st := m.WorkerStats(ctx)
require.Len(t, st, 1)
for _, w := range st {
require.Equal(t, uint64(99999), w.MemUsedMax)
Expand Down

0 comments on commit cca69a6

Please sign in to comment.