Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit eb94a60

Browse files
committed
Enable metrics endpoint, check for performance.timing on client
1 parent 6e4ec05 commit eb94a60

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

client/app/utils/metrics.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*jshint unused:false*/
12
import Ember from 'ember';
23
import config from '../config/environment';
34

@@ -34,7 +35,7 @@ export function pageView() {
3435
}
3536

3637
function measureEntry(name) {
37-
if (!window.performance || !window.performance.getEntriesByName ) { return; }
38+
if (!window.performance || !window.performance.timing || !window.performance.getEntriesByName ) { return; }
3839
var markName = name + '_now';
3940
mark(markName);
4041
measure(name, 'navigationStart', markName);

client/config/environment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ module.exports = function(environment) {
6363
ENV.APP.API_PATH = "api";
6464
ENV.APP.SOCKET_URL = "ws://pixelhandler.com";
6565
ENV.APP.GOOGLE_ANALYTICS = "UA-2687872-1";
66-
ENV.APP.REPORT_METRICS = false;
66+
ENV.APP.REPORT_METRICS = true;
6767
}
6868

6969
return ENV;

server/app.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var debug = require('debug')('app');
1313
Application
1414
**/
1515
var app = express();
16-
16+
app.enable('trust proxy');
1717

1818
/**
1919
Middlewares
@@ -40,6 +40,7 @@ var corsOptions = {
4040
};
4141
app.use(cors(corsOptions));
4242

43+
4344
/**
4445
Setup database
4546
**/
@@ -75,7 +76,7 @@ require('./routes/ping')(app, cors(corsOptions));
7576
require('./routes/authors')(app, restrict);
7677
require('./routes/posts')(app, restrict);
7778
require('./routes/sessions')(app, restrict);
78-
79+
require('./routes/metrics')(app, restrict);
7980

8081
/**
8182
Middlewares

0 commit comments

Comments
 (0)