Package io.jenkins.plugins.aiagentjob
Interface AiAgentStatsExtractor
- All Known Implementing Classes:
ClaudeCodeStatsExtractor,CodexStatsExtractor,CursorStatsExtractor,OpenCodeStatsExtractor
public interface AiAgentStatsExtractor
Strategy interface for extracting usage statistics from a single JSON log line emitted by an AI
agent.
Each AiAgentTypeHandler returns its own AiAgentStatsExtractor via AiAgentTypeHandler.getStatsExtractor(), allowing third-party agent handlers to supply custom
stats extraction without modifying the core AgentUsageStats class.
Implementations should return true if the JSON line was handled (stats were
extracted), or false if the line was not recognised. When false is returned, the
shared extractor in AgentUsageStats is used as a fallback.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanextract(net.sf.json.JSONObject json, AgentUsageStats stats) Attempt to extract usage statistics from a single JSON line.
-
Method Details
-
extract
Attempt to extract usage statistics from a single JSON line.- Parameters:
json- the parsed JSON object for this linestats- the stats accumulator to update- Returns:
trueif this extractor handled the line,falseto fall through to the shared extractor
-