Skip to content

Commit

Permalink
Add debug logs for data loading and processing steps (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeknovy authored Dec 10, 2024
1 parent e914265 commit 5cd23f3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/server/controllers/item/shared/item-data-processing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,40 @@ export const itemDataProcessing = async ({ projectName, scenarioName, itemId })
let rawDataArray = null

try {
logger.debug("Loading overview aggregation")
const aggOverview = await db.one(aggOverviewQuery(itemId))
logger.debug("Loading label aggregation")
const aggLabel = await db.many(aggLabelQuery(itemId))
logger.debug("Loading status code distribution")
const statusCodeDistribution = await db.manyOrNone(responseCodeDistribution(itemId))
logger.debug("Loading response time per label distribution")
const responseTimePerLabelDistribution = await db.manyOrNone(responseTimePerLabelHistogram(itemId))
logger.debug("Loading response failures")
const responseFailures = await db.manyOrNone(responseMessageFailures(itemId))
logger.debug("Loading scenario settings")
const scenarioSettings = await db.one(getScenarioSettings(projectName, scenarioName))

logger.debug("Loading raw downsampled data")
let rawDownsampledData = await db.manyOrNone(getDownsampledRawData(itemId, MAX_SCATTER_CHART_POINTS))
rawDataArray = rawDownsampledData?.map(row => [row.timestamp, row.value])
rawDownsampledData = null

logger.debug("Loading grouped errors")
const groupedErrors = await db.manyOrNone(findGroupedErrors(itemId))
logger.debug("Loading top 5 errors by label")
const top5ErrorsByLabel = await db.manyOrNone(findTop5ErrorsByLabel(itemId))

if (aggOverview.number_of_sut_hostnames > 1) {
logger.debug("Loading SUT overview")
sutMetrics = await db.many(sutOverviewQuery(itemId))
}

if (scenarioSettings.apdexSettings.enabled) {
const { satisfyingThreshold, toleratingThreshold } = scenarioSettings.apdexSettings
logger.debug("Calculating apdex")
apdex = await db.many(calculateApdexValues(itemId,
satisfyingThreshold,
toleratingThreshold))
logger.debug("Updating apdex settings")
await db.none(updateItemApdexSettings(itemId, {
satisfyingThreshold,
toleratingThreshold,
Expand All @@ -92,13 +103,18 @@ export const itemDataProcessing = async ({ projectName, scenarioName, itemId })

// distributed mode
if (aggOverview?.number_of_hostnames > 1) {
logger.debug("Loading distributed threads")
distributedThreads = await db.manyOrNone(distributedThreadsQuery(interval, itemId))
}


logger.debug("Loading label chart")
const labelChart = await db.many(charLabelQuery(interval, itemId))
logger.debug("Loading overview chart")
const overviewChart = await db.many(chartOverviewQuery(interval, itemId))
logger.debug("Loading status code chart")
const statusCodeChart = await db.many(chartOverviewStatusCodesQuery(interval, itemId))
logger.debug("Loading threads per group")
const threadsPerGroup = await db.manyOrNone(threadsPerThreadGroup(interval, itemId))
if (parseInt(index, 10) === 0) { // default interval
chartData = prepareChartDataForSaving(
Expand Down

0 comments on commit 5cd23f3

Please sign in to comment.