Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
yschimke committed Dec 31, 2024
1 parent 3a04d68 commit 5b256a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package okhttp3.android;
package okhttp3.android

import androidx.tracing.Trace
import java.util.concurrent.atomic.AtomicInteger
Expand All @@ -30,15 +30,24 @@ import okio.IOException
class TracingConnectionListener : ConnectionListener() {
private val idGenerator = AtomicInteger(0)

override fun connectStart(route: Route, call: Call) {
override fun connectStart(
route: Route,
call: Call,
) {
Trace.beginAsyncSection(route.tracingTag, idGenerator.incrementAndGet())
}

override fun connectFailed(route: Route, call: Call, failure: IOException) {
override fun connectFailed(
route: Route,
call: Call,
failure: IOException,
) {
// TODO same id
Trace.endAsyncSection(route.tracingTag, idGenerator.incrementAndGet())
}

override fun connectionClosed(connection: Connection) {
// TODO same id
Trace.endAsyncSection(connection.route().tracingTag, idGenerator.incrementAndGet())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*
*/
package okhttp3.android;
package okhttp3.android

import androidx.tracing.trace
import okhttp3.Interceptor
Expand Down

0 comments on commit 5b256a8

Please sign in to comment.