stefanjudis / grunt-phantomas

Grunt plugin wrapping phantomas to measure frontend performance
MIT License
285 stars 25 forks source link

Config option for grouping metrics #30

Closed stefanjudis closed 10 years ago

stefanjudis commented 10 years ago

Set up a new config option for grouping metrics. I'm thinking of something like.

group : {
  foo : ['gzipRequest', ... ] // first group with 'foo' headline
  bar : ['timeA', 'timeB' ] // second group with 'bar' headline
}

So that the user can completely decide by him/herself. And then notifying the use in build process if phantomas generated metric that wasn't in group option.

Any opinion on that @shama & @Greg-Boggs?

shama commented 10 years ago

:thumbsup: Great idea!

Greg-Boggs commented 10 years ago

That would be killer.

stefanjudis commented 10 years ago

Will be included in version 0.5.0.

Default will be:

group        : {
  'REQUESTS' : [
    'requests',
    'gzipRequests',
    'postRequests',
    'httpsRequests',
    'notFound',
    'multipleRequests',
    'maxRequestsPerDomain',
    'domains',
    'medianRequestsPerDomain',
    'redirects',
    'redirectsTime',
    'smallestResponse',
    'biggestResponse',
    'smallestLatency',
    'biggestLatency',
    'medianResponse',
    'medianLatency',
    'assetsNotGzipped',
    'assetsWithQueryString',
    'smallImages'
  ],
  'TIMINGS' : [
    'timeToFirstByte',
    'timeToLastByte',
    'timeToFirstCss',
    'timeToFirstJs',
    'timeToFirstImage',
    'fastestResponse',
    'slowestResponse',
    'onDOMReadyTime',
    'onDOMReadyTimeEnd',
    'windowOnLoadTime',
    'windowOnLoadTimeEnd',
    'httpTrafficCompleted',
    'timeBackend',
    'timeFrontend'
  ],
  'HTML' : [
    'bodyHTMLSize',
    'iframesCount',
    'imagesWithoutDimensions',
    'commentsSize',
    'hiddenContentSize',
    'whiteSpacesSize',
    'DOMelementsCount',
    'DOMelementMaxDepth',
    'nodesWithInlineCSS',
    'foo'
  ],
  'JAVASCRIPT' : [
    'eventsBound',
    'documentWriteCalls',
    'evalCalls',
    'jsErrors',
    'consoleMessages',
    'windowAlerts',
    'windowConfirms',
    'windowPrompts',
    'globalVariables',
    'localStorageEntries',
    'ajaxRequests'
  ],
  'DOM' : [
    'DOMqueries',
    'DOMqueriesById',
    'DOMqueriesByClassName',
    'DOMqueriesByTagName',
    'DOMqueriesByQuerySelectorAll',
    'DOMinserts',
    'DOMqueriesDuplicated'
  ],
  'HEADERS' : [
    'headersCount',
    'headersSentCount',
    'headersRecvCount',
    'headersSize',
    'headersSentSize',
    'headersRecvSize'
  ],
  'CASHING' : [
    'cacheHits',
    'cacheMisses',
    'cachePasses',
    'cachingNotSpecified',
    'cachingTooShort',
    'cachingDisabled'
  ],
  'COOKIES' : [
    'cookiesSent',
    'cookiesRecv',
    'domainsWithCookies',
    'documentCookiesLength',
    'documentCookiesCount'
  ],
  'COUNTS & SIZES' : [
    'contentLength',
    'bodySize',
    'htmlSize',
    'htmlCount',
    'cssSize',
    'cssCount',
    'jsSize',
    'jsCount',
    'jsonSize',
    'jsonCount',
    'imageSize',
    'imageCount',
    'webfontSize',
    'webfontCount',
    'base64Size',
    'base64Count',
    'otherCount',
    'otherSize'
  ],
  'JQUERY' : [
    'jQueryOnDOMReadyFunctions',
    'jQuerySizzleCalls'
  ]
}