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

knowledgepixels / nanopub-registry / 28097852213

24 Jun 2026 12:17PM UTC coverage: 32.272% (+0.2%) from 32.089%
28097852213

Pull #116

github

web-flow
Merge 33f3594c3 into eebd16ba4
Pull Request #116: Enhance and standardize logging across multiple components

312 of 1096 branches covered (28.47%)

Branch coverage included in aggregate %.

1026 of 3050 relevant lines covered (33.64%)

5.62 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 TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc