diff --git a/client_test.go b/client_test.go index b864282..cb2e652 100644 --- a/client_test.go +++ b/client_test.go @@ -46,6 +46,7 @@ func TestDefaultClient(t *testing.T) { assert.Zero(t, res.Stats.WriteOps, "should not have written any bytes") assert.Zero(t, res.Stats.StorageBytesRead, "should not have read from storage") assert.Zero(t, res.Stats.StorageBytesWrite, "should not have written to storage") + assert.Nil(t, res.Stats.ProcessingTimeMs, "should not have processing time ms") }) }) diff --git a/response.go b/response.go index d71134a..b9899f2 100644 --- a/response.go +++ b/response.go @@ -24,6 +24,9 @@ type Stats struct { // StorageBytesWrite is the amount of data written to storage, in bytes. StorageBytesWrite int `json:"storage_bytes_write"` + // ProcessingTimeMs is the amount of time producing the event, only applies to events. + ProcessingTimeMs *int `json:"processing_time_ms,omitempty"` + // Attempts is the number of times the client attempted to run the query. Attempts int `json:"_"` } diff --git a/stream_test.go b/stream_test.go index f38a201..7fd096f 100644 --- a/stream_test.go +++ b/stream_test.go @@ -40,6 +40,7 @@ func TestStreaming(t *testing.T) { err = events.Next(&event) require.NoError(t, err) require.Equal(t, fauna.StatusEvent, event.Type) + require.NotNil(t, event.Stats.ProcessingTimeMs) }) t.Run("Fails on non-streamable values", func(t *testing.T) {