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

Custom Metrics do not appear in UI #31

Closed
raDiesle opened this issue Jan 20, 2014 · 14 comments
Closed

Custom Metrics do not appear in UI #31

raDiesle opened this issue Jan 20, 2014 · 14 comments
Assignees
Labels
Milestone

Comments

@raDiesle
Copy link

Hi, for me,

the helper functions inside of the page-app
doesn't work like described here:
https://github.com/macbre/phantomas/wiki/Phantomas-scope

E.g. I just put this in my code and --log and there is no logging: window.__phantomas && window.__phantomas.log("AAAAAAAAAAAAAAA");

@stefanjudis
Copy link
Owner

Hmm, interesting.
Never tried these helper functions. Will check probably on the weekend.

But just in case, could you post your grunt configuration?

Thx. 😄

@ghost ghost assigned stefanjudis Jan 20, 2014
@raDiesle
Copy link
Author

:D . The helper functions are the main reason we want to use Phantomas.

The main monitoring checks are not reflecting performance issues, we are usually faced to.
With these simple utilities, you can easily define your own,
like waiting for an element to be rendered.

If there is time, how about I join some contribution :D

How about some information, like grunt-phantomas is using d3, where phantomas has no ui,
and some code information, upcoming ideas...

@stefanjudis
Copy link
Owner

Okay so let's make a follow up ticket, to set up some basic information?

And well contributions are more than welcome! ;)

@macbre
Copy link

macbre commented Jan 20, 2014

@raDiesle: phantomas "browser scope" is named __phantomas:

window.__phantomas && window.__phantomas.log("An event foo took place!");

@stefanjudis
Copy link
Owner

@raDiesle maybe that's the reason for failure?

@raDiesle
Copy link
Author

Hi,
I have pasted it wrong, so it is still an issue:
window.__phantomas && window.__phantomas.log("AAAAAAAAA");

The same with marker and offender.

@raDiesle
Copy link
Author

I cleared all previous results, and the marker works!!!

To make clear:

if (typeof window.__phantomas !== 'undefined') {
(function(phantomas) {
phantomas.setMarkerMetric('MyMarkerMetric');
})(window.__phantomas);
}
--> Works

Do not work:::::::

(function(phantomas) {

          phantomas.addOffender('MyCustomOffender", 'My custom offender failed.');

  })(window.__phantomas);

window.__phantomas && window.__phantomas.log("My Logggg");

--->> Is there a visual concept of failing Offender, already ?

@stefanjudis
Copy link
Owner

Nope. :)
I'm open to any wishes and suggestions.

But I'm not able to work on it during the week. Sorry for that.
Can only check it on the weekend.

@raDiesle raDiesle changed the title Helper functions don't work Custom Metrics do not appear in UI Jul 29, 2014
@raDiesle
Copy link
Author

With the current version 0.9.0 eighter the custom metric defined in the html
nor the one additional defined in the metrics of phantomas folder are not shown in the UI.

They are visible in the resultindex.html sourcecode.

@stefanjudis
Copy link
Owner

Hmm... did you define it inside of options.group?

I may have to investigate where phantomas is returning these values.

Could you maybe provide an example html snippet, that I can run grunt-phantomas against, to check if it's working then?

@stefanjudis stefanjudis added this to the v0.10.0 milestone Jul 29, 2014
@raDiesle
Copy link
Author

I used the default options, before, and it was working :

(function (phantomas) {
phantomas.setMetric('mymetric', 100);
})(window.__phantomas);

So I just tried with

gruntSite: {
options: {
indexPath: './somepath',
options : {
group : {
'CustomSection' : [
"mymetric"
]
}
},
url: 'http://localhost:9005'
}
}

for the metric within phantomas, I copied the alert metric and changed filename as well
as the name of the metric, set in the file.

@stefanjudis
Copy link
Owner

Can not check now, but maybe you want to give me the JSON that phantomas generates when running against your site? :)

Then we could make a quick check.

@stefanjudis
Copy link
Owner

@raDiesle is this still an issue?
If so could you provide the JSON in your case?

@stefanjudis
Copy link
Owner

@raDiesle Okay, I'm just debugging this one with current master ( future v0.10.0).

And it seems to work fine.
I set up a gh-pages site and run grunt-phantomas against it.

    phantomas : {
      /* https://github.com/stefanjudis/grunt-phantomas */
      grunt : {
        options : {
          assertions : {
            'assetsWithQueryString' : 3,
            'biggestLatency'        : 1400,
            'bodyHTMLSize'          : 10500,
            'commentsSize'          : 55,
            'consoleMessages'       : 0,
            'hiddenContentSize'     : 65,
            'jsErrors'              : 0,
            'gzipRequests'          : 8,
            'medianResponse'        : 400,
            'nodesWithInlineCSS'    : 0,
            'requests'              : 30,
            'timeToFirstImage'      : 1100,
            'DOMelementsCount'      : 200,
            'DOMqueries'            : 10,
            'DOMinserts'            : 1
          },
          // additionalStylesheet : '/Users/stefan/Desktop/custom2.css',
          // buildUi              : false,
          groupt               : {
            'CUSTOM' : [ 'loooooooopTime' ]
          },
          output               : [ 'json' ],
          indexPath            : './phantomas/',
          options              : {
            'timeout'        : 30
          },
          url                  : 'http://stefanjudis.github.io/phantomas-custom-metrics-tryout/'
        }
      }
    },

screenshot 2014-09-05 00 02 00

I'll close this issue for now. Feel free to reopen. :)

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

No branches or pull requests

3 participants