Skip to content

Commit

Permalink
support ADVANCED_PROFILES_MERGE_LIMIT to limit selectMergeStacktraces
Browse files Browse the repository at this point in the history
  • Loading branch information
akvlad committed Jan 24, 2024
1 parent 8129c1a commit 0954584
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pyroscope/pyroscope.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,12 @@ const selectMergeStacktraces = async (req, res) => {
if (process.env.ADVANCED_PROFILES_MERGE_LIMIT) {
sqlReq.orderBy(['timestamp_ns', 'desc']).limit(parseInt(process.env.ADVANCED_PROFILES_MERGE_LIMIT))
}
const profiles = await clickhouse.rawRequest(sqlReq.toString() + ' FORMAT RowBinary', null, DATABASE_NAME(), {
responseType: 'arraybuffer'
})
const profiles = await clickhouse.rawRequest(sqlReq.toString() + ' FORMAT RowBinary',
null,
DATABASE_NAME(),
{
responseType: 'arraybuffer'
})
const binData = Uint8Array.from(profiles.data)
req.log.debug(`profiles: ${binData.length / 1025} kB`)
require('./pprof-bin/pkg/pprof_bin').init_panic_hook()
Expand Down

0 comments on commit 0954584

Please sign in to comment.