-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add serverStats to BrokerQueryEventListener #14807
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.pinot.spi.trace; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are putting this in the SPI we have to take care of a few things.
|
||
|
||
public class ServerStatsInfo { | ||
private final long _submitRequestTimeMs; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. format (2 spaces) |
||
private final int _requestSentLatencyMs; | ||
private final long _receiveDataTableTimeMs; | ||
private final int _responseSize; | ||
private final int _deserializationTimeMs; | ||
|
||
public ServerStatsInfo(long submitRequestTimeMs, int requestSentLatencyMs, | ||
long receiveDataTableTimeMs, int responseSize, int deserializationTimeMs) { | ||
_submitRequestTimeMs = submitRequestTimeMs; | ||
_requestSentLatencyMs = requestSentLatencyMs; | ||
_receiveDataTableTimeMs = receiveDataTableTimeMs; | ||
_responseSize = responseSize; | ||
_deserializationTimeMs = deserializationTimeMs; | ||
} | ||
|
||
public long getSubmitRequestTimeMs() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MSE also tracks a bunch of server/stage level stats albeit in a different form. I think we should extend this so it can accept Multistage Query stats too. (I meant that we incorporate it somehow.. not necessarily through the same POJO) cc: @gortiz who worked on adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would be great, but unless I'm wrong, all these trace options only support SSE. It is unclear to me how this is being used, and AFAIK StarTree doesn't use this API. |
||
return _submitRequestTimeMs; | ||
} | ||
|
||
public int getRequestSentLatencyMs() { | ||
return _requestSentLatencyMs; | ||
} | ||
|
||
public long getReceiveDataTableTimeMs() { | ||
return _receiveDataTableTimeMs; | ||
} | ||
|
||
public int getResponseSize() { | ||
return _responseSize; | ||
} | ||
|
||
public int getDeserializationTimeMs() { | ||
return _deserializationTimeMs; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.pinot.spi.trace; | ||
|
||
import org.testng.annotations.Test; | ||
|
||
import static org.testng.Assert.assertEquals; | ||
|
||
public class ServerStatsInfoTest { | ||
ServerStatsInfo _serverStatsInfo = new ServerStatsInfo(1, 2, 3, 4, 5); | ||
|
||
@Test | ||
public void testServerStatsInfoValues() { | ||
assertEquals(1, _serverStatsInfo.getSubmitRequestTimeMs()); | ||
assertEquals(2, _serverStatsInfo.getRequestSentLatencyMs()); | ||
assertEquals(3, _serverStatsInfo.getReceiveDataTableTimeMs()); | ||
assertEquals(4, _serverStatsInfo.getResponseSize()); | ||
assertEquals(5, _serverStatsInfo.getDeserializationTimeMs()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is counter-intuitive. Instead of
set
you can doaddToServerStatsMap
?