Hello Update. I was able to figure this out. Thanks for the initial pointer :) On Mon, Oct 22, 2018 at 10:54 PM Monil Gandhi <mgand...@gmail.com> wrote:
> Hello, > Thanks for the earlier reply. > I am a little confused with documentation and the response from Josh. This > may be my limited knowledge with Phoenix. > > Can I connect to the server with thick client instead of thin for my > server which is running thing client since thick client seems to be running > on PQS? > > Additionally I followed the directions on > https://phoenix.apache.org/server.html and the above linked conversation, > but I am unable to generate any kind of metrics for any queries. Please > note that in this scenario I am running my queries via the think client > installed on PQS > > For a particular query, I am trying to see how many rows are being scanned > and across how many region servers. If there is an easier way, please let > me know > > On Thu, Oct 18, 2018 at 7:00 PM Monil Gandhi <mgand...@gmail.com> wrote: > >> Okay. Will take a look. Thanks >> On Wed, Oct 17, 2018 at 8:28 AM Josh Elser <els...@apache.org> wrote: >> >>> The methods that you are invoking assume that the Phoenix JDBC driver >>> (the java class org.apache.phoenix.jdbc.PhoenixDriver) is in use. It's >>> not, so you get this error. >>> >>> The Phoenix "thick" JDBC driver is what's running inside of the Phoenix >>> Query Server, just not in your local JVM. As such, you need to look at >>> PQS for metrics. >>> >>> You probably want to look at what was done in >>> https://issues.apache.org/jira/browse/PHOENIX-3655. >>> >>> On 10/16/18 2:49 PM, Monil Gandhi wrote: >>> > Hello, >>> > I am trying to collect some metrics on certain queries. Here is the >>> code >>> > that I have >>> > >>> > Properties props =new Properties(); >>> > props.setProperty(QueryServices.COLLECT_REQUEST_LEVEL_METRICS, "true"); >>> > props.setProperty("phoenix.trace.frequency", "always"); >>> > >>> > try (Connection conn = DriverManager.getConnection(url, props)) { >>> > conn.setAutoCommit(true); >>> > >>> > PreparedStatement stmt = conn.prepareStatement(query); >>> > >>> > Map<org.apache.phoenix.monitoring.MetricType, Long> >>> overAllQueryMetrics =null; >>> > Map<String, Map<org.apache.phoenix.monitoring.MetricType, Long>> >>> requestReadMetrics =null; >>> > try (ResultSet rs = stmt.executeQuery()) { >>> > rs.next(); >>> > requestReadMetrics = PhoenixRuntime.getRequestReadMetricInfo(rs); >>> > // log or report metrics as needed >>> > PhoenixRuntime.resetMetrics(rs); >>> > rs.close(); >>> > } >>> > } >>> > >>> > >>> > However, rs.next() throws the following error >>> > java.sql.SQLException: does not implement 'class >>> > org.apache.phoenix.jdbc.PhoenixResultSet' >>> > >>> > I am not sure why the error is happening. Are metrics not supported >>> with >>> > thin client? >>> > >>> > If not how do I get query level metrics? >>> > >>> > Thanks >>> >>