forked from red-ant/angular-ra-newrelic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit da65fc5
Showing
12 changed files
with
450 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.DS_Store | ||
node_modules | ||
bower_components | ||
docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"forin": true, | ||
"freeze": true, | ||
"immed": true, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"noempty": false, | ||
"nonew": true, | ||
"quotmark": "single", | ||
"undef": true, | ||
"unused": false, | ||
"strict": true, | ||
"trailing": true, | ||
"eqnull": true, | ||
"expr": true, | ||
"sub": true, | ||
"browser": true, | ||
"predef": [ | ||
"angular", | ||
|
||
"module", | ||
"require", | ||
|
||
"beforeEach", | ||
"describe", | ||
"expect", | ||
"it", | ||
"inject", | ||
"spyOn" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v0.10.26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
module.exports = function(grunt) { | ||
'use strict'; | ||
|
||
grunt.initConfig({ | ||
// Configure tasks | ||
pkg: grunt.file.readJSON('bower.json'), | ||
|
||
banner: '/*!\n' + | ||
' * <%= pkg.name %>.js v<%= pkg.version %>\n' + | ||
' * <%= pkg.homepage %>\n' + | ||
' */\n', | ||
|
||
jshint: { | ||
all: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'] | ||
}, | ||
|
||
concat: { | ||
options: { | ||
banner: '<%= banner %>', | ||
stripBanners: true | ||
}, | ||
|
||
dist: { | ||
src: ['src/**/*.js'], | ||
dest: '<%= pkg.name %>.js' | ||
} | ||
}, | ||
|
||
ngAnnotate: { | ||
dist: { | ||
files: [{ | ||
src: '<%= pkg.name %>.js', | ||
dest: '<%= pkg.name %>.min.js' | ||
}] | ||
} | ||
}, | ||
|
||
uglify: { | ||
options: { | ||
banner: '<%= banner %>' | ||
}, | ||
|
||
dist: { | ||
src: '<%= pkg.name %>.min.js', | ||
dest: '<%= pkg.name %>.min.js' | ||
} | ||
}, | ||
|
||
clean: { | ||
dist: [ | ||
'<%= pkg.name %>.js', | ||
'<%= pkg.name %>.min.js' | ||
] | ||
}, | ||
|
||
watch: { | ||
dist: { | ||
files: ['src/**/*.js'], | ||
tasks: ['build'] | ||
} | ||
}, | ||
|
||
bump: { | ||
options: { | ||
files: ['package.json', 'bower.json'], | ||
commitFiles: ['-a'], | ||
push: true, | ||
createTag: true | ||
} | ||
}, | ||
|
||
karma: { | ||
unit: { | ||
configFile: 'karma.conf.js' | ||
} | ||
}, | ||
|
||
connect: { | ||
server: { | ||
options: { | ||
port: 9001, | ||
hostname: '0.0.0.0', | ||
keepalive: true | ||
} | ||
} | ||
} | ||
}); | ||
|
||
// Load grunt tasks | ||
require('load-grunt-tasks')(grunt); | ||
|
||
// Register custom tasks | ||
grunt.registerTask('test', ['karma']); | ||
grunt.registerTask('build', ['jshint', 'clean:dist', 'concat', 'ngAnnotate', 'uglify']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
angular-ra-newrelic.js | ||
====================== | ||
|
||
`ra.newrelic` module is a wrapper around newrelic-timing. It waits for the 'pageload:ready' event before firing the newRelic 'pageRendered' mark. | ||
|
||
|
||
### Installing | ||
|
||
Install with bower: | ||
|
||
``` | ||
bower install angular-ra-newrelic | ||
``` | ||
|
||
### Usage | ||
|
||
Include `angular-ra-newrelic.js` and `newrelic-timing.js` files in your javascript. | ||
|
||
|
||
Include `ra.newrelic` as a dependency of your application. | ||
|
||
```javascript | ||
angular.module('application', ['ra.newrelic']); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/*! | ||
* angular-ra-newrelic.js v0.0.1 | ||
* | ||
* Copyright 2014 | ||
* MIT License | ||
*/ | ||
(function(angular, NewrelicTiming) { | ||
'use strict'; | ||
|
||
if (typeof angular === 'undefined' || angular === null || typeof angular.module !== 'function') { | ||
return; | ||
} | ||
|
||
if (NewrelicTiming === 'undefined') { | ||
throw new Error('NewrelicTiming is not loaded'); | ||
} | ||
|
||
var module = angular.module('ra.newrelic', []); | ||
|
||
if (typeof module.run !== 'function') { | ||
return; | ||
} | ||
|
||
module.run(function($rootScope, $location, newrelicTiming) { | ||
function changeStart() { | ||
newrelicTiming.mark('navStart'); | ||
} | ||
|
||
function changeSuccess() { | ||
newrelicTiming.mark('domLoaded'); | ||
} | ||
|
||
function pageLoad() { | ||
newrelicTiming.mark('pageRendered'); | ||
newrelicTiming.sendNRBeacon($location.path()); | ||
} | ||
|
||
// ngRoute | ||
$rootScope.$on('$routeChangeStart', changeStart); | ||
$rootScope.$on('$routeChangeSuccess', changeSuccess); | ||
|
||
// ui-router | ||
$rootScope.$on('$stateChangeStart', changeStart); | ||
$rootScope.$on('$stateChangeSuccess', changeSuccess); | ||
|
||
// custom ra.pageload event | ||
$rootScope.$on('pageload:ready', pageLoad); | ||
}). | ||
|
||
factory('newrelicTiming', function() { | ||
return new NewrelicTiming(); | ||
}); | ||
|
||
})(window.angular, window.NewrelicTiming); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/*! | ||
* angular-ra-newrelic.js v0.0.1 | ||
* | ||
* Copyright 2014 | ||
* MIT License | ||
*/ | ||
!function(a,b){"use strict";if("undefined"!=typeof a&&null!==a&&"function"==typeof a.module){if("undefined"===b)throw new Error("NewrelicTiming is not loaded");var c=a.module("ra.newrelic",[]);"function"==typeof c.run&&c.run(["$rootScope","$location","newrelicTiming",function(a,b,c){function d(){c.mark("navStart")}function e(){c.mark("domLoaded")}function f(){c.mark("pageRendered"),c.sendNRBeacon(b.path())}a.$on("$routeChangeStart",d),a.$on("$routeChangeSuccess",e),a.$on("$stateChangeStart",d),a.$on("$stateChangeSuccess",e),a.$on("pageload:ready",f)}]).factory("newrelicTiming",function(){return new b})}}(window.angular,window.NewrelicTiming); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "angular-ra-newrelic", | ||
"version": "0.0.1", | ||
"description": "AngularJS service to integrate with NewRelic's Real User Monitoring", | ||
"author": { | ||
"name": "Jason Taylor", | ||
"email": "[email protected]" | ||
}, | ||
"keywords": [ | ||
"angular", | ||
"pageload" | ||
], | ||
"main": "angular-ra-newrelic.js", | ||
"license": "MIT", | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"src", | ||
"test", | ||
"bower.json", | ||
"Gruntfile.js", | ||
"karma.conf.js", | ||
"package.json" | ||
], | ||
"dependencies": { | ||
"angular": ">=1.2.22", | ||
"newrelic-timing": "~0.4.0", | ||
"angular-ra-pageload": "~0.0.3" | ||
}, | ||
"devDependencies": { | ||
"angular-mocks": ">=1.2.22" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Karma configuration | ||
// http://karma-runner.github.io/0.12/config/configuration-file.html | ||
// Generated on 2014-10-20 using | ||
// generator-karma 0.8.3 | ||
|
||
module.exports = function(config) { | ||
'use strict'; | ||
|
||
config.set({ | ||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: true, | ||
|
||
// base path, that will be used to resolve files and exclude | ||
basePath: '', | ||
|
||
// testing framework to use (jasmine/mocha/qunit/...) | ||
frameworks: ['jasmine'], | ||
|
||
// list of files / patterns to load in the browser | ||
files: [ | ||
'bower_components/angular/angular.js', | ||
'bower_components/angular-mocks/angular-mocks.js', | ||
'bower_components/newrelic-timing/newrelic-timing.js', | ||
'src/**/*.js', | ||
'test/**/*.js' | ||
], | ||
|
||
// list of files / patterns to exclude | ||
exclude: [], | ||
|
||
// web server port | ||
port: 8080, | ||
|
||
// Start these browsers, currently available: | ||
// - Chrome | ||
// - ChromeCanary | ||
// - Firefox | ||
// - Opera | ||
// - Safari (only Mac) | ||
// - PhantomJS | ||
// - IE (only Windows) | ||
browsers: [ | ||
'Chrome' | ||
], | ||
|
||
// Continuous Integration mode | ||
// if true, it capture browsers, run tests and exit | ||
singleRun: false, | ||
|
||
colors: true, | ||
|
||
// level of logging | ||
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
// Uncomment the following lines if you are using grunt's server to run the tests | ||
// proxies: { | ||
// '/': 'http://localhost:9000/' | ||
// }, | ||
// URL root prevent conflicts with the site root | ||
// urlRoot: '_karma_' | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "angular-ra-newrelic", | ||
"version": "0.0.1", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/red-ant/angular-ra-newrelic.git" | ||
}, | ||
"devDependencies": { | ||
"bower": "^1.3.3", | ||
"grunt": "^0.4.5", | ||
"grunt-bump": "0.0.15", | ||
"grunt-contrib-clean": "^0.6.0", | ||
"grunt-contrib-concat": "^0.4.0", | ||
"grunt-contrib-connect": "^0.7.1", | ||
"grunt-contrib-jshint": "^0.10.0", | ||
"grunt-contrib-uglify": "^0.4.0", | ||
"grunt-contrib-watch": "^0.6.1", | ||
"grunt-karma": "^0.9.0", | ||
"grunt-ng-annotate": "^0.3.2", | ||
"karma": "^0.12.14", | ||
"karma-chrome-launcher": "^0.1.2", | ||
"karma-jasmine": "^0.1.5", | ||
"load-grunt-tasks": "^0.6.0" | ||
} | ||
} |
Oops, something went wrong.