<commit_before>/**
 * Created by rcartier13 on 2/5/14.
 */

var logger = (require('../../logging/vip-winston')).Logger;
var config = require('../../config');
var feedIdMapper = require('../../feedIdMapper');
var mongoose = require('mongoose');
var schemas = require('../../dao/schemas');
var async = require('async');
var when = require('when');
var moment = require('moment');

var contests = require('./contests');
var results = require('./results');
var contest = require('./contest');
var locality = require('./locality');
var pollinglocations = require('./pollinglocations');

var overviewModels = [];
var functionArr = [];

function runOverviewProcessor(feedId) {

  functionArr.push(pollinglocations.kickoffPollingLoc);
  functionArr.push(contests.kickoffContest);
  functionArr.push(results.kickoffResults);
  functionArr.push(contest.kickoffContest);
  functionArr.push(locality.kickoffLocality);

  calculateFields(feedId, function() {
    when.all(overviewModels).then(onSaveComplete, errorHandler);
  });
}

function errorHandler(err) {
  console.error(err);
}

function onSaveComplete(results) {<commit_msg>adding in profile duration for the overview processor also<commit_after>/**
 * Created by rcartier13 on 2/5/14.
 */

var logger = (require('../../logging/vip-winston')).Logger;
var _fileName = "overview-processor";


var config = require('../../config');
var feedIdMapper = require('../../feedIdMapper');
var mongoose = require('mongoose');
var schemas = require('../../dao/schemas');
var async = require('async');
var when = require('when');
var moment = require('moment');

var contests = require('./contests');
var results = require('./results');
var contest = require('./contest');
var locality = require('./locality');
var pollinglocations = require('./pollinglocations');

var overviewModels = [];
var functionArr = [];

function runOverviewProcessor(feedId) {
  // overview-processor as a whole (start)
  logger.profile(_fileName);

  functionArr.push(pollinglocations.kickoffPollingLoc);
  functionArr.push(contests.kickoffContest);
  functionArr.push(results.kickoffResults);
  functionArr.push(contest.kickoffContest);
  functionArr.push(locality.kickoffLocality);

  calculateFields(feedId, function() {
    when.all(overviewModels).then(onSaveComplete, errorHandler);
  });
}

function errorHandler(err) {
  console.error(err);
}

function onSaveComplete(results) {
  // overview-processor as a whole (end)
  logger.profile(_fileName);

{'fraction_non_alphanumeric': 0.16653160453808752, 'fraction_numerical': 0.004862236628849271, 'mean_word_length': 5.18796992481203, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1681660', 'n_tokens_mistral': 749, 'n_tokens_neox': 717, 'n_words': 153}