Commit df8c8dda authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent 4ee3c788
var oldJSON = JSON; let t='dynamic param:48.0 base:200 target:1 targetPercentage:true fft 1'
JSON = undefined;
require('./json2');
JSON.stringify = oldJSON.stringify;
let arr=[{hi:1}]
console.log(JSON.stringify(arr, null, 2)) console.log(t.split('targetPercentage:true'))
\ No newline at end of file \ No newline at end of file
...@@ -9,6 +9,7 @@ async function run() { ...@@ -9,6 +9,7 @@ async function run() {
let arr = [] let arr = []
let arrDate = [] let arrDate = []
let levels=[] let levels=[]
let types=[]
for (let i = 0; i < configs.length; i++) { for (let i = 0; i < configs.length; i++) {
...@@ -20,6 +21,7 @@ async function run() { ...@@ -20,6 +21,7 @@ async function run() {
for (let j = 0; j < config.length; j++) { for (let j = 0; j < config.length; j++) {
levels.push(config[j].maxLevel) levels.push(config[j].maxLevel)
types.push(configs[j].type.split('targetPercentage:true')[1])
let dateString = config[j].dateString.split('_') let dateString = config[j].dateString.split('_')
for (let z = 0; z < dateString.length-1; z++) for (let z = 0; z < dateString.length-1; z++)
...@@ -35,8 +37,10 @@ async function run() { ...@@ -35,8 +37,10 @@ async function run() {
arr = _.uniqBy(arr, 'platform'); arr = _.uniqBy(arr, 'platform');
arrDate = _.uniq(arrDate); arrDate = _.uniq(arrDate);
let uniqLevels = _.uniq(levels); let uniqLevels = _.uniq(levels);
let uniqType= _.uniq(types);
arrDate = _.orderBy(arrDate) arrDate = _.orderBy(arrDate)
let levelSort=[] let levelSort=[]
let typeSort=[]
for (let i=0;i<uniqLevels.length;i++) for (let i=0;i<uniqLevels.length;i++)
{ {
let counter=0 let counter=0
...@@ -46,11 +50,21 @@ async function run() { ...@@ -46,11 +50,21 @@ async function run() {
levelSort.push({level:uniqLevels[i],count:counter}) levelSort.push({level:uniqLevels[i],count:counter})
} }
for (let i=0;i<uniqType.length;i++)
{
let counter=0
for (let j=0;j<types.length;j++)
if (uniqType[i] === types[j])
counter++
typeSort.push({type:uniqType[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) console.log(levelSort)
console.log(typeSort)
let maxDiff=0 let maxDiff=0
for (let i=0;i<arrDate.length-1;i++) for (let i=0;i<arrDate.length-1;i++)
{ {
......
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