Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
14f76fb3
Unverified
Commit
14f76fb3
authored
May 30, 2024
by
refcell
Committed by
GitHub
May 30, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: dedup argument types (#10686)
parent
1c2b5176
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
metrics.go
op-dispute-mon/metrics/metrics.go
+5
-5
noop.go
op-dispute-mon/metrics/noop.go
+2
-2
No files found.
op-dispute-mon/metrics/metrics.go
View file @
14f76fb3
...
@@ -107,7 +107,7 @@ type ClaimStatuses struct {
...
@@ -107,7 +107,7 @@ type ClaimStatuses struct {
statuses
map
[
ClaimStatus
]
int
statuses
map
[
ClaimStatus
]
int
}
}
func
(
c
*
ClaimStatuses
)
RecordClaim
(
firstHalf
bool
,
clockExpired
bool
,
resolvable
bool
,
resolved
bool
)
{
func
(
c
*
ClaimStatuses
)
RecordClaim
(
firstHalf
,
clockExpired
,
resolvable
,
resolved
bool
)
{
if
c
.
statuses
==
nil
{
if
c
.
statuses
==
nil
{
c
.
statuses
=
make
(
map
[
ClaimStatus
]
int
)
c
.
statuses
=
make
(
map
[
ClaimStatus
]
int
)
}
}
...
@@ -131,7 +131,7 @@ func (c *ClaimStatuses) ForEachStatus(callback func(status ClaimStatus, count in
...
@@ -131,7 +131,7 @@ func (c *ClaimStatuses) ForEachStatus(callback func(status ClaimStatus, count in
}
}
}
}
func
NewClaimStatus
(
firstHalf
bool
,
clockExpired
bool
,
resolvable
bool
,
resolved
bool
)
ClaimStatus
{
func
NewClaimStatus
(
firstHalf
,
clockExpired
,
resolvable
,
resolved
bool
)
ClaimStatus
{
return
ClaimStatus
{
return
ClaimStatus
{
firstHalf
:
firstHalf
,
firstHalf
:
firstHalf
,
clockExpired
:
clockExpired
,
clockExpired
:
clockExpired
,
...
@@ -175,7 +175,7 @@ type Metricer interface {
...
@@ -175,7 +175,7 @@ type Metricer interface {
RecordIgnoredGames
(
count
int
)
RecordIgnoredGames
(
count
int
)
RecordBondCollateral
(
addr
common
.
Address
,
required
*
big
.
Int
,
available
*
big
.
Int
)
RecordBondCollateral
(
addr
common
.
Address
,
required
,
available
*
big
.
Int
)
RecordL2Challenges
(
agreement
bool
,
count
int
)
RecordL2Challenges
(
agreement
bool
,
count
int
)
...
@@ -492,7 +492,7 @@ func (m *Metrics) RecordFailedGames(count int) {
...
@@ -492,7 +492,7 @@ func (m *Metrics) RecordFailedGames(count int) {
m
.
failedGames
.
Set
(
float64
(
count
))
m
.
failedGames
.
Set
(
float64
(
count
))
}
}
func
(
m
*
Metrics
)
RecordBondCollateral
(
addr
common
.
Address
,
required
*
big
.
Int
,
available
*
big
.
Int
)
{
func
(
m
*
Metrics
)
RecordBondCollateral
(
addr
common
.
Address
,
required
,
available
*
big
.
Int
)
{
balanceLabel
:=
"sufficient"
balanceLabel
:=
"sufficient"
zeroBalanceLabel
:=
"insufficient"
zeroBalanceLabel
:=
"insufficient"
if
required
.
Cmp
(
available
)
>
0
{
if
required
.
Cmp
(
available
)
>
0
{
...
@@ -522,7 +522,7 @@ const (
...
@@ -522,7 +522,7 @@ const (
)
)
func
labelValuesFor
(
status
GameAgreementStatus
)
[]
string
{
func
labelValuesFor
(
status
GameAgreementStatus
)
[]
string
{
asStrings
:=
func
(
status
string
,
inProgress
bool
,
correct
bool
,
agree
bool
)
[]
string
{
asStrings
:=
func
(
status
string
,
inProgress
,
correct
,
agree
bool
)
[]
string
{
inProgressStr
:=
"in_progress"
inProgressStr
:=
"in_progress"
if
!
inProgress
{
if
!
inProgress
{
inProgressStr
=
"complete"
inProgressStr
=
"complete"
...
...
op-dispute-mon/metrics/noop.go
View file @
14f76fb3
...
@@ -36,12 +36,12 @@ func (*NoopMetricsImpl) RecordOutputFetchTime(_ float64) {}
...
@@ -36,12 +36,12 @@ func (*NoopMetricsImpl) RecordOutputFetchTime(_ float64) {}
func
(
*
NoopMetricsImpl
)
RecordGameAgreement
(
_
GameAgreementStatus
,
_
int
)
{}
func
(
*
NoopMetricsImpl
)
RecordGameAgreement
(
_
GameAgreementStatus
,
_
int
)
{}
func
(
*
NoopMetricsImpl
)
RecordLatestProposals
(
_
uint64
,
_
uint64
)
{}
func
(
*
NoopMetricsImpl
)
RecordLatestProposals
(
_
,
_
uint64
)
{}
func
(
*
NoopMetricsImpl
)
RecordIgnoredGames
(
_
int
)
{}
func
(
*
NoopMetricsImpl
)
RecordIgnoredGames
(
_
int
)
{}
func
(
*
NoopMetricsImpl
)
RecordFailedGames
(
_
int
)
{}
func
(
*
NoopMetricsImpl
)
RecordFailedGames
(
_
int
)
{}
func
(
*
NoopMetricsImpl
)
RecordBondCollateral
(
_
common
.
Address
,
_
*
big
.
Int
,
_
*
big
.
Int
)
{}
func
(
*
NoopMetricsImpl
)
RecordBondCollateral
(
_
common
.
Address
,
_
,
_
*
big
.
Int
)
{}
func
(
*
NoopMetricsImpl
)
RecordL2Challenges
(
_
bool
,
_
int
)
{}
func
(
*
NoopMetricsImpl
)
RecordL2Challenges
(
_
bool
,
_
int
)
{}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment