All Projects → markzhai → Androidperformancemonitor

markzhai / Androidperformancemonitor

Licence: apache-2.0
A transparent ui-block detection library for Android. (known as BlockCanary)

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Androidperformancemonitor

App perf
Open source application performance monitoring tool with emphasis on ease of setup and use. Providing similar functionality like NewRelic/AppNeta/Skylight etc.
Stars: ✭ 353 (-94.34%)
Mutual labels:  monitor, apm, performance
Myperf4j
High performance Java APM. Powered by ASM. Try it. Test it. If you feel its better, use it.
Stars: ✭ 2,281 (-63.45%)
Mutual labels:  monitor, apm, performance
React Intersection Observer
React implementation of the Intersection Observer API to tell you when an element enters or leaves the viewport.
Stars: ✭ 2,689 (-56.91%)
Mutual labels:  monitor, performance
Easy Monitor
企业级 Node.js 应用性能监控与线上故障定位解决方案
Stars: ✭ 2,451 (-60.73%)
Mutual labels:  monitor, performance
Droidtelescope
DroidTelescope(DT),Android端App性能监控框架
Stars: ✭ 231 (-96.3%)
Mutual labels:  monitor, performance
Nemetric
前端性能指标的监控,采集以及上报。用于测量第一个dom生成的时间(FP/FCP/LCP)、用户最早可操作时间(fid|tti)和组件的生命周期性能,,网络状况以及资源大小等等。向监控后台报告实际用户测量值。
Stars: ✭ 145 (-97.68%)
Mutual labels:  monitor, performance
Lagmonitor
Monitor performance of your Minecraft server. Similar to VisualVM and Java Mission Control.
Stars: ✭ 147 (-97.64%)
Mutual labels:  monitor, performance
Oknetworkmonitor
A network monitor for OkHttp.
Stars: ✭ 204 (-96.73%)
Mutual labels:  monitor, apm
React Cool Inview
😎 🖥️ React hook to monitor an element enters or leaves the viewport (or another element).
Stars: ✭ 830 (-86.7%)
Mutual labels:  monitor, performance
Rails performance
Monitor performance of you Rails applications
Stars: ✭ 345 (-94.47%)
Mutual labels:  apm, performance
Processhacker
A free, powerful, multi-purpose tool that helps you monitor system resources, debug software and detect malware.
Stars: ✭ 6,285 (+0.71%)
Mutual labels:  monitor, performance
Prism
Application Performance Management & Monitoring for iOS (APM)
Stars: ✭ 67 (-98.93%)
Mutual labels:  monitor, apm
Mthawkeye
Profiling / Debugging assist tools for iOS. (Memory Leak, OOM, ANR, Hard Stalling, Network, OpenGL, Time Profile ...)
Stars: ✭ 1,119 (-82.07%)
Mutual labels:  monitor, apm
Sentry
Sentry is cross-platform application monitoring, with a focus on error reporting.
Stars: ✭ 29,700 (+375.89%)
Mutual labels:  monitor, apm
Inspectit
inspectIT is the leading Open Source APM (Application Performance Management) tool for analyzing your Java (EE) applications.
Stars: ✭ 513 (-91.78%)
Mutual labels:  apm, performance
Adi
ADI(Android Debug Intensive) 是通过 JVMTI 实现的 Android 应用开发调试的增强工具集,目前主要提供性能相关的监控能力。
Stars: ✭ 194 (-96.89%)
Mutual labels:  monitor, apm
Androidgodeye
An app performance monitor(APM) , like "Android Studio profiler", you can easily monitor the performance of your app real time in browser
Stars: ✭ 2,430 (-61.06%)
Mutual labels:  apm, blockcanary
Javamelody
JavaMelody : monitoring of JavaEE applications
Stars: ✭ 2,486 (-60.17%)
Mutual labels:  apm, performance
vaper
Take a look at the relations among servers.
Stars: ✭ 16 (-99.74%)
Mutual labels:  monitor, apm
Ruby server timing
Bring Rails server-side performance metrics 📈 to Chrome's Developer Tools via the Server Timing API. Production Safe™.
Stars: ✭ 508 (-91.86%)
Mutual labels:  apm, performance

Chinese README

Android Performance Monitor Maven Central

A transparent ui-block detection library for Android, app only needs one-line-code to setup.

The naming is to pay respect to the great library LeakCanary, ui-related codes are modified from leakcanary's ui part.

  • 1.5.0 Add context that can stop monitor in debug mode.
  • 1.4.1 Bug fix.
  • 1.4.0 Bug fix, add onBlock interceptor in context.
  • 1.3.1 Enable configuration of label and icon.
  • 1.3.0 Add white-list and concern-package feature.

Getting started

You may choose how to assemble them as you like.

dependencies {
    // most often used way, enable notification to notify block event
    compile 'com.github.markzhai:blockcanary-android:1.5.0'

    // this way you only enable BlockCanary in debug package
    // debugCompile 'com.github.markzhai:blockcanary-android:1.5.0'
    // releaseCompile 'com.github.markzhai:blockcanary-no-op:1.5.0'
}

As this library uses getMainLooper().setMessageLogging(), please check if you set it in your app (related issue https://github.com/moduth/blockcanary/issues/27)

Usage

Maximum log count is set to 500, you can rewrite it in your app int.xml.

<integer name="block_canary_max_stored_count">1000</integer>

Monitor app's label and icon can be configured by placing a block_canary_icon drawable in your xhdpi drawable directory and in strings.xml:

<string name="block_canary_display_activity_label">Blocks</string>
public class DemoApplication extends Application {
    @Override
    public void onCreate() {
        // ...
        // Do it on main process
        BlockCanary.install(this, new AppBlockCanaryContext()).start();
    }
}

Implement your application BlockCanaryContext context (strongly recommend you to check all these configs):

public class AppBlockCanaryContext extends BlockCanaryContext {

    /**
     * Implement in your project.
     *
     * @return Qualifier which can specify this installation, like version + flavor.
     */
    public String provideQualifier() {
        return "unknown";
    }

    /**
     * Implement in your project.
     *
     * @return user id
     */
    public String provideUid() {
        return "uid";
    }

    /**
     * Network type
     *
     * @return {@link String} like 2G, 3G, 4G, wifi, etc.
     */
    public String provideNetworkType() {
        return "unknown";
    }

    /**
     * Config monitor duration, after this time BlockCanary will stop, use
     * with {@code BlockCanary}'s isMonitorDurationEnd
     *
     * @return monitor last duration (in hour)
     */
    public int provideMonitorDuration() {
        return -1;
    }

    /**
     * Config block threshold (in millis), dispatch over this duration is regarded as a BLOCK. You may set it
     * from performance of device.
     *
     * @return threshold in mills
     */
    public int provideBlockThreshold() {
        return 1000;
    }

    /**
     * Thread stack dump interval, use when block happens, BlockCanary will dump on main thread
     * stack according to current sample cycle.
     * <p>
     * Because the implementation mechanism of Looper, real dump interval would be longer than
     * the period specified here (especially when cpu is busier).
     * </p>
     *
     * @return dump interval (in millis)
     */
    public int provideDumpInterval() {
        return provideBlockThreshold();
    }

    /**
     * Path to save log, like "/blockcanary/", will save to sdcard if can.
     *
     * @return path of log files
     */
    public String providePath() {
        return "/blockcanary/";
    }

    /**
     * If need notification to notice block.
     *
     * @return true if need, else if not need.
     */
    public boolean displayNotification() {
        return true;
    }

    /**
     * Implement in your project, bundle files into a zip file.
     *
     * @param src  files before compress
     * @param dest files compressed
     * @return true if compression is successful
     */
    public boolean zip(File[] src, File dest) {
        return false;
    }

    /**
     * Implement in your project, bundled log files.
     *
     * @param zippedFile zipped file
     */
    public void upload(File zippedFile) {
        throw new UnsupportedOperationException();
    }


    /**
     * Packages that developer concern, by default it uses process name,
     * put high priority one in pre-order.
     *
     * @return null if simply concern only package with process name.
     */
    public List<String> concernPackages() {
        return null;
    }

    /**
     * Filter stack without any in concern package, used with @{code concernPackages}.
     *
     * @return true if filter, false it not.
     */
    public boolean filterNonConcernStack() {
        return false;
    }

    /**
     * Provide white list, entry in white list will not be shown in ui list.
     *
     * @return return null if you don't need white-list filter.
     */
    public List<String> provideWhiteList() {
        LinkedList<String> whiteList = new LinkedList<>();
        whiteList.add("org.chromium");
        return whiteList;
    }

    /**
     * Whether to delete files whose stack is in white list, used with white-list.
     *
     * @return true if delete, false it not.
     */
    public boolean deleteFilesInWhiteList() {
        return true;
    }

    /**
     * Block interceptor, developer may provide their own actions.
     */
    public void onBlock(Context context, BlockInfo blockInfo) {

    }
}

How does it work?

Blog in Chinese: BlockCanary.

Principle flow picture:

flow

Screenshot

Block detail Block list

Donation

If you find this repository helpful, you may make a donation to me via alipay or wechat. alipay wechat

Contributors

This library is initially created by markzhai, and maintained under the organization moduth with nimengbo and zzz40500.

Special thanks to android-cjj, Mr.Bao, chiahaolu to contribute.

Change Log

Check CHANGELOG

Contribute

If you would like to contribute code to BlockCanary you can do so through GitHub by forking the repository and sending a pull request.

License

Copyright (C) 2016 MarkZhai (http://zhaiyifan.cn).

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].