Skip to content

Commit

Permalink
move metrics into dedicated metrics/ folder
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Jun 25, 2018
1 parent 38831b7 commit 9def0a6
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
'use strict';

const Audit = require('./audit');
const Audit = require('../audit');

class EstimatedInputLatency extends Audit {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/
'use strict';

const Audit = require('./audit');
const Util = require('../report/html/renderer/util.js');
const Audit = require('../audit');
const Util = require('../../report/html/renderer/util.js');

class FirstContentfulPaint extends Audit {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/
'use strict';

const Audit = require('./audit');
const Util = require('../report/html/renderer/util.js');
const Audit = require('../audit');
const Util = require('../../report/html/renderer/util.js');

class FirstCPUIdle extends Audit {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/
'use strict';

const Audit = require('./audit');
const Util = require('../report/html/renderer/util');
const Audit = require('../audit');
const Util = require('../../report/html/renderer/util');

class FirstMeaningfulPaint extends Audit {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/
'use strict';

const Audit = require('./audit');
const Util = require('../report/html/renderer/util');
const Audit = require('../audit');
const Util = require('../../report/html/renderer/util');

/**
* @fileoverview This audit identifies the time the page is "consistently interactive".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/
'use strict';

const Audit = require('./audit');
const Util = require('../report/html/renderer/util');
const Audit = require('../audit');
const Util = require('../../report/html/renderer/util');

class SpeedIndex extends Audit {
/**
Expand Down
12 changes: 6 additions & 6 deletions lighthouse-core/config/default-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ module.exports = {
'works-offline',
'viewport',
'without-javascript',
'first-contentful-paint',
'first-meaningful-paint',
'metrics/first-contentful-paint',
'metrics/first-meaningful-paint',
'load-fast-enough-for-pwa',
'speed-index',
'metrics/speed-index',
'screenshot-thumbnails',
'estimated-input-latency',
'metrics/estimated-input-latency',
'errors-in-console',
'time-to-first-byte',
'first-cpu-idle',
'interactive',
'metrics/first-cpu-idle',
'metrics/interactive',
'user-timings',
'critical-request-chains',
'redirects',
Expand Down
1 change: 1 addition & 0 deletions lighthouse-core/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ class Runner {
const fileList = [
...fs.readdirSync(path.join(__dirname, './audits')),
...fs.readdirSync(path.join(__dirname, './audits/dobetterweb')).map(f => `dobetterweb/${f}`),
...fs.readdirSync(path.join(__dirname, './audits/metrics')).map(f => `metrics/${f}`),
...fs.readdirSync(path.join(__dirname, './audits/seo')).map(f => `seo/${f}`),
...fs.readdirSync(path.join(__dirname, './audits/seo/manual')).map(f => `seo/manual/${f}`),
...fs.readdirSync(path.join(__dirname, './audits/accessibility'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
*/
'use strict';

const Audit = require('../../audits/estimated-input-latency');
const Runner = require('../../runner');
const Util = require('../../report/html/renderer/util');
const Audit = require('../../../audits/metrics/estimated-input-latency.js');
const Runner = require('../../../runner');
const Util = require('../../../report/html/renderer/util');
const assert = require('assert');
const options = Audit.defaultOptions;

const pwaTrace = require('../fixtures/traces/progressive-app-m60.json');
const pwaTrace = require('../../fixtures/traces/progressive-app-m60.json');

const computedArtifacts = Runner.instantiateComputedArtifacts();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';

const Audit = require('../../audits/first-contentful-paint.js');
const Runner = require('../../runner.js');
const Audit = require('../../../audits/metrics/first-contentful-paint');
const Runner = require('../../../runner.js');
const assert = require('assert');
const options = Audit.defaultOptions;

const pwaTrace = require('../fixtures/traces/progressive-app-m60.json');
const pwaDevtoolsLog = require('../fixtures/traces/progressive-app-m60.devtools.log.json');
const pwaTrace = require('../../fixtures/traces/progressive-app-m60.json');
const pwaDevtoolsLog = require('../../fixtures/traces/progressive-app-m60.devtools.log.json');

/* eslint-env mocha */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
*/
'use strict';

const FMPAudit = require('../../audits/first-meaningful-paint.js');
const Audit = require('../../audits/audit.js');
const Util = require('../../report/html/renderer/util');
const FMPAudit = require('../../../audits/metrics/first-meaningful-paint.js');
const Audit = require('../../../audits/audit.js');
const Util = require('../../../report/html/renderer/util');
const assert = require('assert');
const options = FMPAudit.defaultOptions;
const trace = require('../fixtures/traces/progressive-app-m60.json');
const devtoolsLogs = require('../fixtures/traces/progressive-app-m60.devtools.log.json');
const trace = require('../../fixtures/traces/progressive-app-m60.json');
const devtoolsLogs = require('../../fixtures/traces/progressive-app-m60.devtools.log.json');

const Runner = require('../../runner.js');
const Runner = require('../../../runner.js');
const computedArtifacts = Runner.instantiateComputedArtifacts();

/* eslint-env mocha */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
*/
'use strict';

const Interactive = require('../../audits/interactive.js');
const Runner = require('../../runner.js');
const Util = require('../../report/html/renderer/util');
const Interactive = require('../../../audits/metrics/interactive.js');
const Runner = require('../../../runner.js');
const Util = require('../../../report/html/renderer/util');
const assert = require('assert');
const options = Interactive.defaultOptions;

const acceptableTrace = require('../fixtures/traces/progressive-app-m60.json');
const acceptableDevToolsLog = require('../fixtures/traces/progressive-app-m60.devtools.log.json');
const acceptableTrace = require('../../fixtures/traces/progressive-app-m60.json');
const acceptableDevToolsLog =
require('../../fixtures/traces/progressive-app-m60.devtools.log.json');

const redirectTrace = require('../fixtures/traces/site-with-redirect.json');
const redirectDevToolsLog = require('../fixtures/traces/site-with-redirect.devtools.log.json');
const redirectTrace = require('../../fixtures/traces/site-with-redirect.json');
const redirectDevToolsLog = require('../../fixtures/traces/site-with-redirect.devtools.log.json');


/* eslint-env mocha */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

/* eslint-env mocha */

const Audit = require('../../audits/speed-index.js');
const Audit = require('../../../audits/metrics/speed-index.js');
const assert = require('assert');
const Runner = require('../../runner.js');
const Runner = require('../../../runner.js');
const options = Audit.defaultOptions;

const pwaTrace = require('../fixtures/traces/progressive-app-m60.json');
const pwaDevtoolsLog = require('../fixtures/traces/progressive-app-m60.devtools.log.json');
const pwaTrace = require('../../fixtures/traces/progressive-app-m60.json');
const pwaDevtoolsLog = require('../../fixtures/traces/progressive-app-m60.devtools.log.json');

describe('Performance: speed-index audit', () => {
it('works on a real trace', () => {
Expand Down
14 changes: 7 additions & 7 deletions lighthouse-core/test/config/config-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ describe('Config', () => {
description: 'The best group around.',
},
},
audits: ['first-meaningful-paint'],
audits: ['metrics/first-meaningful-paint'],
categories: {
pwa: {
auditRefs: [
Expand Down Expand Up @@ -360,9 +360,9 @@ describe('Config', () => {
],
audits: [
'accessibility/color-contrast',
'first-meaningful-paint',
'first-cpu-idle',
'estimated-input-latency',
'metrics/first-meaningful-paint',
'metrics/first-cpu-idle',
'metrics/estimated-input-latency',
],
categories: {
'needed-category': {
Expand Down Expand Up @@ -404,9 +404,9 @@ describe('Config', () => {
],
audits: [
'accessibility/color-contrast',
'first-meaningful-paint',
'first-cpu-idle',
'estimated-input-latency',
'metrics/first-meaningful-paint',
'metrics/first-cpu-idle',
'metrics/estimated-input-latency',
],
categories: {
'needed-category': {
Expand Down

0 comments on commit 9def0a6

Please sign in to comment.