Giter VIP home page Giter VIP logo

Comments (3)

tongjingran avatar tongjingran commented on June 24, 2024 3

直接通过 goc profile 获取到的coverprofile数据如下形式:
github.com/qiniu/goc/goc.go:21.13,23.2 1 1
这里的内容就是通过类似上面的变量CoverageVariableName得到。其基本语义为
"文件:起始行.起始列,结束行.结束列 该基本块中的语句数量 该基本块被执行到的次数"
基于此,可计算覆盖行数和总行数。
目前goc仅提供最原始的coverprofile。

from goc.

tang-xiao-zhuang avatar tang-xiao-zhuang commented on June 24, 2024

这样算是可以算出来,但是项目比较大,这样生成的文件去解析的话很不方便,效率很低,以后会推出直接获取总行数,覆盖行数吗?

from goc.

CarlJi avatar CarlJi commented on June 24, 2024

这样是否方便呢? 一条命令就可以拿到总的statment数量
goc profile | awk '{result+=$2} END {print result}'

这样算是可以算出来,但是项目比较大,这样生成的文件去解析的话很不方便,效率很低,以后会推出直接获取总行数,覆盖行数吗?

这句是希望goc server 提供一个API吗?单纯的行数,感觉需求有点小,你这边有更多的分析场景需求嘛?

from goc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.