Commit a8cf4735 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent 258f1b97
...@@ -8,6 +8,7 @@ async function run() { ...@@ -8,6 +8,7 @@ async function run() {
let configs = await fs.readdirSync('uniq/') let configs = await fs.readdirSync('uniq/')
let arr = [] let arr = []
let arrDate = [] let arrDate = []
let levels=[]
for (let i = 0; i < configs.length; i++) { for (let i = 0; i < configs.length; i++) {
if (!configs[i].includes('.json')) if (!configs[i].includes('.json'))
...@@ -15,6 +16,7 @@ async function run() { ...@@ -15,6 +16,7 @@ async function run() {
let config = await fs.readFileSync('./uniq/' + configs[i], 'utf8') let config = await fs.readFileSync('./uniq/' + configs[i], 'utf8')
config = JSON.parse(config) config = JSON.parse(config)
levels.push(config.maxLevel)
for (let j = 0; j < config.length-1; j++) { for (let j = 0; j < config.length-1; j++) {
let dateString = config[j].dateString.split('_') let dateString = config[j].dateString.split('_')
...@@ -30,11 +32,23 @@ async function run() { ...@@ -30,11 +32,23 @@ async function run() {
arr = _.uniqBy(arr, 'platform'); arr = _.uniqBy(arr, 'platform');
arrDate = _.uniq(arrDate); arrDate = _.uniq(arrDate);
let uniqLevels = _.uniq(levels);
arrDate = _.orderBy(arrDate) arrDate = _.orderBy(arrDate)
let levelSort=[]
for (let i=0;i<uniqLevels.length;i++)
{
let counter=0
for (let j=0;j<levels.length;j++)
if (uniqLevels[i] === levels[j])
counter++
levelSort.push({level:uniqLevels[i],count:counter})
}
console.log('All Uniq Platform:' + arr.length) console.log('All Uniq Platform:' + arr.length)
console.log('All Uniq Date:' + arrDate.length) console.log('All Uniq Date:' + arrDate.length)
console.log(arrDate) console.log(arrDate)
console.log(levelSort)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment