我可以在Chrome开发者工具中看到,为网页中的所有资源加载时间,从服务器获取特定资源所花费的时间以及其他信息.
我想使用JavaScript捕获这些统计信息.这怎么可能?
有window.performance对象可用,但仅适用于请求的页面,不适用于页面资源.有没有办法访问所有页面资源的性能对象.
我是nodegit的新手。我想查看最新的10次回购提交,文件更改以及相应提交中引入的更改。
我有最近提交的10个列表,但是我一直在获取提交细节。
这是我正在使用的代码
var nodegit = require('nodegit');
var repoPath = "some_repo_path";
//open branch
nodegit.Repository.open(repoPath).then(function(repo){
//get branch
return repo.getCurrentBranch().then(function(ref) {
console.log("On " + ref.shorthand() + " (" + ref.target() + ")");
//get commit
return repo.getBranchCommit(ref.shorthand());
}).then(function(commit) {
//get commit history
var history = commit.history();
p = new Promise(function(resolve, reject) {
history.on("end", resolve);
history.on("error", reject);
});
history.start();
return p;
}).then(function(commits){
//iterate through last 10 commits
for (var i = 0; i < 10; i++) {
var sha = commits[i].sha().substr(0,7),
msg = commits[i].message().split('\n')[0]; …Run Code Online (Sandbox Code Playgroud)