forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 5
/
no_op.go
52 lines (31 loc) · 1.18 KB
/
no_op.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
// Copyright (C) 2019-2023, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package metrics
import (
"net/http"
"time"
"github.com/gorilla/rpc/v2"
"github.com/MetalBlockchain/metalgo/ids"
"github.com/MetalBlockchain/metalgo/vms/platformvm/blocks"
)
var Noop Metrics = noopMetrics{}
type noopMetrics struct{}
func (noopMetrics) MarkOptionVoteWon() {}
func (noopMetrics) MarkOptionVoteLost() {}
func (noopMetrics) MarkAccepted(blocks.Block) error {
return nil
}
func (noopMetrics) InterceptRequest(i *rpc.RequestInfo) *http.Request {
return i.Request
}
func (noopMetrics) AfterRequest(*rpc.RequestInfo) {}
func (noopMetrics) IncValidatorSetsCreated() {}
func (noopMetrics) IncValidatorSetsCached() {}
func (noopMetrics) AddValidatorSetsDuration(time.Duration) {}
func (noopMetrics) AddValidatorSetsHeightDiff(uint64) {}
func (noopMetrics) SetLocalStake(uint64) {}
func (noopMetrics) SetTotalStake(uint64) {}
func (noopMetrics) SetTimeUntilUnstake(time.Duration) {}
func (noopMetrics) SetTimeUntilSubnetUnstake(ids.ID, time.Duration) {}
func (noopMetrics) SetSubnetPercentConnected(ids.ID, float64) {}
func (noopMetrics) SetPercentConnected(float64) {}