agent_c 2.9 → 2.997

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d647a877e7e6660d1c9ab7f5e2ce9e00d8f932c78d9ca6a47467265cc2c62e4e
4
- data.tar.gz: 83e0796a0545c207c5afdebd457ac3134ea0b8bd5b9cd327a02de5f2049cc02b
3
+ metadata.gz: fa0c1e6747ab6bb982f0b82ae5fe7c18441e6196e693f70094c590e4a1096b2f
4
+ data.tar.gz: 75fc9a175b37a483d2bad9a69519e793cfa235fef71d59ae20a8c56e8bcc96ba
5
5
  SHA512:
6
- metadata.gz: a248627251111087a4814c86a5c980cdafa7936f0ae2b420b397485b367c7e0f693b2d4f6dcc6a46070c4381d2e2eaff775e31615bfdd5c0ea72e984655bec74
7
- data.tar.gz: ce5adb048f393142b008a15943e2337597f2969a76cd8446a1890e5440ad9c73d39af74052085d916b58fbbbd551a23385db2b6285f68e359f676b5fb5fa67d4
6
+ metadata.gz: c98a44ddebeeebc1e39aef2b4965e3c6e01e7d205e0db6227016e4804c0982f52bcf17baf1c972c1dffe8470d1ca587dfa308eaa00ba968fc0af8cb5f429b4a7
7
+ data.tar.gz: 9bf34db0557a760aed8d1a81b4a8bfbe13acf5baf91c6e8c605a23562e57be0a97e8ff5e5896de03bb4adfc3809cd9fea8f1555615bd99492222cf6a29849072
data/lib/agent_c/batch.rb CHANGED
@@ -43,14 +43,52 @@ module AgentC
43
43
  pending_count = tasks.count { |task| task.pending? }
44
44
  failed_count = tasks.count { |task| task.failed? }
45
45
 
46
+ out.puts "Total: #{tasks.count}"
46
47
  out.puts "Succeeded: #{succeeded_count}"
47
48
  out.puts "Pending: #{pending_count}"
48
49
  out.puts "Failed: #{failed_count}"
49
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}"
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 * worktree_count.to_f) / tasks.count.to_f
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|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AgentC
4
- VERSION = "2.9"
4
+ VERSION = "2.997"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agent_c
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.9'
4
+ version: '2.997'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Kinnecom