mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
remove profiling logger messages
This commit is contained in:
parent
1df250620b
commit
14300dc9b6
@ -37,22 +37,12 @@ export class BalanceResolver {
|
||||
balanceGDT = context.balanceGDT
|
||||
}
|
||||
|
||||
logger.info(`time for load gdt balance: ${new Date().getTime() - now.getTime()} ms`)
|
||||
let profilingTime = new Date()
|
||||
|
||||
logger.debug(`balanceGDT=${context.balanceGDT}`)
|
||||
|
||||
const lastTransaction = context.lastTransaction
|
||||
? context.lastTransaction
|
||||
: await getLastTransaction(user.id)
|
||||
|
||||
logger.info(
|
||||
`time for load lastTransaction from db (if not already done): ${
|
||||
new Date().getTime() - profilingTime.getTime()
|
||||
} ms`,
|
||||
)
|
||||
profilingTime = new Date()
|
||||
|
||||
logger.debug(`lastTransaction=${lastTransaction}`)
|
||||
|
||||
// No balance found
|
||||
@ -73,11 +63,6 @@ export class BalanceResolver {
|
||||
|
||||
logger.debug(`transactionCount=${count}`)
|
||||
|
||||
logger.info(
|
||||
`time for count transaction in db: ${new Date().getTime() - profilingTime.getTime()} ms`,
|
||||
)
|
||||
profilingTime = new Date()
|
||||
|
||||
const linkCount = await dbTransactionLink.count({
|
||||
where: {
|
||||
userId: user.id,
|
||||
@ -87,13 +72,6 @@ export class BalanceResolver {
|
||||
})
|
||||
logger.debug(`linkCount=${linkCount}`)
|
||||
|
||||
logger.info(
|
||||
`time for count transaction links in db: ${
|
||||
new Date().getTime() - profilingTime.getTime()
|
||||
} ms`,
|
||||
)
|
||||
profilingTime = new Date()
|
||||
|
||||
// The decay is always calculated on the last booked transaction
|
||||
const calculatedDecay = calculateDecay(
|
||||
lastTransaction.balance,
|
||||
@ -112,13 +90,6 @@ export class BalanceResolver {
|
||||
? { sumHoldAvailableAmount: context.sumHoldAvailableAmount }
|
||||
: await transactionLinkSummary(user.id, now)
|
||||
|
||||
logger.info(
|
||||
`time for load transactionLinkSummary from db (if not already done): ${
|
||||
new Date().getTime() - profilingTime.getTime()
|
||||
} ms`,
|
||||
)
|
||||
profilingTime = new Date()
|
||||
|
||||
logger.debug(`context.sumHoldAvailableAmount=${context.sumHoldAvailableAmount}`)
|
||||
logger.debug(`sumHoldAvailableAmount=${sumHoldAvailableAmount}`)
|
||||
|
||||
|
||||
@ -237,8 +237,6 @@ export class TransactionResolver {
|
||||
const lastTransaction = await getLastTransaction(user.id)
|
||||
logger.debug(`lastTransaction=${lastTransaction}`)
|
||||
|
||||
logger.info(`time for get last transaction: ${new Date().getTime() - now.getTime()} ms`)
|
||||
|
||||
const balanceResolver = new BalanceResolver()
|
||||
context.lastTransaction = lastTransaction
|
||||
|
||||
@ -257,8 +255,6 @@ export class TransactionResolver {
|
||||
order,
|
||||
)
|
||||
context.transactionCount = userTransactionsCount
|
||||
let profilingTime = new Date()
|
||||
logger.info(`time for getTransactionList: ${profilingTime.getTime() - now.getTime()} ms`)
|
||||
|
||||
// find involved users; I am involved
|
||||
const involvedUserIds: number[] = [user.id]
|
||||
@ -311,14 +307,7 @@ export class TransactionResolver {
|
||||
}
|
||||
}
|
||||
logger.debug(`involvedUserIds=`, involvedUserIds)
|
||||
logger.debug(`involvedRemoteUsers=`, involvedRemoteUsers)
|
||||
|
||||
logger.info(
|
||||
`time for collect involved user and load remote user: ${
|
||||
new Date().getTime() - profilingTime.getTime()
|
||||
} ms`,
|
||||
)
|
||||
profilingTime = new Date()
|
||||
logger.debug(`involvedRemoteUsers=`, involvedRemoteUsers)
|
||||
|
||||
// We need to show the name for deleted users for old transactions
|
||||
const involvedDbUsers = await dbUser.find({
|
||||
@ -328,24 +317,13 @@ export class TransactionResolver {
|
||||
})
|
||||
const involvedUsers = involvedDbUsers.map((u) => new User(u))
|
||||
logger.debug(`involvedUsers=`, involvedUsers)
|
||||
logger.info(
|
||||
`time for load involved user from db: ${new Date().getTime() - profilingTime.getTime()} ms`,
|
||||
)
|
||||
profilingTime = new Date()
|
||||
|
||||
|
||||
const self = new User(user)
|
||||
const transactions: Transaction[] = []
|
||||
|
||||
const { sumHoldAvailableAmount, sumAmount, lastDate, firstDate, transactionLinkcount } =
|
||||
await transactionLinkSummary(user.id, now)
|
||||
|
||||
logger.debug(
|
||||
`time for load transactionLinkSummary db: ${
|
||||
new Date().getTime() - profilingTime.getTime()
|
||||
} ms`,
|
||||
)
|
||||
profilingTime = new Date()
|
||||
|
||||
context.linkCount = transactionLinkcount
|
||||
logger.debug(`transactionLinkcount=${transactionLinkcount}`)
|
||||
context.sumHoldAvailableAmount = sumHoldAvailableAmount
|
||||
@ -440,12 +418,6 @@ export class TransactionResolver {
|
||||
).toDecimalPlaces(2, Decimal.ROUND_HALF_UP)
|
||||
}
|
||||
})
|
||||
logger.info(
|
||||
`time for process transaction list and fill in decay db: ${
|
||||
new Date().getTime() - profilingTime.getTime()
|
||||
} ms`,
|
||||
)
|
||||
profilingTime = new Date()
|
||||
const balanceGDT = await balanceGDTPromise
|
||||
context.balanceGDT = balanceGDT
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user