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 (
avgDistance prometheus.Gauge
)
func init() {
func registerAutopeeringMetrics() {
neighborDropCount = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "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 (
dataSizes *prometheus.GaugeVec
)
func init() {
func registerDataMetrics() {
dataSizes = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "iota_data_sizes_bytes",
......
......@@ -16,7 +16,7 @@ var (
queryOpReplyNotRx prometheus.Gauge
)
func init() {
func registerFPCMetrics() {
activeConflicts = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "fpc_active_conflicts",
Help: "number of currently active conflicts",
......@@ -72,4 +72,3 @@ func collectFPCMetrics() {
queryReplyNotRx.Set(float64(metrics.FPCQueryReplyErrors()))
queryOpReplyNotRx.Set(float64(metrics.FPCOpinionQueryReplyErrors()))
}
......@@ -11,7 +11,7 @@ var (
sync prometheus.Gauge
)
func init() {
func registerInfoMetrics() {
infoApp = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "iota_info_app",
......@@ -26,6 +26,9 @@ func init() {
Help: "Node sync status.",
})
registry.MustRegister(infoApp)
registry.MustRegister(sync)
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 (
autopeeringOutboundBytes prometheus.Gauge
)
func init() {
func registerNetworkMetrics() {
fpcInboundBytes = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "fpc_inbound_bytes",
Help: "FPC RX network traffic [bytes].",
......
......@@ -10,7 +10,7 @@ var (
memUsageBytes prometheus.Gauge
)
func init() {
func registerProcessMetrics() {
cpuUsage = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "cpu_usage",
Help: "CPU (System) usage.",
......
......@@ -17,7 +17,7 @@ var (
valueTips prometheus.Gauge
)
func init() {
func registerTangleMetrics() {
messagesPerSecond = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "tangle_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