-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathiface_ribs.go
200 lines (144 loc) · 3.6 KB
/
iface_ribs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
package ribs
import (
"context"
"io"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-jsonrpc"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/api"
"github.com/ipfs/go-cid"
)
type RIBS interface {
RBS
Wallet() Wallet
DealDiag() RIBSDiag
io.Closer
}
type RIBSDiag interface {
CarUploadStats() UploadStats
DealSummary() (DealSummary, error)
GroupDeals(gk GroupKey) ([]DealMeta, error)
ProviderInfo(id int64) (ProviderInfo, error)
CrawlState() CrawlState
ReachableProviders() []ProviderMeta
RetrStats() (RetrStats, error)
StagingStats() (StagingStats, error)
Filecoin(context.Context) (api.Gateway, jsonrpc.ClientCloser, error)
P2PNodes(ctx context.Context) (map[string]Libp2pInfo, error)
RetrChecker() RetrCheckerStats
RetrievableDealCounts() ([]DealCountStats, error)
SealedDealCounts() ([]DealCountStats, error)
RepairQueue() (RepairQueueStats, error)
RepairStats() (map[int]RepairJob, error)
}
type RepairQueueStats struct {
Total, Assigned int
}
type RepairJob struct {
GroupKey GroupKey
State RepairJobState
FetchProgress, FetchSize int64
FetchUrl string
}
type RepairJobState string
const (
RepairJobStateFetching RepairJobState = "fetching"
RepairJobStateVerifying RepairJobState = "verifying"
RepairJobStateImporting RepairJobState = "importing"
)
type DealCountStats struct {
Count int
Groups int
}
type RetrCheckerStats struct {
ToDo int64
Started int64
Success int64
Fail int64
SuccessAll int64
FailAll int64
}
type Libp2pInfo struct {
PeerID string
Listen []string
Peers int
}
type StagingStats struct {
UploadBytes, UploadStarted, UploadDone, UploadErr, Redirects, ReadReqs, ReadBytes int64
}
type RetrStats struct {
Success, Bytes, Fail, CacheHit, CacheMiss, Active int64
HTTPTries, HTTPSuccess, HTTPBytes int64
}
type UploadStats struct {
ByGroup map[GroupKey]*GroupUploadStats
LastTotalBytes int64
}
type GroupUploadStats struct {
ActiveRequests int
UploadBytes int64
}
type DealMeta struct {
UUID string
Provider int64
Sealed, Failed, Rejected bool
StartEpoch, EndEpoch, StartTime int64
Status string
SealStatus string
Error string
DealID int64
BytesRecv int64
TxSize int64
PubCid string
RetrTTFBMs int64
RetrSuccess, RetrFail int64
NoRecentSuccess bool
}
type Wallet interface {
WalletInfo() (WalletInfo, error)
MarketAdd(ctx context.Context, amount abi.TokenAmount) (cid.Cid, error)
MarketWithdraw(ctx context.Context, amount abi.TokenAmount) (cid.Cid, error)
Withdraw(ctx context.Context, amount abi.TokenAmount, to address.Address) (cid.Cid, error)
}
type WalletInfo struct {
Addr, IDAddr string
DataCap string
Balance string
MarketBalance string
MarketLocked string
MarketBalanceDetailed api.MarketBalance
}
type CrawlState struct {
State string
At, Reachable, Total int64
Boost, BBswap, BHttp int64
}
type DealSummary struct {
NonFailed, InProgress, Done, Failed int64
TotalDataSize, TotalDealSize int64
StoredDataSize, StoredDealSize int64
}
type ProviderInfo struct {
Meta ProviderMeta
RecentDeals []DealMeta
}
type ProviderMeta struct {
ID int64
PingOk bool
BoostDeals bool
BoosterHttp bool
BoosterBitswap bool
IndexedSuccess int64
IndexedFail int64
DealStarted int64
DealSuccess int64
DealFail int64
DealRejected int64
MostRecentDealStart int64
// price in fil/gib/epoch
AskPrice float64
AskVerifiedPrice float64
AskMinPieceSize float64
AskMaxPieceSize float64
RetrievDeals, UnretrievDeals int64
}