Skip to content

refactor!: rename *finished* statistics to *succeeded* - #2550

Merged
vdusek merged 4 commits into
v2from
rename-succeeded-statistics
Nov 30, 2026
Merged

vdusek merged 4 commits into
v2from
rename-succeeded-statistics

Conversation

@vdusek

@vdusek vdusek commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Renames the request statistics that count successful requests, the same as Crawlee JS v4 (apify/crawlee#4109):

v1 v2
requests_finished requests_succeeded
requests_finished_per_minute requests_succeeded_per_minute
request_avg_finished_duration request_avg_succeeded_duration
request_total_finished_duration request_total_succeeded_duration

The renames apply to StatisticsState and FinalStatistics, and to the camelCase keys of the persisted statistics (requestsSucceeded, requestTotalSucceededDurationMillis, and so on). The upgrade guide lists them.

Other changes:

  • A persisted state with the v1 keys requestsFinished and requestTotalFinishedDurationMillis, such as one under an explicit persist_state_key, still loads into the renamed fields.
  • StatisticsState.requests_succeeded_per_minute and requests_failed_per_minute are now computed from the request counts and the crawler runtime, the same as in FinalStatistics. Before, nothing updated them, so they stayed 0, also in the persisted statistics.

BREAKING CHANGE: The periodic and final statistics logs name the renamed fields: requests_succeeded, requests_succeeded_per_minute and request_avg_succeeded_duration in place of requests_finished, requests_finished_per_minute and request_avg_finished_duration.

Closes: #2335

✍️ Drafted by Claude Code

BREAKING CHANGE: The periodic and final statistics logs name the renamed fields: `requests_succeeded`, `requests_succeeded_per_minute` and `request_avg_succeeded_duration` in place of `requests_finished`, `requests_finished_per_minute` and `request_avg_finished_duration`.
@vdusek vdusek added the t-tooling Issues with this label are in the ownership of the tooling team. label Nov 30, 2026
@vdusek vdusek self-assigned this Nov 30, 2026
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (v2@ad67d30). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff          @@
##             v2    #2550   +/-   ##
=====================================
  Coverage      ?   95.56%           
=====================================
  Files         ?      196           
  Lines         ?    15548           
  Branches      ?        0           
=====================================
  Hits          ?    14859           
  Misses        ?      689           
  Partials      ?        0           
Flag Coverage Δ
integration 75.37% <96.42%> (?)
unit 89.81% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek
vdusek marked this pull request as ready for review November 30, 2026 14:47
@vdusek
vdusek requested a review from Mantisus November 30, 2026 14:47

@Mantisus Mantisus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one moment. Otherwise, LGTM.

Comment thread src/crawlee/statistics/_statistics.py Resolved

@apify-approval-mirror apify-approval-mirror Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mirroring approval from @Mantisus.

@apify-approval-mirror apify-approval-mirror Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mirroring approval from @Mantisus.

@vdusek
vdusek merged commit f1a68d3 into v2 Nov 30, 2026
42 of 133 checks passed
@vdusek
vdusek deleted the rename-succeeded-statistics branch November 30, 2026 16:12
@vdusek vdusek linked an issue Nov 30, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename the *finished* request statistics to *succeeded*

2 participants