Skip to content

HDDS-13510. Add latency metrics for key creation operation#8896

Merged
Tejaskriya merged 4 commits intoapache:masterfrom
sreejasahithi:HDDS-13510
Sep 15, 2025
Merged

HDDS-13510. Add latency metrics for key creation operation#8896
Tejaskriya merged 4 commits intoapache:masterfrom
sreejasahithi:HDDS-13510

Conversation

@sreejasahithi
Copy link
Contributor

What changes were proposed in this pull request?

As part of performance improvements, new metrics to capture latency for major sub-operation in key creation are introduced. This will help in understanding where more time is spent during key creation and make it easier to troubleshoot slowness.

What is the link to the Apache JIRA

HDDS-13510

How was this patch tested?

CI: https://github.com/sreejasahithi/ozone/actions/runs/16717200562

Sample outputs of the metrics over Prometheus for a total of 2000 keys created.

Screenshot 2025-08-04 at 10 44 23 AM Screenshot 2025-08-04 at 10 43 45 AM Screenshot 2025-08-04 at 10 43 26 AM Screenshot 2025-08-04 at 10 41 25 AM

Copy link
Contributor

@Tejaskriya Tejaskriya left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @sreejasahithi , please find some comments below

Copy link
Contributor

@Tejaskriya Tejaskriya left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for updating!

Copy link
Contributor

@sarvekshayr sarvekshayr left a comment

Choose a reason for hiding this comment

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

@sreejasahithi, please take a look at the comment below -

omBucketInfo.copyObject(), volumeId);

result = Result.SUCCESS;
long endNanosCreateKeySuccessLatencyNs = Time.monotonicNowNanos();
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename endNanosCreateKeySuccessLatencyNs in both places to createKeyEndTime, capture the time in the finally block and update the latency metrics based on result.

finally {
    long createKeyEndTime = Time.monotonicNowNanos();
    long latency = createKeyEndTime - createKeyStartTime;
    if (result == Result.SUCCESS) {
        perfMetrics.addCreateKeySuccessLatencyNs(latency);
    } else {
        perfMetrics.addCreateKeyFailureLatencyNs(latency);
    }

Copy link
Contributor

@sarvekshayr sarvekshayr left a comment

Choose a reason for hiding this comment

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

LGTM

@Tejaskriya Tejaskriya merged commit 16a1e39 into apache:master Sep 15, 2025
42 checks passed
@Tejaskriya
Copy link
Contributor

Thanks @sreejasahithi and @sarvekshayr

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.

3 participants