Skip to content

Commit

Permalink
Issue #12: use the nanoseconds instead
Browse files Browse the repository at this point in the history
  • Loading branch information
idrissneumann committed Nov 23, 2023
1 parent 0b9b6a4 commit e2264b8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions build_and_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
npm install
npm run build
mage -v
go test -v ./pkg/...
docker-compose up --build --force-recreate
7 changes: 7 additions & 0 deletions pkg/quickwit/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ func (c *baseClientImpl) ExecuteMultisearch(r *MultiSearchRequest) (*MultiSearch

c.logger.Debug("Received multisearch response", "code", res.StatusCode, "status", res.Status, "content-length", res.ContentLength)

if res.StatusCode >= 400 {
jsonResponseBody, _ := json.Marshal(res.Body)
jsonQueryParam, _ := json.Marshal(queryParams)
jsonRequestBody, _ := json.Marshal(r.Requests)
c.logger.Error("Error on multisearch: statusCode = " + strconv.Itoa(res.StatusCode) + ", responseBody = " + string(jsonResponseBody) + ", queryParam = " + string(jsonQueryParam) + ", requestBody = " + string(jsonRequestBody))
}

start := time.Now()
c.logger.Debug("Decoding multisearch json response")

Expand Down
5 changes: 2 additions & 3 deletions src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,7 @@ export class QuickwitDataSource

private makeLogContextDataRequest = (row: LogRowModel, options?: LogRowContextOptions) => {
const direction = options?.direction || LogRowContextQueryDirection.Backward;
const searchAfterNs = row.dataFrame.fields.find((f) => f.name === 'sort')?.values.get(row.rowIndex) ?? [row.timeEpochNs]
const searchAfterMs = [Math.round(searchAfterNs[0]/1000000)]
const searchAfter = row.dataFrame.fields.find((f) => f.name === 'sort')?.values.get(row.rowIndex) ?? [row.timeEpochNs]

const logQuery: Logs = {
type: 'logs',
Expand All @@ -445,7 +444,7 @@ export class QuickwitDataSource
// Sorting of results in the context query
sortDirection: direction === LogRowContextQueryDirection.Backward ? 'desc' : 'asc',
// Used to get the next log lines before/after the current log line using sort field of selected log line
searchAfter: searchAfterMs,
searchAfter: searchAfter,
},
};

Expand Down

0 comments on commit e2264b8

Please sign in to comment.