MCPcopy Create free account
hub / github.com/Open-Bee/DataStudio / OperatorStats

Class OperatorStats

datastudio/utils/statistics.py:18–54  ·  view source on GitHub ↗

Statistics for a single operator execution.

Source from the content-addressed store, hash-verified

16
17@dataclass
18class OperatorStats:
19 """Statistics for a single operator execution."""
20
21 name: str
22 input_count: int = 0
23 output_count: int = 0
24 rejected_count: int = 0
25 rewritten_count: int = 0
26 execution_time: float = 0.0
27 # QA-level statistics
28 input_qa_count: int = 0
29 output_qa_count: int = 0
30 rejected_qa_count: int = 0
31 # Split statistics (partial rejection causes item split)
32 split_count: int = 0
33 details: Dict[str, Any] = field(default_factory=dict)
34
35 @property
36 def reject_rate(self) -> float:
37 """Calculate reject rate (item level)."""
38 if self.input_count == 0:
39 return 0.0
40 return self.rejected_count / self.input_count
41
42 @property
43 def rewrite_rate(self) -> float:
44 """Calculate rewrite rate."""
45 if self.input_count == 0:
46 return 0.0
47 return self.rewritten_count / self.input_count
48
49 @property
50 def qa_reject_rate(self) -> float:
51 """Calculate QA-level reject rate."""
52 if self.input_qa_count == 0:
53 return 0.0
54 return self.rejected_qa_count / self.input_qa_count
55
56
57@dataclass

Callers 8

test_create_basicMethod · 0.90
test_with_detailsMethod · 0.90
end_operatorMethod · 0.85
record_operatorMethod · 0.85

Calls

no outgoing calls

Tested by 6

test_create_basicMethod · 0.72
test_with_detailsMethod · 0.72