Skip to content

Commit

Permalink
Torrent conns print (#3943)
Browse files Browse the repository at this point in the history
* save

* save
  • Loading branch information
AskAlexSharov authored Apr 22, 2022
1 parent 92db317 commit 62c3775
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions cmd/downloader/downloader/grpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ func (s *GrpcServer) Stats(ctx context.Context, request *proto_downloader.StatsR
reply.BytesCompleted += uint64(t.BytesCompleted())
reply.BytesTotal += uint64(t.Info().TotalLength())
reply.Completed = reply.Completed && t.Complete.Bool()
reply.Connections += uint64(len(t.PeerConns()))

for _, peer := range t.PeerConns() {
peers[peer.PeerID] = struct{}{}
}
Expand Down
1 change: 1 addition & 0 deletions eth/stagedsync/stage_headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,7 @@ Loop:
log.Info("[Snapshots] download", "progress", fmt.Sprintf("%.2f%%", readiness),
"download", libcommon.ByteCount(readBytesPerSec)+"/s",
"torrent_peers", reply.Peers,
"connections", reply.Connections,
// "upload", libcommon.ByteCount(writeBytesPerSec)+"/s",
)
prevBytesCompleted = reply.BytesCompleted
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ require (
github.com/json-iterator/go v1.1.12
github.com/julienschmidt/httprouter v1.3.0
github.com/kevinburke/go-bindata v3.21.0+incompatible
github.com/ledgerwatch/erigon-lib v0.0.0-20220422032511-fda1245ea635
github.com/ledgerwatch/erigon-lib v0.0.0-20220422104938-5f1c2e90116f
github.com/ledgerwatch/log/v3 v3.4.1
github.com/ledgerwatch/secp256k1 v1.0.0
github.com/pelletier/go-toml v1.9.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758 h1:0D5M2HQSGD3P
github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=
github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
github.com/ledgerwatch/erigon-lib v0.0.0-20220422032511-fda1245ea635 h1:XwJJhRCsUDXcVbEi+inT3CUC8agIsOmz6+j13fzU0yw=
github.com/ledgerwatch/erigon-lib v0.0.0-20220422032511-fda1245ea635/go.mod h1:0VKhW10UjEr7I6DaV+N0KNbXvMygC99qmRl2CfaN9gw=
github.com/ledgerwatch/erigon-lib v0.0.0-20220422104938-5f1c2e90116f h1:jY+JNUD3n1Z4PBCIVtbkVSRtWEiZp+aZsbqRN07XFv0=
github.com/ledgerwatch/erigon-lib v0.0.0-20220422104938-5f1c2e90116f/go.mod h1:0VKhW10UjEr7I6DaV+N0KNbXvMygC99qmRl2CfaN9gw=
github.com/ledgerwatch/log/v3 v3.4.1 h1:/xGwlVulXnsO9Uq+tzaExc8OWmXXHU0dnLalpbnY5Bc=
github.com/ledgerwatch/log/v3 v3.4.1/go.mod h1:VXcz6Ssn6XEeU92dCMc39/g1F0OYAjw1Mt+dGP5DjXY=
github.com/ledgerwatch/secp256k1 v1.0.0 h1:Usvz87YoTG0uePIV8woOof5cQnLXGYa162rFf3YnwaQ=
Expand Down

0 comments on commit 62c3775

Please sign in to comment.