Skip to content

ESQL: Add times to topn status #131555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Jul 18, 2025

Adds times to the TopNOperator status, specifically the nanoseconds spent receiving the values and the nanoseconds spent emitting the values:

          {
            "operator" : "TopNOperator[count=0/1000, elementTypes=[BYTES_REF, DOUBLE], encoders=[UTF8TopNEncoder, DefaultSortable], sortOrders=[SortOrder[channel=1, asc=false, nullsFirst=true]]]",
            "status" : {
              "receive_nanos" : 193415,   <--- this row
              "emit_nanos" : 61,          <--- and this row
              "occupied_rows" : 0,
              "ram_bytes_used" : 4296,
              "ram_used" : "4.1kb",
              "pages_received" : 1,
              "pages_emitted" : 1,
              "rows_received" : 1000,
              "rows_emitted" : 1000
            }
          }

Adds times to the TopNOperator status, specifically the nanoseconds
spent receiving the values and the nanoseconds spent emitting the values:
```
          {
            "operator" : "TopNOperator[count=0/1000, elementTypes=[BYTES_REF, DOUBLE], encoders=[UTF8TopNEncoder, DefaultSortable], sortOrders=[SortOrder[channel=1, asc=false, nullsFirst=true]]]",
            "status" : {
              "receive_nanos" : 193415,   <--- this row
              "emit_nanos" : 61,          <--- and this row
              "occupied_rows" : 0,
              "ram_bytes_used" : 4296,
              "ram_used" : "4.1kb",
              "pages_received" : 1,
              "pages_emitted" : 1,
              "rows_received" : 1000,
              "rows_emitted" : 1000
            }
          }
```
@nik9000 nik9000 requested a review from ivancea July 18, 2025 19:30
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jul 18, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@@ -548,9 +553,11 @@ public Page getOutput() {
if (output == null || output.hasNext() == false) {
return null;
}
long start = System.nanoTime();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should capture the emit time in finish() (toPages) method instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants