<commit_before>/* jshint -W097 */// jshint strict:false
/*jslint node: true */
"use strict";

//noinspection JSUnresolvedFunction

//usage: nodejs analyzeinflux.js <InfluxDB-Instance>  [<Loglevel>]
//usage: nodejs analyzeinflux.js influxdb.0 info
var utils  = require(__dirname + '/../lib/utils'); // Get common adapter utils

var fs        = require('fs');
var path      = require('path');

var deepAnalyze = false;
var influxInstance = "influxdb.0";
if (process.argv.indexOf('--deepAnalyze') !== -1) deepAnalyze = true;
if (process.argv[2] && (process.argv[2].indexOf('influxdb') === 0)) {
    influxInstance = process.argv[2];
}
process.argv[2] = "--install";
console.log('Query Data from ' + influxInstance);
if (deepAnalyze) console.log('Do deep analysis to find holes in data');

var earliestDBValue = {};
var earliesValCachefile = __dirname + '/earliestDBValues.json';
var existingData = {};
var existingDataCachefile = __dirname + '/existingDBValues.json';
var existingTypes = {};
var existingTypesCachefile = __dirname + '/existingDBTypes.json';

var adapter = utils.adapter('history');

var breakIt = false;

var stdin = process.stdin;
// without this, we would only get streams once enter is pressed
stdin.setRawMode( true );
// resume stdin in the parent process (node app won't quit all by itself
// unless an error or process.exit() happens)
stdin.resume();
// i don't want binary, do you?<commit_msg>fix util.js usage and use utils.Adapter<commit_after>/* jshint -W097 */// jshint strict:false
/*jslint node: true */
"use strict";

//noinspection JSUnresolvedFunction

//usage: nodejs analyzeinflux.js <InfluxDB-Instance>  [<Loglevel>]
//usage: nodejs analyzeinflux.js influxdb.0 info
var utils  = require(__dirname + '/../lib/utils'); // Get common adapter utils

var fs        = require('fs');
var path      = require('path');

var deepAnalyze = false;
var influxInstance = "influxdb.0";
if (process.argv.indexOf('--deepAnalyze') !== -1) deepAnalyze = true;
if (process.argv[2] && (process.argv[2].indexOf('influxdb') === 0)) {
    influxInstance = process.argv[2];
}
process.argv[2] = "--install";
console.log('Query Data from ' + influxInstance);
if (deepAnalyze) console.log('Do deep analysis to find holes in data');

var earliestDBValue = {};
var earliesValCachefile = __dirname + '/earliestDBValues.json';
var existingData = {};
var existingDataCachefile = __dirname + '/existingDBValues.json';
var existingTypes = {};
var existingTypesCachefile = __dirname + '/existingDBTypes.json';

var adapter = utils.Adapter('history');

var breakIt = false;

var stdin = process.stdin;
// without this, we would only get streams once enter is pressed
stdin.setRawMode( true );
// resume stdin in the parent process (node app won't quit all by itself
// unless an error or process.exit() happens)
stdin.resume();
// i don't want binary, do you?
{'fraction_non_alphanumeric': 0.14635854341736695, 'fraction_numerical': 0.007703081232492998, 'mean_word_length': 4.473180076628353, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4522494', 'n_tokens_mistral': 896, 'n_tokens_neox': 882, 'n_words': 274}