agent_c 2.9 → 2.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/agent_c/batch.rb +38 -0
- data/lib/agent_c/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 79f0d67a835d59d209e68ed409334ca100b65d1caa8b3c43a26676ad0f32c027
|
|
4
|
+
data.tar.gz: fc55ea6795f45df4b3fe99c8418c5fef35a689661eacb9dac2b95fbaf91f7aaa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d9559be33ba70c96b52345dbc7aff15dad021bf31cc1186a8ad23c886d169e8dabefe2e8ba37a02974c725e44a1e2f0d401a2d98a3590a3701f834ed3ab3b38
|
|
7
|
+
data.tar.gz: 5e8d33069f37e7b5e2ebd3432e85fe40f77f2f91c4b331cd32ebeb8d487c4ea69a894524c9190feab945089821aa5bc90ed51575fda37a4fd87e91ae249811e6
|
data/lib/agent_c/batch.rb
CHANGED
|
@@ -46,11 +46,49 @@ module AgentC
|
|
|
46
46
|
out.puts "Succeeded: #{succeeded_count}"
|
|
47
47
|
out.puts "Pending: #{pending_count}"
|
|
48
48
|
out.puts "Failed: #{failed_count}"
|
|
49
|
+
out.puts "Tasks: #{tasks.count}"
|
|
50
|
+
|
|
51
|
+
# Calculate time span
|
|
52
|
+
if tasks.any?
|
|
53
|
+
created_ats = tasks.map(&:created_at).compact
|
|
54
|
+
updated_ats = tasks.map(&:updated_at).compact
|
|
55
|
+
|
|
56
|
+
if created_ats.any? && updated_ats.any?
|
|
57
|
+
earliest = created_ats.min
|
|
58
|
+
latest = updated_ats.max
|
|
59
|
+
time_span_seconds = (latest - earliest).to_i
|
|
60
|
+
|
|
61
|
+
hours = time_span_seconds / 3600
|
|
62
|
+
minutes = (time_span_seconds % 3600) / 60
|
|
63
|
+
seconds = time_span_seconds % 60
|
|
64
|
+
|
|
65
|
+
out.puts "Time: #{hours} hrs, #{minutes} mins, #{seconds} secs"
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Count worktrees
|
|
70
|
+
worktree_count = store.workspace.count
|
|
71
|
+
out.puts "Worktrees: #{worktree_count}"
|
|
49
72
|
|
|
50
73
|
cost_data = session.cost
|
|
51
74
|
out.puts "Run cost: $#{'%.2f' % cost_data.run}"
|
|
52
75
|
out.puts "Project total cost: $#{'%.2f' % cost_data.project}"
|
|
53
76
|
|
|
77
|
+
# Cost and time per task
|
|
78
|
+
if tasks.count > 0
|
|
79
|
+
cost_per_task = cost_data.run / tasks.count
|
|
80
|
+
out.puts "Cost per task: $#{'%.2f' % cost_per_task}"
|
|
81
|
+
|
|
82
|
+
if tasks.any? && created_ats&.any? && updated_ats&.any?
|
|
83
|
+
total_minutes = time_span_seconds / 60.0
|
|
84
|
+
# Account for parallelism: if we have multiple worktrees,
|
|
85
|
+
# tasks could run in parallel
|
|
86
|
+
effective_minutes = worktree_count > 0 ? total_minutes / worktree_count : total_minutes
|
|
87
|
+
minutes_per_task = effective_minutes / tasks.count
|
|
88
|
+
out.puts "Minutes per task: #{'%.2f' % minutes_per_task}"
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
54
92
|
if failed_count > 0
|
|
55
93
|
out.puts "\nFirst #{[failed_count, 3].min} failed task(s):"
|
|
56
94
|
tasks.select { |task| task.failed? }.first(3).each do |task|
|
data/lib/agent_c/version.rb
CHANGED