From ea1941887705af828a448383d638d9c19c01d4c7 Mon Sep 17 00:00:00 2001 From: akvlad Date: Wed, 25 Sep 2024 23:35:02 +0300 Subject: [PATCH] debug --- pyroscope/pyroscope.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pyroscope/pyroscope.js b/pyroscope/pyroscope.js index 502cff59..e2788b1b 100644 --- a/pyroscope/pyroscope.js +++ b/pyroscope/pyroscope.js @@ -377,13 +377,14 @@ const series = async (req, res) => { `format('{}:{}:{}:{}:{}', (splitByChar(':', type_id) as _parts)[1], ${sampleTypesUnitsFieldName}.1, ${sampleTypesUnitsFieldName}.2, _parts[2], _parts[3])`, specialMatchers.__profile_type__)) } + let specialClauses = null if (clauses.length === 0) { - return Sql.Eq(new Sql.Raw('1'), 1) + specialClauses = Sql.Eq(new Sql.Raw('1'), 1) + } else if (clauses.length === 1) { + specialClauses = clauses[0] + } else { + specialClauses = Sql.And(...clauses) } - if (clauses.length === 1) { - return clauses[0] - } - const specialClauses = Sql.And(...clauses) // const serviceNameSelector = serviceNameSelectorQuery(labelSelector) const idxReq = matcherIdxRequest(labelSelector, specialMatchers, fromTimeSec, toTimeSec)