Skip to content
Snippets Groups Projects
Commit ec63e1c5 authored by Levente Pap's avatar Levente Pap
Browse files

Add messageCount and solidMessageCOunt to /info webapi endpoint

parent 12176f3a
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ import (
"github.com/iotaledger/goshimmer/plugins/autopeering/local"
"github.com/iotaledger/goshimmer/plugins/banner"
"github.com/iotaledger/goshimmer/plugins/metrics"
"github.com/iotaledger/goshimmer/plugins/sync"
"github.com/iotaledger/goshimmer/plugins/webapi"
"github.com/iotaledger/hive.go/node"
......@@ -84,12 +85,15 @@ func getInfo(c echo.Context) error {
sort.Strings(disabledPlugins)
return c.JSON(http.StatusOK, Response{
Version: banner.AppVersion,
Synced: sync.Synced(),
IdentityID: local.GetInstance().Identity.ID().String(),
PublicKey: local.GetInstance().PublicKey().String(),
EnabledPlugins: enabledPlugins,
DisabledPlugins: disabledPlugins,
Version: banner.AppVersion,
Synced: sync.Synced(),
IdentityID: local.GetInstance().Identity.ID().String(),
PublicKey: local.GetInstance().PublicKey().String(),
RequestQueueSize: int(metrics.MessageRequestQueueSize()),
SolidMessageCount: int(metrics.MessageSolidCountIter()),
TotalMessageCount: int(metrics.MessageTotalCountDBIter()),
EnabledPlugins: enabledPlugins,
DisabledPlugins: disabledPlugins,
})
}
......@@ -103,6 +107,12 @@ type Response struct {
IdentityID string `json:"identityID,omitempty"`
// public key of the node encoded in base58
PublicKey string `json:"publicKey,omitempty"`
// RequestQueueSize is the number of messages a node is trying to request from neighbors.
RequestQueueSize int `json:"requestQueueSize,omitempty"`
// SolidMessageCount is the number of solid messages in the node's database.
SolidMessageCount int `json:"solidMessageCount,omitempty"`
// TotalMessageCount is the number of messages in the node's database.
TotalMessageCount int `json:"totalMessageCount,omitempty"`
// list of enabled plugins
EnabledPlugins []string `json:"enabledPlugins,omitempty"`
// list if disabled plugins
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment