diff --git a/cmd/prcost/main.go b/cmd/prcost/main.go index 6c6bcef..7304b25 100644 --- a/cmd/prcost/main.go +++ b/cmd/prcost/main.go @@ -31,7 +31,7 @@ func main() { // Org/Repo sampling flags org := flag.String("org", "", "GitHub organization to analyze (optionally with --repo for single repo)") repo := flag.String("repo", "", "GitHub repository to analyze (requires --org)") - samples := flag.Int("samples", 30, "Number of PRs to sample for extrapolation (30=fast/±18%, 50=slower/±14%)") + samples := flag.Int("samples", 50, "Number of PRs to sample for extrapolation (30=fast/±18%, 50=slower/±14%)") days := flag.Int("days", 60, "Number of days to look back for PR modifications") // Modeling flags diff --git a/internal/server/integration_test.go b/internal/server/integration_test.go index 775f863..ffe43d3 100644 --- a/internal/server/integration_test.go +++ b/internal/server/integration_test.go @@ -33,8 +33,8 @@ func TestOrgSampleStreamIntegration(t *testing.T) { // Create request reqBody := OrgSampleRequest{ Org: "codeGROOVE-dev", - SampleSize: 30, - Days: 90, + SampleSize: 50, + Days: 60, } body, err := json.Marshal(reqBody) if err != nil { @@ -195,8 +195,8 @@ func TestOrgSampleStreamNoTimeout(t *testing.T) { // Create request with larger sample size to ensure longer operation reqBody := OrgSampleRequest{ Org: "codeGROOVE-dev", - SampleSize: 30, - Days: 90, + SampleSize: 50, + Days: 60, } body, err := json.Marshal(reqBody) if err != nil { diff --git a/internal/server/server.go b/internal/server/server.go index a06c2b5..1ba2431 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -144,8 +144,8 @@ type CalculateResponse struct { type RepoSampleRequest struct { Owner string `json:"owner"` Repo string `json:"repo"` - SampleSize int `json:"sample_size,omitempty"` // Default: 30 - Days int `json:"days,omitempty"` // Default: 90 + SampleSize int `json:"sample_size,omitempty"` // Default: 50 + Days int `json:"days,omitempty"` // Default: 60 Config *cost.Config `json:"config,omitempty"` } @@ -154,8 +154,8 @@ type RepoSampleRequest struct { //nolint:govet // fieldalignment: API struct field order optimized for readability type OrgSampleRequest struct { Org string `json:"org"` - SampleSize int `json:"sample_size,omitempty"` // Default: 30 - Days int `json:"days,omitempty"` // Default: 90 + SampleSize int `json:"sample_size,omitempty"` // Default: 50 + Days int `json:"days,omitempty"` // Default: 60 Config *cost.Config `json:"config,omitempty"` } @@ -1478,10 +1478,10 @@ func (s *Server) parseRepoSampleRequest(ctx context.Context, r *http.Request) (* // Set defaults if req.SampleSize == 0 { - req.SampleSize = 30 + req.SampleSize = 50 } if req.Days == 0 { - req.Days = 90 + req.Days = 60 } // Validate reasonable limits (silently cap at 50) @@ -1536,10 +1536,10 @@ func (s *Server) parseOrgSampleRequest(ctx context.Context, r *http.Request) (*O // Set defaults if req.SampleSize == 0 { - req.SampleSize = 30 + req.SampleSize = 50 } if req.Days == 0 { - req.Days = 90 + req.Days = 60 } // Validate reasonable limits (silently cap at 50) diff --git a/internal/server/server_test.go b/internal/server/server_test.go index dc47b60..39fe200 100644 --- a/internal/server/server_test.go +++ b/internal/server/server_test.go @@ -1483,8 +1483,8 @@ func TestParseRepoSampleRequest(t *testing.T) { wantErr: false, wantOwner: "testowner", wantRepo: "testrepo", - wantDays: 90, - wantSampleSize: 30, + wantDays: 60, + wantSampleSize: 50, }, { name: "missing owner", @@ -1570,8 +1570,8 @@ func TestParseOrgSampleRequest(t *testing.T) { body: `{"org":"testorg"}`, wantErr: false, wantOrg: "testorg", - wantDays: 90, - wantSampleSize: 30, + wantDays: 60, + wantSampleSize: 50, }, { name: "missing org", diff --git a/internal/server/static/index.html b/internal/server/static/index.html index fc7095f..7c6dacd 100644 --- a/internal/server/static/index.html +++ b/internal/server/static/index.html @@ -1059,11 +1059,11 @@