Skip to content

Commit 820d757

Browse files
committed
Address comments
Signed-off-by: Peng Huo <penghuo@gmail.com>
1 parent ee0d477 commit 820d757

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

core/src/main/java/org/opensearch/sql/monitor/profile/DefaultMetricImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
final class DefaultMetricImpl implements ProfileMetric {
1212

1313
private final String name;
14-
private final LongAdder value = new LongAdder();
14+
private long value = 0;
1515

1616
/**
1717
* Construct a metric with the provided name.
@@ -29,17 +29,17 @@ public String name() {
2929

3030
@Override
3131
public long value() {
32-
return value.sum();
32+
return value;
3333
}
3434

3535
@Override
3636
public void add(long delta) {
37-
value.add(delta);
37+
value += delta;
3838
}
3939

4040
@Override
4141
public void set(long value) {
42-
this.value.reset();
43-
this.value.add(value);
42+
this.value = 0;
43+
add(value);
4444
}
4545
}

docs/user/ppl/interfaces/endpoint.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ calcite:
152152
CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[PROJECT->[name, country, state, month, year, age], FILTER->>($5, 30), LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":10000,"timeout":"1m","query":{"range":{"age":{"from":30,"to":null,"include_lower":false,"include_upper":true,"boost":1.0}}},"_source":{"includes":["name","country","state","month","year","age"],"excludes":[]}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])
153153
```
154154
155-
## Profile
155+
## Profile (Experimental)
156156
157157
You can enable profiling on the PPL endpoint to capture per-stage timings in milliseconds. Profiling is returned only for regular query execution (not explain) and only when using the default `format=jdbc`.
158158

0 commit comments

Comments
 (0)