Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No graph with TypeError: cannot read property 'elapsed' of null #57

Open
awochna opened this issue Feb 22, 2017 · 1 comment
Open

No graph with TypeError: cannot read property 'elapsed' of null #57

awochna opened this issue Feb 22, 2017 · 1 comment

Comments

@awochna
Copy link

awochna commented Feb 22, 2017

I think this has to do with the fact that one of the benchmarks in the comparison has a test that the other does not. The mix bench.cmp command handled this just fine, but the mix bench.graph command results in an HTML page that doesn't display a graph.

The full error from the JS console:

Uncaught TypeError: Cannot read property 'elapsed' of null
    at file:///home/awynter/projects/personal/breaker/bench/graphs/index.html:168:42
    at Function.m.map.m.collect (http://underscorejs.org/underscore-min.js:5:2566)
    at m.(anonymous function) [as map] (http://underscorejs.org/underscore-min.js:5:15545)
    at make_comparison_chart (file:///home/awynter/projects/personal/breaker/bench/graphs/index.html:168:10)
    at add_comparison_chart (file:///home/awynter/projects/personal/breaker/bench/graphs/index.html:157:5)
    at redrawCharts (file:///home/awynter/projects/personal/breaker/bench/graphs/index.html:320:5)
    at HTMLDocument.<anonymous> (file:///home/awynter/projects/personal/breaker/bench/graphs/index.html:329:5)
    at j (http://code.jquery.com/jquery-2.1.1.min.js:2:26860)
    at Object.fireWith [as resolveWith] (http://code.jquery.com/jquery-2.1.1.min.js:2:27673)
    at Function.ready (http://code.jquery.com/jquery-2.1.1.min.js:2:29467)

The snapshots are put into a gist: https://gist.github.com/awochna/9e010affe57ad9df6ffbdaf144f6c9fa

@florius0
Copy link

I've encountered the same problem.

    var snapshotCount;
    for (var key in categories) {
        snapshotCount = categories[key].length;
        break;
    }
...
    for (var i = 0; i < snapshotCount; i++) {
        // Go through the ith snapshot of each category
        var sample = _.map(categories, function(snapshots, key) {
            var val = snapshots[i];
            return {cat: key, val: val.elapsed / val.n};
        });

I've noticed that snapshotCount between categories varies. And the way it calculates it now, it may not be correct for every category.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants