@@ -31,6 +31,7 @@ import (
31
31
"github.com/iotexproject/iotex-core/v2/blockchain/genesis"
32
32
"github.com/iotexproject/iotex-core/v2/db"
33
33
"github.com/iotexproject/iotex-core/v2/pkg/log"
34
+ "github.com/iotexproject/iotex-core/v2/pkg/prometheustimer"
34
35
"github.com/iotexproject/iotex-core/v2/state"
35
36
)
36
37
49
50
},
50
51
[]string {"type" },
51
52
)
53
+ timerFactory * prometheustimer.TimerFactory
52
54
53
55
errInvalidSystemActionLayout = errors .New ("system action layout is invalid" )
54
56
errUnfoldTxContainer = errors .New ("failed to unfold tx container" )
58
60
func init () {
59
61
prometheus .MustRegister (_stateDBMtc )
60
62
prometheus .MustRegister (_mintAbility )
63
+
64
+ var err error
65
+ timerFactory , err = prometheustimer .New (
66
+ "iotex_mint_latency_nanoseconds" ,
67
+ "Latency of mint operations in nanoseconds" ,
68
+ []string {"operation" },
69
+ []string {"unknown" },
70
+ )
71
+ if err != nil {
72
+ log .L ().Error ("Failed to create proposal pool latency timer" , zap .Error (err ))
73
+ }
61
74
}
62
75
63
76
type (
@@ -692,6 +705,8 @@ func (ws *workingSet) pickAndRunActions(
692
705
sign func (elp action.Envelope ) (* action.SealedEnvelope , error ),
693
706
allowedBlockGasResidue uint64 ,
694
707
) ([]* action.SealedEnvelope , error ) {
708
+ timer := timerFactory .NewTimer ("workingSet.pickAndRunActions" )
709
+ defer timer .End ()
695
710
err := ws .validate (ctx )
696
711
if err != nil {
697
712
return nil , err
@@ -943,6 +958,8 @@ func (ws *workingSet) CreateBuilder(
943
958
sign func (elp action.Envelope ) (* action.SealedEnvelope , error ),
944
959
allowedBlockGasResidue uint64 ,
945
960
) (* block.Builder , error ) {
961
+ timer := timerFactory .NewTimer ("workingSet.CreateBuilder" )
962
+ defer timer .End ()
946
963
actions , err := ws .pickAndRunActions (ctx , ap , sign , allowedBlockGasResidue )
947
964
if err != nil {
948
965
return nil , err
0 commit comments