Skip to content

support clean metrics of OrphanFilesCleaner#118

Merged
lucasfang merged 2 commits into
alibaba:mainfrom
chongchongxiao:clean_metric
Feb 9, 2026
Merged

support clean metrics of OrphanFilesCleaner#118
lucasfang merged 2 commits into
alibaba:mainfrom
chongchongxiao:clean_metric

Conversation

@chongchongxiao

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #114

Support clean metrics of OrphanFilesCleaner

    listDirectoriesDuration
    listDirectories
    listFileStatusDuration
    listFileStatusTasks
    listUsedFilesDuration
    usedFiles
    scanOrphanFilesDuration
    orphanFiles

Tests

No.

API and Format

No.

Documentation

No.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds metrics support to the OrphanFilesCleaner component to track cleaning operations. It introduces a new Duration utility class to simplify timing measurements and refactors existing timing code in FileStoreScan and FileStoreCommit to use this utility.

Changes:

  • Added Duration utility class for measuring operation durations in milliseconds
  • Implemented CleanMetrics with 8 metric constants for tracking orphan file cleaning operations
  • Added GetMetrics() method to OrphanFilesCleaner interface and implementation to expose metrics

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/paimon/core/utils/duration.h New utility class for timing operations using high_resolution_clock
src/paimon/core/operation/metrics/clean_metrics.h Defines metric name constants for clean operations
src/paimon/core/operation/orphan_files_cleaner_impl.h Adds GetMetrics() method and metrics_ member
src/paimon/core/operation/orphan_files_cleaner_impl.cpp Implements metrics tracking in Clean(), ListPaimonFileDirs(), and GetUsedFiles()
include/paimon/orphan_files_cleaner.h Adds GetMetrics() to OrphanFilesCleaner interface
src/paimon/core/operation/file_store_scan.cpp Refactors to use Duration class instead of manual chrono calls
src/paimon/core/operation/file_store_commit_impl.cpp Refactors to use Duration class instead of manual chrono calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/paimon/core/utils/duration.h Outdated
Comment thread src/paimon/core/operation/orphan_files_cleaner_impl.cpp Outdated
Comment thread src/paimon/core/operation/orphan_files_cleaner_impl.cpp Outdated
Comment thread src/paimon/core/operation/orphan_files_cleaner_impl.h
Comment thread src/paimon/core/operation/metrics/clean_metrics.h

@lucasfang lucasfang 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.

+1

@lucasfang
lucasfang merged commit 0a4f4e2 into alibaba:main Feb 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Support clean metrics

3 participants