diff --git a/services/json-rpc/cache/json_rpc_cache.go b/services/json-rpc/cache/json_rpc_cache.go index 3fc35000..1881f4cb 100644 --- a/services/json-rpc/cache/json_rpc_cache.go +++ b/services/json-rpc/cache/json_rpc_cache.go @@ -195,6 +195,14 @@ func (c *JsonRpcCache) pollBlocksData() { // wait for the next bucket <-time.After(time.Duration(bucket-time.Now().Unix()) * time.Second) + c.msgClient.PublishProto( + messaging.SubjectMetricAgent, &protocol.AgentMetricList{ + Metrics: []*protocol.AgentMetric{ + metrics.CreateSystemMetric(domain.MetricJSONRPCCacheSize, float64(c.cache.cache.ItemCount()), ""), + }, + }, + ) + agents, err := c.botRegistry.LoadAssignedBots() if err == nil && len(agents) == 0 { log.Warn("No agents assigned to the scanner, skipping polling for BlocksData") @@ -218,7 +226,6 @@ func (c *JsonRpcCache) pollBlocksData() { messaging.SubjectMetricAgent, &protocol.AgentMetricList{ Metrics: []*protocol.AgentMetric{ metrics.CreateSystemMetric(domain.MetricJSONRPCCachePollSuccess, float64(len(blocksData.Blocks)), fmt.Sprintf("%d", b)), - metrics.CreateSystemMetric(domain.MetricJSONRPCCacheSize, float64(c.cache.cache.ItemCount()), ""), }, }, )