diff --git a/plugins/webapi/info/plugin.go b/plugins/webapi/info/plugin.go index a64f121b790023fb34a3e45b2607e72cbe913b23..264db20a48573c55b68bfab6c79e353b1a49ce1c 100644 --- a/plugins/webapi/info/plugin.go +++ b/plugins/webapi/info/plugin.go @@ -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