• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

knowledgepixels / nanopub-registry / 28155387420

25 Jun 2026 07:53AM UTC coverage: 31.926% (-0.2%) from 32.089%
28155387420

push

github

web-flow
chore: enhance and standardize logging across multiple components (#116)

* chore(EntryStatus): enhance logging for null and unsupported status value handling

* chore(logging): standardize logger variable names across multiple classes

* chore(CoverageFilter): enhance logging for coverage filter initialization and type checks

* chore(RegistryPeerConnector): enhance logging for peer connection and nanopub fetching

* chore(logging): enhance logging for request handling and error reporting in multiple pages

* chore(MainVerticle): enhance logging for HTTP server startup, request routing, and POST processing

* chore(Task): improve logging messages

* chore(Task): enhance logging for server status checks and account loading processes

* chore(RegistryInfo): add logging messages for RegistryInfo snapshot assembly and JSON serialization

* chore(logging): enhance logging throughout various components for better traceability and debugging

* chore(Utils): enhance logging for user IRI extraction in IntroNanopub

* chore(TrustStatePage): enhance logging for trust-state snapshot resolution and querying

* chore(NanopubLoader): enhance logging for nanopub retrieval and processing

* chore(Task): enhance logging for task execution and status transitions

313 of 1106 branches covered (28.3%)

Branch coverage included in aggregate %.

1048 of 3157 relevant lines covered (33.2%)

5.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
src/main/java/com/knowledgepixels/registry/AgentInfo.java
1
package com.knowledgepixels.registry;
2

3
import com.google.gson.Gson;
4
import com.mongodb.client.ClientSession;
5
import org.bson.Document;
6
import org.slf4j.Logger;
7
import org.slf4j.LoggerFactory;
8

9
import java.io.Serializable;
10

11
@SuppressWarnings("unused")
12
public class AgentInfo implements Serializable {
9✔
13

14
    private static final long serialVersionUID = 1L;
15

16
    private static final Logger logger = LoggerFactory.getLogger(AgentInfo.class);
9✔
17

18
    private String agentId;
19
    private String name;
20
    private Integer accountCount;
21
    private Double avgPathCount;
22
    private Double totalRatio;
23

24
    private static final Gson gson = new Gson();
15✔
25

26
    public static AgentInfo get(ClientSession mongoSession, String agentId) {
27
        logger.debug("Looking up AgentInfo for agentId='{}'", agentId);
12✔
28

29
        AgentInfo agentInfo = new AgentInfo();
12✔
30
        agentInfo.agentId = agentId;
9✔
31
        Document d = RegistryDB.getOne(mongoSession, Collection.AGENTS.toString(), new Document("agent", agentId));
30✔
32
        if (d == null) {
6!
33
            logger.warn("No agent found in {} for agentId='{}'; AgentInfo will be incomplete", Collection.AGENTS, agentId);
×
34
        }
35

36
        agentInfo.name = d.getString("name");
15✔
37
        agentInfo.accountCount = (Integer) d.get("accountCount");
18✔
38
        agentInfo.avgPathCount = (Double) d.get("avgPathCount");
18✔
39
        agentInfo.totalRatio = (Double) d.get("totalRatio");
18✔
40

41
        logger.debug("AgentInfo resolved for agentId='{}': name='{}', accountCount={}, avgPathCount={}, totalRatio={}", agentId, agentInfo.name, agentInfo.accountCount, agentInfo.avgPathCount, agentInfo.totalRatio);
87✔
42

43
        return agentInfo;
6✔
44
    }
45

46
    public String asJson() {
47
        String json = gson.toJson(this);
12✔
48
        logger.debug("Serialized AgentInfo for agentId='{}' to JSON ({} chars)", agentId, json.length());
24✔
49
        return json;
6✔
50
    }
51

52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc