bttostatsv
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -13,7 +13,7 @@ 'use strict'; | ||
/** | ||
* Get the metrics we want from Browsertime. | ||
* @param {Object} browsertimeJSON The raw Browsertime JSON. | ||
* @param {String} namespace The graphite namespace pre-pend to all keys. | ||
* @return {Array} An array of Strings with the complete metric and value in statsv format. | ||
*/ | ||
* Get the metrics we want from Browsertime. | ||
* @param {Object} browsertimeJSON The raw Browsertime JSON. | ||
* @param {String} namespace The graphite namespace pre-pend to all keys. | ||
* @return {Array} An array of Strings with the complete metric and value in statsv format. | ||
*/ | ||
get: function( browsertimeJSON, namespace ) { | ||
@@ -29,3 +29,7 @@ const myMetrics = []; | ||
'visualMetrics.LastVisualChange', | ||
'visualMetrics.PerceptualSpeedIndex' | ||
'visualMetrics.PerceptualSpeedIndex', | ||
'cpu.category.rendering', | ||
'cpu.category.scripting', | ||
'cpu.category.loading', | ||
'cpu.category.painting' | ||
]; | ||
@@ -35,3 +39,7 @@ for ( const metric of metricsToCollect ) { | ||
const value = get( browsertimeJSON, `statistics.${metric}.${type}` ); | ||
myMetrics.push( `${namespace}.${metric}.${type}=${value.toFixed( 0 )}ms` ); | ||
if ( value ) { | ||
myMetrics.push( | ||
`${namespace}.${metric}.${type}=${value.toFixed( 0 )}ms` | ||
); | ||
} | ||
} | ||
@@ -38,0 +46,0 @@ } |
{ | ||
"name": "bttostatsv", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"bin": "./bin/index.js", | ||
"description": "Send Browsertime metrics to statsv", | ||
"keywords": ["browsertime", "performance", "statsv"], | ||
"keywords": [ | ||
"browsertime", | ||
"performance", | ||
"statsv" | ||
], | ||
"homepage": "https://github.com/soulgalore/bttostatsv", | ||
@@ -13,3 +17,6 @@ "license": "Apache-2.0", | ||
}, | ||
"files": ["bin", "lib"], | ||
"files": [ | ||
"bin", | ||
"lib" | ||
], | ||
"scripts": { | ||
@@ -16,0 +23,0 @@ "test": "eslint . && ava" |
20439
111