Skip to content

Add create-validation time to stream provisioning metric#1033

Merged
dhananjay-sawner merged 5 commits into
linkedin:masterfrom
dhananjay-sawner:capture-create-validation-time
Jun 23, 2026
Merged

Add create-validation time to stream provisioning metric#1033
dhananjay-sawner merged 5 commits into
linkedin:masterfrom
dhananjay-sawner:capture-create-validation-time

Conversation

@dhananjay-sawner

@dhananjay-sawner dhananjay-sawner commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • recordStreamProvisioningTime now adds the create-validation time to the provisioning duration. The value comes from the datastream metadata property system.createValidationTime.ms. Provisioning time becomes (now - system.creation.ms) + system.createValidationTime.ms, so the streamProvisioningTimeMs histogram and the within/outside SLA counters reflect validation time plus creation time.
  • Absent or malformed system.createValidationTime.ms is treated as 0, so streams created before the property existed keep computing now - system.creation.ms exactly as before.
  • Raise the default provisioning SLA threshold (brooklin.server.coordinator.provisioningSlaThresholdMs) from 8 to 10 minutes.
  • Add CREATE_VALIDATION_TIME_MS to DatastreamMetadataConstants.

Testing Done

  • Added TestCoordinatorStandalone covering getCreateValidationTimeMs: present-and-positive (included), absent, non-positive, and malformed (all excluded as 0).
  • Added testProvisioningSlaThresholdConfig to TestCoordinatorConfig: default is 10 minutes and the config override is honored.
  • ./gradlew :datastream-server:test passes.

Notes for Reviewers

The new unit tests live in a new TestCoordinatorStandalone class rather than the existing TestCoordinator, for following reasons:

  • Module. The code under test (Coordinator.getCreateValidationTimeMs) is in datastream-server, but the existing TestCoordinator is in datastream-server-restli. A unit test belongs in the same module as the code so ./gradlew :datastream-server:test covers it.
  • Type. The existing TestCoordinator is an integration test that stands up an embedded cluster. This is a pure, cluster-free unit test and does not belong in that test suite.
  • No existing home. datastream-server had no Coordinator unit-test class, and the name cannot be TestCoordinator because that fully-qualified name is already used by the restli test. TestCoordinatorStandalone is the general home for cluster-free Coordinator unit tests.

Dhananjay Sawner and others added 3 commits June 22, 2026 17:28
recordStreamProvisioningTime now adds the resource provider's create-validation
time (datastream metadata system.createValidationTime.ms) on top of
(now - system.creation.ms), so the stream provisioning histogram and the
within/outside-SLA counters reflect validation plus creation time. Absent or
malformed values are treated as 0, keeping behavior identical for streams
created before this property existed.
Also raise the default provisioning SLA threshold from 8 to 10 minutes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Compute createValidationTimeMs (defaulting to 0) and always add it, instead of
conditionally adding inside the present-and-positive check. Logically identical,
but the read-then-add-0-or-value flow is clearer.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dhananjay-sawner dhananjay-sawner force-pushed the capture-create-validation-time branch 3 times, most recently from 97eeb3c to 6743449 Compare June 22, 2026 15:32
Move the metadata read into a @VisibleForTesting static helper
getCreateValidationTimeMs(Datastream). Add TestCoordinatorStandalone, a general
home for cluster-free Coordinator unit tests (the integration test stays as
TestCoordinator in datastream-server-restli). It covers present-and-positive
(included), absent, non-positive, and malformed (all excluded as 0). The inline
logic lived in a private void method that writes to an internally-constructed
metrics object, so it was not directly assertable; a pure static helper is.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dhananjay-sawner dhananjay-sawner force-pushed the capture-create-validation-time branch from 6743449 to f152c5c Compare June 22, 2026 15:47
@dhananjay-sawner dhananjay-sawner marked this pull request as ready for review June 22, 2026 15:51
// Include the create-validation time in the stream provisioning time
streamProvisioningTimeMs += getCreateValidationTimeMs(ds);

_log.info("Total stream provisioning time for Datastream {} - {} ms", ds.getName(), streamProvisioningTimeMs);

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.

might be good to log all the details - validation time, creation time and total?

Per review feedback, capture creation time and create-validation time separately
and log all three when a stream reaches READY (creation + create-validation =
total provisioning time).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dhananjay-sawner dhananjay-sawner force-pushed the capture-create-validation-time branch from 518913e to 32fe947 Compare June 23, 2026 13:23
@dhananjay-sawner dhananjay-sawner merged commit 060413e into linkedin:master Jun 23, 2026
1 check 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.

3 participants