Skip to content

Expose metrics on Connection interface#9321

Open
Amir-yazdanmanesh wants to merge 1 commit intosquare:masterfrom
Amir-yazdanmanesh:expose-connection-metrics
Open

Expose metrics on Connection interface#9321
Amir-yazdanmanesh wants to merge 1 commit intosquare:masterfrom
Amir-yazdanmanesh:expose-connection-metrics

Conversation

@Amir-yazdanmanesh
Copy link
Contributor

Summary

  • Add 5 new methods to the Connection interface: connectAtMillis(), idleAtMillis(), successCount(), callCount(), and noNewExchanges()
  • Rename internal Carrier.noNewExchanges() to Carrier.prohibitNewExchanges() to avoid JVM method signature clash
  • Track idle/active epoch transitions in RealCall and RealConnectionPool

Test plan

  • ./gradlew :okhttp:jvmTest --tests "okhttp3.KotlinSourceModernTest.connection" (compile check)
  • ./gradlew :okhttp:jvmTest --tests "okhttp3.ConnectionListenerTest" (integration)
  • ./gradlew apiCheck (API compatibility)

Closes #9219

  Add connectAtMillis(), idleAtMillis(), successCount(), callCount(), and
  noNewExchanges() to the public Connection interface so users can build
  features like ConnectionExpiringInterceptor.

  Rename Carrier.noNewExchanges() to Carrier.prohibitNewExchanges() to
  avoid a JVM method signature clash with the new Connection.noNewExchanges()
  getter.

  Closes square#9219
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.

Expose metrics on Connection

1 participant