INNER CODE UNIT · JavaScript

profilerStatus

furey/mongodb-lens · mongodb-lens.js:2443

            const profilerStatus = await currentDb.command({ profile: -1 })

            let prevProfileLevel = profilerStatus.was
            let prevSlowMs = profilerStatus.slowms

            await currentDb.command({ profile: 2, slowms: 0 })

            log(`Tool: Monitoring queries for ${duration} seconds…`)

            await new Promise(resolve => setTimeout(resolve, duration * 1000))

            queryStats = await currentDb.collection('system.profile')
              .find({ ns: `${currentDbName}.${collection}`, op: 'query' })
              .sort({ ts: -1 })
              .limit(100)
              .toArray()

            await currentDb.command({ profile: prevProfileLevel, slowms: prevSlowMs })

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…