Skip to content

Commit

Permalink
fix timestamp bug
Browse files Browse the repository at this point in the history
  • Loading branch information
akvlad committed Aug 21, 2024
1 parent 433173f commit 57351e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyroscope/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ const parseQuery = (query) => {
let strLabels = (match[3] || '').trim()
const labels = []
while (strLabels && strLabels !== '' && strLabels !== '}') {
const m = strLabels.match(/^([,{])\s*([A-Za-z0-9_]+)\s*(!=|!~|=~|=)\s*("([^"\\]|\\.)*")/)
const m = strLabels.match(/^(,)?\s*([A-Za-z0-9_]+)\s*(!=|!~|=~|=)\s*("([^"\\]|\\.)*")/)
if (!m) {
throw new Error('Invalid label selector')
}
Expand Down
4 changes: 2 additions & 2 deletions pyroscope/select_series.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ const selectSeriesImpl = async (fromTimeSec, toTimeSec, payload) => {
typeIdSelector,
serviceNameSelector
)
).groupBy('timestamp_ns', 'fingerprint')
.orderBy(['fingerprint', 'ASC'], ['timestamp_ns', 'ASC'])
).groupBy('timestamp_ms', 'fingerprint')
.orderBy(['fingerprint', 'ASC'], ['timestamp_ms', 'ASC'])
const strMainReq = mainReq.toString()
const chRes = await clickhouse
.rawRequest(strMainReq + ' FORMAT JSON', null, DATABASE_NAME())
Expand Down

0 comments on commit 57351e9

Please sign in to comment.