Skip to content
Snippets Groups Projects
Unverified Commit d72ebb6a authored by capossele's avatar capossele
Browse files

:construction: WIP

parent 8a8a1e53
No related branches found
No related tags found
No related merge requests found
package prometheus
...@@ -14,7 +14,7 @@ var ( ...@@ -14,7 +14,7 @@ var (
avgDistance prometheus.Gauge avgDistance prometheus.Gauge
) )
func init() { func registerAutopeeringMetrics() {
neighborDropCount = prometheus.NewGauge(prometheus.GaugeOpts{ neighborDropCount = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "neighbor_drop_count", Name: "neighbor_drop_count",
Help: "Autopeering neighbor drop count.", Help: "Autopeering neighbor drop count.",
......
package prometheus
import (
"github.com/prometheus/client_golang/prometheus"
)
var (
clientsInfo *prometheus.GaugeVec
)
func registerClientsMetrics() {
clientsInfo = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "clients_info",
Help: "Clients info.",
},
[]string{"info"},
// []string{"OS", "ARCH", "NUM_CPU", "CPU_USAGE", "MEM_USAGE"},
)
// registry.MustRegister(clientsInfo)
// collectClientsInfo()
// clientsInfo.WithLabelValues(banner.AppName, banner.AppVersion).Set(1)
}
func collectClientsInfo() {
// for ID, info := range metrics.ClientsMetrics() {
// clientsInfo.WithLabelValues()
// }
}
...@@ -13,7 +13,7 @@ var ( ...@@ -13,7 +13,7 @@ var (
dataSizes *prometheus.GaugeVec dataSizes *prometheus.GaugeVec
) )
func init() { func registerDataMetrics() {
dataSizes = prometheus.NewGaugeVec( dataSizes = prometheus.NewGaugeVec(
prometheus.GaugeOpts{ prometheus.GaugeOpts{
Name: "iota_data_sizes_bytes", Name: "iota_data_sizes_bytes",
......
...@@ -6,17 +6,17 @@ import ( ...@@ -6,17 +6,17 @@ import (
) )
var ( var (
activeConflicts prometheus.Gauge activeConflicts prometheus.Gauge
finalizedConflicts prometheus.Gauge finalizedConflicts prometheus.Gauge
failedConflicts prometheus.Gauge failedConflicts prometheus.Gauge
avgRoundToFin prometheus.Gauge avgRoundToFin prometheus.Gauge
queryRx prometheus.Gauge queryRx prometheus.Gauge
queryOpRx prometheus.Gauge queryOpRx prometheus.Gauge
queryReplyNotRx prometheus.Gauge queryReplyNotRx prometheus.Gauge
queryOpReplyNotRx prometheus.Gauge queryOpReplyNotRx prometheus.Gauge
) )
func init() { func registerFPCMetrics() {
activeConflicts = prometheus.NewGauge(prometheus.GaugeOpts{ activeConflicts = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "fpc_active_conflicts", Name: "fpc_active_conflicts",
Help: "number of currently active conflicts", Help: "number of currently active conflicts",
...@@ -72,4 +72,3 @@ func collectFPCMetrics() { ...@@ -72,4 +72,3 @@ func collectFPCMetrics() {
queryReplyNotRx.Set(float64(metrics.FPCQueryReplyErrors())) queryReplyNotRx.Set(float64(metrics.FPCQueryReplyErrors()))
queryOpReplyNotRx.Set(float64(metrics.FPCOpinionQueryReplyErrors())) queryOpReplyNotRx.Set(float64(metrics.FPCOpinionQueryReplyErrors()))
} }
...@@ -11,7 +11,7 @@ var ( ...@@ -11,7 +11,7 @@ var (
sync prometheus.Gauge sync prometheus.Gauge
) )
func init() { func registerInfoMetrics() {
infoApp = prometheus.NewGaugeVec( infoApp = prometheus.NewGaugeVec(
prometheus.GaugeOpts{ prometheus.GaugeOpts{
Name: "iota_info_app", Name: "iota_info_app",
...@@ -26,6 +26,9 @@ func init() { ...@@ -26,6 +26,9 @@ func init() {
Help: "Node sync status.", Help: "Node sync status.",
}) })
registry.MustRegister(infoApp)
registry.MustRegister(sync)
addCollect(collectInfoMetrics) addCollect(collectInfoMetrics)
} }
......
package prometheus
import (
"github.com/iotaledger/goshimmer/plugins/config"
"github.com/iotaledger/goshimmer/plugins/metrics"
)
func init() {
if config.Node.GetBool(metrics.CfgMetricsLocal) {
registerAutopeeringMetrics()
registerDataMetrics()
registerFPCMetrics()
registerInfoMetrics()
registerNetworkMetrics()
registerProcessMetrics()
registerTangleMetrics()
}
if config.Node.GetBool(metrics.CfgMetricsGlobal) {
registerClientsMetrics()
}
}
...@@ -16,7 +16,7 @@ var ( ...@@ -16,7 +16,7 @@ var (
autopeeringOutboundBytes prometheus.Gauge autopeeringOutboundBytes prometheus.Gauge
) )
func init() { func registerNetworkMetrics() {
fpcInboundBytes = prometheus.NewGauge(prometheus.GaugeOpts{ fpcInboundBytes = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "fpc_inbound_bytes", Name: "fpc_inbound_bytes",
Help: "FPC RX network traffic [bytes].", Help: "FPC RX network traffic [bytes].",
......
...@@ -10,7 +10,7 @@ var ( ...@@ -10,7 +10,7 @@ var (
memUsageBytes prometheus.Gauge memUsageBytes prometheus.Gauge
) )
func init() { func registerProcessMetrics() {
cpuUsage = prometheus.NewGauge(prometheus.GaugeOpts{ cpuUsage = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "cpu_usage", Name: "cpu_usage",
Help: "CPU (System) usage.", Help: "CPU (System) usage.",
......
...@@ -7,17 +7,17 @@ import ( ...@@ -7,17 +7,17 @@ import (
) )
var ( var (
messagesPerSecond prometheus.Gauge messagesPerSecond prometheus.Gauge
messagePerSecondPerPayload *prometheus.GaugeVec messagePerSecondPerPayload *prometheus.GaugeVec
messageTips prometheus.Gauge messageTips prometheus.Gauge
messageCount *prometheus.GaugeVec messageCount *prometheus.GaugeVec
messageTotalCount prometheus.Gauge messageTotalCount prometheus.Gauge
transactionsPerSecond prometheus.Gauge transactionsPerSecond prometheus.Gauge
valueTips prometheus.Gauge valueTips prometheus.Gauge
) )
func init() { func registerTangleMetrics() {
messagesPerSecond = prometheus.NewGauge(prometheus.GaugeOpts{ messagesPerSecond = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "tangle_messages_per_second", Name: "tangle_messages_per_second",
Help: "Number of messages per second.", Help: "Number of messages per second.",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment