How to use the percentile.duration function in percentile

To help you get started, we’ve selected a few percentile examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github newrelic / nr1-browser-analyzer / component / stat-utils.js View on Github external
function fillObject(obj, sample, cohort, bounceCohort) {
  if (cohort) {
    obj.raw.cohort = Object.assign({}, cohort);
    obj.sessions = numeral(cohort.sessions).format("0,0");
    obj.pageviews = cohort.pageviews;
    obj.medianDuration = parseFloat(cohort.medianDuration["50"]).toFixed(2);
    obj.avgPageViews = parseFloat(cohort.avgPageViews).toFixed(2);
    obj.duration75 = parseFloat(cohort["percentile.duration"]["75"]).toFixed(2);
    obj.duration95 = parseFloat(cohort["percentile.duration"]["95"]).toFixed(2);
    obj.duration99 = parseFloat(cohort["percentile.duration"]["99"]).toFixed(2);
  }
  if (sample) {
    obj.raw.sample = Object.assign({}, sample);
    obj.totalSessionLength = calcTotalSessionLength(sample.results),
    obj.totalSamples = sample.results.length,
    obj.bounces = calcBounces(sample.results);
  }
  if (bounceCohort) {
    obj.raw.bounceCohort = Object.assign({}, bounceCohort);
    obj.bounces = bounceCohort.steps[0] - bounceCohort.steps[1];
    obj.totalSamples = bounceCohort.steps[0];
  }
  return obj;
}
github newrelic / nr1-browser-analyzer / component / stat-utils.js View on Github external
function fillObject(obj, sample, cohort, bounceCohort) {
  if (cohort) {
    obj.raw.cohort = Object.assign({}, cohort);
    obj.sessions = numeral(cohort.sessions).format("0,0");
    obj.pageviews = cohort.pageviews;
    obj.medianDuration = parseFloat(cohort.medianDuration["50"]).toFixed(2);
    obj.avgPageViews = parseFloat(cohort.avgPageViews).toFixed(2);
    obj.duration75 = parseFloat(cohort["percentile.duration"]["75"]).toFixed(2);
    obj.duration95 = parseFloat(cohort["percentile.duration"]["95"]).toFixed(2);
    obj.duration99 = parseFloat(cohort["percentile.duration"]["99"]).toFixed(2);
  }
  if (sample) {
    obj.raw.sample = Object.assign({}, sample);
    obj.totalSessionLength = calcTotalSessionLength(sample.results),
    obj.totalSamples = sample.results.length,
    obj.bounces = calcBounces(sample.results);
  }
  if (bounceCohort) {
    obj.raw.bounceCohort = Object.assign({}, bounceCohort);
    obj.bounces = bounceCohort.steps[0] - bounceCohort.steps[1];
    obj.totalSamples = bounceCohort.steps[0];
  }
  return obj;
}
github newrelic / nr1-browser-analyzer / component / stat-utils.js View on Github external
function fillObject(obj, sample, cohort, bounceCohort) {
  if (cohort) {
    obj.raw.cohort = Object.assign({}, cohort);
    obj.sessions = numeral(cohort.sessions).format("0,0");
    obj.pageviews = cohort.pageviews;
    obj.medianDuration = parseFloat(cohort.medianDuration["50"]).toFixed(2);
    obj.avgPageViews = parseFloat(cohort.avgPageViews).toFixed(2);
    obj.duration75 = parseFloat(cohort["percentile.duration"]["75"]).toFixed(2);
    obj.duration95 = parseFloat(cohort["percentile.duration"]["95"]).toFixed(2);
    obj.duration99 = parseFloat(cohort["percentile.duration"]["99"]).toFixed(2);
  }
  if (sample) {
    obj.raw.sample = Object.assign({}, sample);
    obj.totalSessionLength = calcTotalSessionLength(sample.results),
    obj.totalSamples = sample.results.length,
    obj.bounces = calcBounces(sample.results);
  }
  if (bounceCohort) {
    obj.raw.bounceCohort = Object.assign({}, bounceCohort);
    obj.bounces = bounceCohort.steps[0] - bounceCohort.steps[1];
    obj.totalSamples = bounceCohort.steps[0];
  }
  return obj;
}

percentile

Calculate a percentile for given array of values

MIT
Latest version published 2 years ago

Package Health Score

52 / 100
Full package analysis

Popular percentile functions