Skip to content

Commit e2264b8

Browse files
committed
Issue #12: use the nanoseconds instead
1 parent 0b9b6a4 commit e2264b8

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

build_and_start.sh

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
npm install
44
npm run build
55
mage -v
6+
go test -v ./pkg/...
67
docker-compose up --build --force-recreate

pkg/quickwit/client/client.go

+7
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,13 @@ func (c *baseClientImpl) ExecuteMultisearch(r *MultiSearchRequest) (*MultiSearch
166166

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

169+
if res.StatusCode >= 400 {
170+
jsonResponseBody, _ := json.Marshal(res.Body)
171+
jsonQueryParam, _ := json.Marshal(queryParams)
172+
jsonRequestBody, _ := json.Marshal(r.Requests)
173+
c.logger.Error("Error on multisearch: statusCode = " + strconv.Itoa(res.StatusCode) + ", responseBody = " + string(jsonResponseBody) + ", queryParam = " + string(jsonQueryParam) + ", requestBody = " + string(jsonRequestBody))
174+
}
175+
169176
start := time.Now()
170177
c.logger.Debug("Decoding multisearch json response")
171178

src/datasource.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,7 @@ export class QuickwitDataSource
434434

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

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

0 commit comments

Comments
 (0)