Refactor log_refresh_service_duration to measure only other_method_calls with granular metrics

Summary

This MR refactors the log_refresh_service_duration feature flag implementation to focus on measuring the other_method_calls section with granular metrics for each operation.

Changes

Removed measurements from:

  • find_new_commits
  • close_upon_missing_source_branch_ref
  • post_merge_manually_merged
  • link_forks_lfs_objects
  • reload_merge_requests

Split other_method_calls into individual measurements:

  • outdate_suggestions_duration_s (aggregated per MR)
  • abort_auto_merges_duration_s (aggregated per MR)
  • mark_pending_todos_done_duration_s (aggregated per MR)
  • abort_ff_merge_requests_with_auto_merges_duration_s
  • cache_merge_requests_closing_issues_duration_s
  • comment_mr_branch_presence_changed_duration_s (aggregated per MR)
  • notify_about_push_duration_s (aggregated per MR)
  • mark_mr_as_draft_from_commits_duration_s (aggregated per MR)
  • track_mr_including_ci_config_duration_s (aggregated per MR)

New helper method:

Added measure_duration_aggregated to accumulate durations for operations that run multiple times (once per MR), providing the total time spent across all MRs.

Metrics Output

The feature flag will now log:

  • other_method_calls_duration_s - Total time for the entire block
  • Individual operation durations (aggregated where applicable)
  • refresh_service_total_duration_s - Overall total

Related to #576798

Merge request reports

Loading