|
|
|
@@ -74,7 +74,8 @@ const filterFromDailyStats = [
|
|
|
|
|
'.xml',
|
|
|
|
|
'.aspx',
|
|
|
|
|
'/questionDbs/',
|
|
|
|
|
'/chatFiles/'
|
|
|
|
|
'/chatFiles/',
|
|
|
|
|
'rss'
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------
|
|
|
|
@@ -291,9 +292,9 @@ function pCols(cols, rowTitles, colorNames, firstRowColor) {
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------
|
|
|
|
|
printHeader('Daily stats')
|
|
|
|
|
|
|
|
|
|
const dailyStats = readJSON(`${dir}stats/vstats`)
|
|
|
|
|
function preProcessDailyStats(obj) {
|
|
|
|
|
try {
|
|
|
|
|
const dailyStats = readJSON(`${dir}stats/vstats`)
|
|
|
|
|
function preProcessDailyStats(obj) {
|
|
|
|
|
const formatted = Object.keys(obj).reduce((acc, key) => {
|
|
|
|
|
const includes = filterFromDailyStats.some((keyword) => {
|
|
|
|
|
return key.toLowerCase().includes(keyword.toLowerCase())
|
|
|
|
@@ -335,12 +336,12 @@ function preProcessDailyStats(obj) {
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function getDailyStat(day) {
|
|
|
|
|
}
|
|
|
|
|
function getDailyStat(day) {
|
|
|
|
|
return preProcessDailyStats(dailyStats[getDayIndex(day)])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pCols(
|
|
|
|
|
pCols(
|
|
|
|
|
[
|
|
|
|
|
...[...Array(colsToPrint).keys()].map((x) => {
|
|
|
|
|
return getDailyStat(-x)
|
|
|
|
@@ -348,12 +349,16 @@ pCols(
|
|
|
|
|
],
|
|
|
|
|
null,
|
|
|
|
|
true
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
} catch (e) {
|
|
|
|
|
console.error(e)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------
|
|
|
|
|
printHeader('User id test solving')
|
|
|
|
|
const userIdTestSolving = readJSON(`${dir}stats/idvstats`)
|
|
|
|
|
function preProcessUIdTestSolving(obj, minLength) {
|
|
|
|
|
try {
|
|
|
|
|
const userIdTestSolving = readJSON(`${dir}stats/idvstats`)
|
|
|
|
|
function preProcessUIdTestSolving(obj, minLength) {
|
|
|
|
|
if (!obj) {
|
|
|
|
|
return '0'
|
|
|
|
|
}
|
|
|
|
@@ -366,15 +371,15 @@ function preProcessUIdTestSolving(obj, minLength) {
|
|
|
|
|
} else {
|
|
|
|
|
return Object.keys(obj).length.toString()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function getUserIdTestSolving(day) {
|
|
|
|
|
}
|
|
|
|
|
function getUserIdTestSolving(day) {
|
|
|
|
|
return [
|
|
|
|
|
getDayName(day),
|
|
|
|
|
preProcessUIdTestSolving(userIdTestSolving[getDayIndex(day)]),
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pCols(
|
|
|
|
|
pCols(
|
|
|
|
|
[
|
|
|
|
|
...[...Array(colsToPrint).keys()].map((x) => {
|
|
|
|
|
return getUserIdTestSolving(-x)
|
|
|
|
@@ -383,20 +388,24 @@ pCols(
|
|
|
|
|
null,
|
|
|
|
|
false,
|
|
|
|
|
'green'
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
} catch(e) {
|
|
|
|
|
console.error(e)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------
|
|
|
|
|
printHeader('User id requests')
|
|
|
|
|
const clientIdTestSolving = readJSON(`${dir}stats/uvstats`)
|
|
|
|
|
function getUserIdRequests(day) {
|
|
|
|
|
try {
|
|
|
|
|
const clientIdTestSolving = readJSON(`${dir}stats/uvstats`)
|
|
|
|
|
function getUserIdRequests(day) {
|
|
|
|
|
return [
|
|
|
|
|
getDayName(day),
|
|
|
|
|
preProcessUIdTestSolving(clientIdTestSolving[getDayIndex(day)]),
|
|
|
|
|
preProcessUIdTestSolving(clientIdTestSolving[getDayIndex(day)], 5),
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pCols(
|
|
|
|
|
pCols(
|
|
|
|
|
[
|
|
|
|
|
...[...Array(colsToPrint).keys()].map((x) => {
|
|
|
|
|
return getUserIdRequests(-x)
|
|
|
|
@@ -405,20 +414,20 @@ pCols(
|
|
|
|
|
['', 'All', 'More than 5'],
|
|
|
|
|
false,
|
|
|
|
|
'green'
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------
|
|
|
|
|
printHeader('Daily data count')
|
|
|
|
|
const dailyDataCount = readFile(`${dir}stats/dailyDataCount`)
|
|
|
|
|
function getDailyDataCount(count) {
|
|
|
|
|
// ------------------------------------------------------------------------------
|
|
|
|
|
printHeader('Daily data count')
|
|
|
|
|
const dailyDataCount = readFile(`${dir}stats/dailyDataCount`)
|
|
|
|
|
function getDailyDataCount(count) {
|
|
|
|
|
return [...Array(count).keys()].map((x) => {
|
|
|
|
|
return JSON.parse(head(tail(dailyDataCount, x + 1), 1))
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printLastDataCount(getDailyDataCount(colsToPrint))
|
|
|
|
|
printLastDataCount(getDailyDataCount(colsToPrint))
|
|
|
|
|
|
|
|
|
|
function printLastDataCount(data) {
|
|
|
|
|
function printLastDataCount(data) {
|
|
|
|
|
const res = [...Array(colsToPrint).keys()].map((x) => {
|
|
|
|
|
return [getDayName(-x)]
|
|
|
|
|
})
|
|
|
|
@@ -429,10 +438,14 @@ function printLastDataCount(data) {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
pCols(res, ['', 'Users', 'Subjects', 'Questions'], false, 'green')
|
|
|
|
|
}
|
|
|
|
|
} catch(e) {
|
|
|
|
|
console.error(e)
|
|
|
|
|
}
|
|
|
|
|
// ------------------------------------------------------------------------------
|
|
|
|
|
printHeader('Daily script install / update check count')
|
|
|
|
|
function getDailyScriptStat(day) {
|
|
|
|
|
try {
|
|
|
|
|
function getDailyScriptStat(day) {
|
|
|
|
|
const log =
|
|
|
|
|
!day || day === 0
|
|
|
|
|
? readFile(`${dir}stats/vlogs/log`)
|
|
|
|
@@ -446,10 +459,13 @@ function getDailyScriptStat(day) {
|
|
|
|
|
countLinesMatching(log, '?install').toString(),
|
|
|
|
|
countLinesMatching(log, '?up').toString(),
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const installs = [...Array(colsToPrint).keys()].map((x) => {
|
|
|
|
|
const installs = [...Array(colsToPrint).keys()].map((x) => {
|
|
|
|
|
return getDailyScriptStat(-x)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
pCols(installs, ['', 'Installs', 'Updates'], false, 'green')
|
|
|
|
|
pCols(installs, ['', 'Installs', 'Updates'], false, 'green')
|
|
|
|
|
} catch(e) {
|
|
|
|
|
console.error(e)
|
|
|
|
|
}
|
|
|
|
|