npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

yulin-codetree

v0.0.5

Published

A framework that shows the chain of method calls

Downloads

4

Readme

很多新人进入一家新公司后,最头疼的就是如何快速了解公司的业务和项目架构。

因为文档很少,没有文档,或者是文档严重落伍, 根本没法看;如果你碰到一个特别热心的老员工,事无巨细地给你讲,随时在你身边答疑解惑, 那简直是天大的好运气, 现实是大家都很忙,没人给你讲解。

很快就要深入项目做开发了,怎么办呢?

我在加入新公司后,就遇到了悲催的情况。于是,我就做了这款可视化流程分析插件!帮助更多入职新人快速熟悉业务。

演示网址:http://116.85.23.6:8521/projecttree

示范工程:https://gitee.com/zyzpp/Spring-Project-Tree-Demo (版本可能落后)

Maven依赖

直接在pom.xml引入依赖!

<dependency>
  <groupId>cn.yueshutong</groupId>
  <artifactId>spring-project-tree</artifactId>
  <version>0.0.5.RELEASE</version>
</dependency>

Spring Boot 项目

如果你的项目是Spring Boot,那么使用会非常简单,只需要一个注解即可。

@EnableProjectTree(value = "")注解参数为pointcut表达式,完整代码如下:

@SpringBootApplication
@EnableProjectTree("execution(* com.example.springboot.demo..*(..))")
public class SpringbootApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringbootApplication.class, args);
    }

}

Project Tree不仅增加了对分布式接口的监控,还增加了pointcut表示式。

访问ProjectTree

启动你的项目,首先访问你项目的某个接口,使其执行被监控的方法。然后访问localhost:8080/projecttree查看网页。

接口说明

| 接口 | 说明 | | ---------------------------- | -------------------- | | /projecttree | 返回完整调用链视图 | | /projecttree/all | 返回全部方法视图 | | /projecttree/json | JSON形式的返回结果 | | /projecttree/{methodId} | 对某一方法的JSON结果 |

注意事项

使用Shiro、Spring Securit等安全框架时,需要注意对此URL的权限控制。

另外,方法调用链分析并不会监控自身对自身的方法调用,因为this.method()并不是调用的代理对象的method()方法。

源码亮点

1.如何降低对主流程的性能消耗?

使用多线程实现异步非阻塞模型。

2.为什么使用单例线程池?

只有一个线程的线程池实际是队列+单线程,一个一个的执行任务,完全符合本框架的使需求,多则出错。

3.为什么数据保存到内存?

基于内存的数据读写,基于方法调用链分析进行选择性保存,占用内存极小。理论上说,从接口开始,有多少流程分支,就有多少条数据记录。

4.如何实现方法调用分析?

基于栈数据结构设计算法。

5.如何解决多线程环境对算法的影响?

通过ThreadId加Stack自定义数据结构“线程栈”实现线程隔离。

关于作者

博客:http://www.yueshutong.cn

邮箱:[email protected]

Github:https://github.com/yueshutong/Spring-Project-Tree

Gitee:https://gitee.com/zyzpp/Spring-Project-Tree

交流QQ群:781927207