-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into signature-aggregation-api-acp-118
- Loading branch information
Showing
19 changed files
with
415 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package peers | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/prometheus/client_golang/prometheus" | ||
) | ||
|
||
var ( | ||
ErrFailedToCreateAppRequestNetworkMetrics = errors.New("failed to create app request network metrics") | ||
) | ||
|
||
type AppRequestNetworkMetrics struct { | ||
infoAPICallLatencyMS prometheus.Histogram | ||
pChainAPICallLatencyMS prometheus.Histogram | ||
} | ||
|
||
func newAppRequestNetworkMetrics(registerer prometheus.Registerer) (*AppRequestNetworkMetrics, error) { | ||
infoAPICallLatencyMS := prometheus.NewHistogram( | ||
prometheus.HistogramOpts{ | ||
Name: "info_api_call_latency_ms", | ||
Help: "Latency of calling info api in milliseconds", | ||
Buckets: prometheus.ExponentialBucketsRange(100, 10000, 10), | ||
}, | ||
) | ||
if infoAPICallLatencyMS == nil { | ||
return nil, ErrFailedToCreateAppRequestNetworkMetrics | ||
} | ||
registerer.MustRegister(infoAPICallLatencyMS) | ||
|
||
pChainAPICallLatencyMS := prometheus.NewHistogram( | ||
prometheus.HistogramOpts{ | ||
Name: "p_chain_api_call_latency_ms", | ||
Help: "Latency of calling p-chain rpc in milliseconds", | ||
Buckets: prometheus.ExponentialBucketsRange(100, 10000, 10), | ||
}, | ||
) | ||
if pChainAPICallLatencyMS == nil { | ||
return nil, ErrFailedToCreateAppRequestNetworkMetrics | ||
} | ||
registerer.MustRegister(pChainAPICallLatencyMS) | ||
|
||
return &AppRequestNetworkMetrics{ | ||
infoAPICallLatencyMS: infoAPICallLatencyMS, | ||
pChainAPICallLatencyMS: pChainAPICallLatencyMS, | ||
}, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.