All Projects → raskasa → metrics-okhttp

raskasa / metrics-okhttp

Licence: Apache-2.0 license
An OkHttp HTTP client wrapper providing Metrics instrumentation of connection pools, request durations and rates, and other useful information.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to metrics-okhttp

Kotlin Networking
Kotlin Networking - An elegant networking library written in Kotlin
Stars: ✭ 88 (+388.89%)
Mutual labels:  okhttp, okhttp3
Okhttps
如艺术一般优雅,像 1、2、3 一样简单,前后端通用,轻量却强大的 HTTP 客户端(同时支持 WebSocket 与 Stomp 协议)
Stars: ✭ 92 (+411.11%)
Mutual labels:  okhttp, okhttp3
FastHttpClient
封装OkHttp3,对外提供了POST请求、GET请求、上传文件、下载文件、https请求、cookie管理等功能
Stars: ✭ 60 (+233.33%)
Mutual labels:  okhttp, okhttp3
RxHttp
基于RxJava2+Retrofit+OkHttp4.x封装的网络请求类库,亮点多多,完美兼容MVVM(ViewModel,LiveData),天生支持网络请求和生命周期绑定,天生支持多BaseUrl,支持文件上传下载进度监听,支持断点下载,支持Glide和网络请求公用一个OkHttpClient⭐⭐⭐
Stars: ✭ 25 (+38.89%)
Mutual labels:  okhttp, okhttp3
java-okhttp
OpenTracing Okhttp client instrumentation
Stars: ✭ 21 (+16.67%)
Mutual labels:  instrumentation, okhttp
Livedata Call Adapter
A simple LiveData call adapter for retrofit
Stars: ✭ 119 (+561.11%)
Mutual labels:  okhttp, okhttp3
WanAndroid
wanandroid的Kotlin版,采用Android X
Stars: ✭ 20 (+11.11%)
Mutual labels:  okhttp, okhttp3
finch
🖥 Debug menu library for Android apps with supports network activity logging and many other useful features.
Stars: ✭ 42 (+133.33%)
Mutual labels:  okhttp, okhttp3
Retrofiturlmanager
🔮 Let Retrofit support multiple baseUrl and can be change the baseUrl at runtime (以最简洁的 Api 让 Retrofit 同时支持多个 BaseUrl 以及动态改变 BaseUrl).
Stars: ✭ 1,961 (+10794.44%)
Mutual labels:  okhttp, okhttp3
Chucker
🔎 An HTTP inspector for Android & OkHTTP (like Charles but on device)
Stars: ✭ 2,169 (+11950%)
Mutual labels:  okhttp, okhttp3
Java Specialagent
Automatic instrumentation for 3rd-party libraries in Java applications with OpenTracing.
Stars: ✭ 156 (+766.67%)
Mutual labels:  instrumentation, okhttp
iMoney
iMoney 金融项目
Stars: ✭ 55 (+205.56%)
Mutual labels:  okhttp, okhttp3
GitMessengerBot-Android
타입스크립트, V8 엔진의 자바스크립트, 파이썬 그리고 Git을 지원하는 최첨단 메신저 봇!
Stars: ✭ 51 (+183.33%)
Mutual labels:  okhttp
LifeHelper
我的毕业设计,功能还是比较完善的
Stars: ✭ 40 (+122.22%)
Mutual labels:  okhttp3
prometheus-plugs
Prometheus.erl Elixir Plugs
Stars: ✭ 52 (+188.89%)
Mutual labels:  instrumentation
eyepetizer kotlin
一款仿开眼短视频App,分别采用MVP、MVVM两种模式实现。一、组件化 + Kotlin + MVP + RxJava + Retrofit + OkHttp 二、组件化 + Kotlin + MVVM + LiveData + DataBinding + Coroutines + RxJava + Retrofit + OkHttp
Stars: ✭ 83 (+361.11%)
Mutual labels:  okhttp3
OkSimple
OkSimple :powerful and simple okhttp network library
Stars: ✭ 57 (+216.67%)
Mutual labels:  okhttp
opencensus-go-exporter-stackdriver
OpenCensus Go exporter for Stackdriver Monitoring and Trace
Stars: ✭ 65 (+261.11%)
Mutual labels:  instrumentation
console
Oracle Instrumentation Console: Lightweight PL/SQL logging tool inspired by the JavaScript Console
Stars: ✭ 14 (-22.22%)
Mutual labels:  instrumentation
instrumentation
An extensible java agent framework that instruments (modifies the bytecode at class loading time) programs running on the JVM, with the purpose of capturing method invocation events (start, finish, errors ...) and notifying custom listeners.
Stars: ✭ 39 (+116.67%)
Mutual labels:  instrumentation

Metrics Integration for OkHttp

⚠️ As of September 2021, this project's maintainer, @raskasa, has not been able to use this project in production for a number of years. As a result, active development has stalled; it will likely remain stalled moving forward unless the opportunity arises again for the maintainer to use it in production.

An OkHttp HTTP client wrapper providing Metrics instrumentation of connection pools, request durations and rates, and other useful information.

Usage

Metrics Integration for OkHttp provides InstrumentedOkHttpClients, a static factory class for instrumenting OkHttp HTTP clients.

You can create an instrumented OkHttpClient by doing the following:

MetricRegistry registry = ...;
OkHttpClient client = InstrumentedOkHttpClients.create(registry);

If you wish to provide your own OkHttpClient instance, you can do that as well:

MetricRegistry registry = ...;
OkHttpClient rawClient = ...;
OkHttpClient client = InstrumentedOkHttpClients.create(registry, rawClient);

If you use more than one OkHttpClient instance in your application, you may want to provide a custom name when instrumenting the clients in order to properly distinguish them:

MetricRegistry registry = ...;
OkHttpClient client = InstrumentedOkHttpClients.create(registry, "custom-name");

MetricRegistry registry = ...;
OkHttpClient rawClient = ...;
OkHttpClient client = InstrumentedOkHttpClients.create(registry, rawClient, "custom-name");

An instrumented OkHttp HTTP client provides the following metrics:

okhttp3.EventListener.calls-duration
okhttp3.EventListener.calls-end
okhttp3.EventListener.calls-failed
okhttp3.EventListener.calls-start
okhttp3.EventListener.connections-acquired
okhttp3.EventListener.connections-duration
okhttp3.EventListener.connections-end
okhttp3.EventListener.connections-failed
okhttp3.EventListener.connections-released
okhttp3.EventListener.connections-start
okhttp3.EventListener.dns-duration
okhttp3.EventListener.dns-end
okhttp3.EventListener.dns-start
okhttp3.OkHttpClient.cache-request-count
okhttp3.OkHttpClient.cache-hit-count
okhttp3.OkHttpClient.cache-network-count
okhttp3.OkHttpClient.cache-current-size
okhttp3.OkHttpClient.cache-max-size
okhttp3.OkHttpClient.cache-size
okhttp3.OkHttpClient.cache-write-success-count
okhttp3.OkHttpClient.cache-write-abort-count
okhttp3.OkHttpClient.connection-pool-count
okhttp3.OkHttpClient.connection-pool-count-http
okhttp3.OkHttpClient.connection-pool-count-multiplexed
okhttp3.OkHttpClient.connection-pool-idle-count
okhttp3.OkHttpClient.connection-pool-total-count
okhttp3.OkHttpClient.network-requests-completed
okhttp3.OkHttpClient.network-requests-duration
okhttp3.OkHttpClient.network-requests-running
okhttp3.OkHttpClient.network-requests-submitted

If you provide a custom name for the instrumented client (i.e. custom-name), the metrics will have the following format:

...
okhttp3.OkHttpClient.custom-name.cache-write-success-count
okhttp3.OkHttpClient.custom-name.cache-write-abort-count
okhttp3.OkHttpClient.custom-name.connection-pool-count
...

Download

Metrics Integration for OkHttp is currently under development. The API is not stable and neither is the feature set.

Download the latest jar or depend on Maven:

<dependency>
  <groupId>com.raskasa.metrics</groupId>
  <artifactId>metrics-okhttp</artifactId>
  <version>0.5.0</version>
</dependency>

or Gradle:

compile 'com.raskasa.metrics:metrics-okhttp:0.5.0'

Snapshots of the development version are available in Sonatype's snapshots repository.

License

Copyright 2015 Ras Kasa Williams

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].