<commit_before>const axios = require('axios');
const program = require('commander');
const prompt = require('prompt');

const { client, fetcher, buildsUtils } = require('travis-builds-reporter-core');

function setupCommander() {
  program
    .version('1.0.0')
    .option('-r, --repo-name <repositoryName>', 'Specify repository name')
    .parse(process.argv);
}

// define prompt input schema
const properties = [
  {
    name: 'repositoryName',
  },
];

// define prompt error function
function onErr(err) {
  console.log(err);
  return 1;
}

function outputBuildsReport(builds) {
  console.log(`Total builds count: ${buildsUtils.getBuildsCount(builds)}`);
  console.log(`Successful builds count: ${buildsUtils.getSuccessfulBuildsCount(builds)}`);
  console.log(`Canceled builds count: ${buildsUtils.getCanceledBuildsCount(builds)}`);
  console.log(`Failed builds count: ${buildsUtils.getFailedBuildsCount(builds)}`);
  console.log(`Errored builds count: ${buildsUtils.getErroredBuildsCount(builds)}`);
  console.log(`Successful builds rate: ${(buildsUtils.getSuccessfulBuildsRate(builds) * 100).toFixed(2)}%`);
}<commit_msg>Updated cli to match new getAverageBuildsDuration signature<commit_after>const axios = require('axios');
const program = require('commander');
const prompt = require('prompt');

const { client, fetcher, buildsUtils } = require('travis-builds-reporter-core');

function setupCommander() {
  program
    .version('1.0.0')
    .option('-r, --repo-name <repositoryName>', 'Specify repository name')
    .parse(process.argv);
}

// define prompt input schema
const properties = [
  {
    name: 'repositoryName',
  },
];

// define prompt error function
function onErr(err) {
  console.log(err);
  return 1;
}

function outputBuildsReport(builds) {
  console.log(`Total builds count: ${buildsUtils.getBuildsCount(builds)}`);
  console.log(`Successful builds count: ${buildsUtils.getSuccessfulBuildsCount(builds)}`);
  console.log(`Canceled builds count: ${buildsUtils.getCanceledBuildsCount(builds)}`);
  console.log(`Failed builds count: ${buildsUtils.getFailedBuildsCount(builds)}`);
  console.log(`Errored builds count: ${buildsUtils.getErroredBuildsCount(builds)}`);
  console.log(`Successful builds rate: ${(buildsUtils.getSuccessfulBuildsRate(builds) * 100).toFixed(2)}%`);
  console.log(`Average builds duration: ${buildsUtils.getAverageBuildsDuration(builds, 4)} s`);
  console.log(`Minimum builds duration: ${buildsUtils.getMinimumBuildsDuration(builds)} s`);
  console.log(`Maximum builds duration: ${buildsUtils.getMaximumBuildsDuration(builds)} s`);
}
{'fraction_non_alphanumeric': 0.1531322505800464, 'fraction_numerical': 0.006573859242072699, 'mean_word_length': 6.206128133704736, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6027399', 'n_tokens_mistral': 822, 'n_tokens_neox': 821, 'n_words': 160}