[jira] [Updated] (PHOENIX-4870) PQS metrics are not being logged when AutoCommit is set to true in LoggingPhoenixConnection

2018-08-28 Thread Swaroopa Kadam (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-4870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Swaroopa Kadam updated PHOENIX-4870:

Attachment: (was: PHOENIX-4870.patch)

> PQS metrics are not being logged when AutoCommit is set to true in 
> LoggingPhoenixConnection
> ---
>
> Key: PHOENIX-4870
> URL: https://issues.apache.org/jira/browse/PHOENIX-4870
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.14.0
>Reporter: Swaroopa Kadam
>Assignee: Swaroopa Kadam
>Priority: Major
> Attachments: PHOENIX-4870-4.x-HBase-1.4.patch, PHOENIX-4870.patch
>
>
> In PQS, when LoggingPhoenixConnection calls commit or close, metrics logs are 
> written properly, however, when LoggingPhoenixConnection is explicitly set 
> with AutoCommit as true, metrics don't get logged at all. This bug can also 
> be tested by adding the following test scenario in 
> PhoenixLoggingMetricsIT.java class. 
> {code:java}
> @Test
> public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
> // Autocommit is turned on explicitly
> loggedConn.setAutoCommit(true);
> //with executeUpdate() method
> // run SELECT to verify read metrics are logged
> String query = "SELECT * FROM " + tableName1;
> verifyQueryLevelMetricsLogging(query);
> // run UPSERT SELECT to verify mutation metrics are logged
> String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
> tableName1;
> loggedConn.createStatement().executeUpdate(upsertSelect);
> // Autocommit is turned on explicitly
> // Hence mutation metrics are expected during implicit commit
> assertTrue("Mutation write metrics are not logged for " + tableName2,
> mutationWriteMetricsMap.size()  > 0);
> assertTrue("Mutation read metrics for not found for " + tableName1,
> mutationReadMetricsMap.get(tableName1).size() > 0);
> //with execute() method
> loggedConn.createStatement().execute(upsertSelect);
> // Autocommit is turned on explicitly
> // Hence mutation metrics are expected during implicit commit
> assertTrue("Mutation write metrics are not logged for " + tableName2,
> mutationWriteMetricsMap.size()  > 0);
> assertTrue("Mutation read metrics for not found for " + tableName1,
> mutationReadMetricsMap.get(tableName1).size() > 0);
> clearAllTestMetricMaps();
> }
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-4870) PQS metrics are not being logged when AutoCommit is set to true in LoggingPhoenixConnection

2018-08-28 Thread Swaroopa Kadam (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-4870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Swaroopa Kadam updated PHOENIX-4870:

Attachment: (was: PHOENIX-4870-4.x-HBase-1.4.patch)

> PQS metrics are not being logged when AutoCommit is set to true in 
> LoggingPhoenixConnection
> ---
>
> Key: PHOENIX-4870
> URL: https://issues.apache.org/jira/browse/PHOENIX-4870
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.14.0
>Reporter: Swaroopa Kadam
>Assignee: Swaroopa Kadam
>Priority: Major
> Attachments: PHOENIX-4870-4.x-HBase-1.4.patch, PHOENIX-4870.patch
>
>
> In PQS, when LoggingPhoenixConnection calls commit or close, metrics logs are 
> written properly, however, when LoggingPhoenixConnection is explicitly set 
> with AutoCommit as true, metrics don't get logged at all. This bug can also 
> be tested by adding the following test scenario in 
> PhoenixLoggingMetricsIT.java class. 
> {code:java}
> @Test
> public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
> // Autocommit is turned on explicitly
> loggedConn.setAutoCommit(true);
> //with executeUpdate() method
> // run SELECT to verify read metrics are logged
> String query = "SELECT * FROM " + tableName1;
> verifyQueryLevelMetricsLogging(query);
> // run UPSERT SELECT to verify mutation metrics are logged
> String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
> tableName1;
> loggedConn.createStatement().executeUpdate(upsertSelect);
> // Autocommit is turned on explicitly
> // Hence mutation metrics are expected during implicit commit
> assertTrue("Mutation write metrics are not logged for " + tableName2,
> mutationWriteMetricsMap.size()  > 0);
> assertTrue("Mutation read metrics for not found for " + tableName1,
> mutationReadMetricsMap.get(tableName1).size() > 0);
> //with execute() method
> loggedConn.createStatement().execute(upsertSelect);
> // Autocommit is turned on explicitly
> // Hence mutation metrics are expected during implicit commit
> assertTrue("Mutation write metrics are not logged for " + tableName2,
> mutationWriteMetricsMap.size()  > 0);
> assertTrue("Mutation read metrics for not found for " + tableName1,
> mutationReadMetricsMap.get(tableName1).size() > 0);
> clearAllTestMetricMaps();
> }
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-4870) PQS metrics are not being logged when AutoCommit is set to true in LoggingPhoenixConnection

2018-08-28 Thread Swaroopa Kadam (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-4870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Swaroopa Kadam updated PHOENIX-4870:

Attachment: PHOENIX-4870-4.x-HBase-1.4.patch
PHOENIX-4870.patch

> PQS metrics are not being logged when AutoCommit is set to true in 
> LoggingPhoenixConnection
> ---
>
> Key: PHOENIX-4870
> URL: https://issues.apache.org/jira/browse/PHOENIX-4870
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.14.0
>Reporter: Swaroopa Kadam
>Assignee: Swaroopa Kadam
>Priority: Major
> Attachments: PHOENIX-4870-4.x-HBase-1.4.patch, PHOENIX-4870.patch
>
>
> In PQS, when LoggingPhoenixConnection calls commit or close, metrics logs are 
> written properly, however, when LoggingPhoenixConnection is explicitly set 
> with AutoCommit as true, metrics don't get logged at all. This bug can also 
> be tested by adding the following test scenario in 
> PhoenixLoggingMetricsIT.java class. 
> {code:java}
> @Test
> public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
> // Autocommit is turned on explicitly
> loggedConn.setAutoCommit(true);
> //with executeUpdate() method
> // run SELECT to verify read metrics are logged
> String query = "SELECT * FROM " + tableName1;
> verifyQueryLevelMetricsLogging(query);
> // run UPSERT SELECT to verify mutation metrics are logged
> String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
> tableName1;
> loggedConn.createStatement().executeUpdate(upsertSelect);
> // Autocommit is turned on explicitly
> // Hence mutation metrics are expected during implicit commit
> assertTrue("Mutation write metrics are not logged for " + tableName2,
> mutationWriteMetricsMap.size()  > 0);
> assertTrue("Mutation read metrics for not found for " + tableName1,
> mutationReadMetricsMap.get(tableName1).size() > 0);
> //with execute() method
> loggedConn.createStatement().execute(upsertSelect);
> // Autocommit is turned on explicitly
> // Hence mutation metrics are expected during implicit commit
> assertTrue("Mutation write metrics are not logged for " + tableName2,
> mutationWriteMetricsMap.size()  > 0);
> assertTrue("Mutation read metrics for not found for " + tableName1,
> mutationReadMetricsMap.get(tableName1).size() > 0);
> clearAllTestMetricMaps();
> }
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (PHOENIX-4870) PQS metrics are not being logged when AutoCommit is set to true in LoggingPhoenixConnection

2018-08-27 Thread Swaroopa Kadam (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-4870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Swaroopa Kadam updated PHOENIX-4870:

Description: 
In PQS, when LoggingPhoenixConnection calls commit or close, metrics logs are 
written properly, however, when LoggingPhoenixConnection is explicitly set with 
AutoCommit as true, metrics don't get logged at all. This bug can also be 
tested by adding the following test scenario in PhoenixLoggingMetricsIT.java 
class. 
{code:java}
@Test
public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
// Autocommit is turned on explicitly
loggedConn.setAutoCommit(true);
//with executeUpdate() method
// run SELECT to verify read metrics are logged
String query = "SELECT * FROM " + tableName1;
verifyQueryLevelMetricsLogging(query);
// run UPSERT SELECT to verify mutation metrics are logged
String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
tableName1;
loggedConn.createStatement().executeUpdate(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);
//with execute() method
loggedConn.createStatement().execute(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);

clearAllTestMetricMaps();
}
{code}
 

  was:
In PQS, when LoggingPhoenixConnection calls commit or close, metrics logs are 
written properly, however, when LoggingPhoenixConnection is explicitly set with 
AutoCommit as true, metrics don't get logged properly. This bug can also be 
tested by adding the following test scenario in PhoenixLoggingMetricsIT.java 
class. 
{code:java}
@Test
public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
// Autocommit is turned on explicitly
loggedConn.setAutoCommit(true);
//with executeUpdate() method
// run SELECT to verify read metrics are logged
String query = "SELECT * FROM " + tableName1;
verifyQueryLevelMetricsLogging(query);
// run UPSERT SELECT to verify mutation metrics are logged
String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
tableName1;
loggedConn.createStatement().executeUpdate(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);
//with execute() method
loggedConn.createStatement().execute(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);

clearAllTestMetricMaps();
}
{code}
 


> PQS metrics are not being logged when AutoCommit is set to true in 
> LoggingPhoenixConnection
> ---
>
> Key: PHOENIX-4870
> URL: https://issues.apache.org/jira/browse/PHOENIX-4870
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.14.0
>Reporter: Swaroopa Kadam
>Assignee: Swaroopa Kadam
>Priority: Major
>
> In PQS, when LoggingPhoenixConnection calls commit or close, metrics logs are 
> written properly, however, when LoggingPhoenixConnection is explicitly set 
> with AutoCommit as true, metrics don't get logged at all. This bug can also 
> be tested by adding the following test scenario in 
> PhoenixLoggingMetricsIT.java class. 
> {code:java}
> @Test
> public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
> // Autocommit is turned on explicitly
> loggedConn.setAutoCommit(true);
> //with executeUpdate() method
> // run SELECT to verify read metrics are logged
> String query = "SELECT * FROM " + tableName1;
> verifyQueryLevelMetricsLogging(query);
> // run UPSERT SELECT to verify mutation metrics are logged
> String 

[jira] [Updated] (PHOENIX-4870) PQS metrics are not being logged when AutoCommit is set to true in LoggingPhoenixConnection

2018-08-27 Thread Swaroopa Kadam (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-4870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Swaroopa Kadam updated PHOENIX-4870:

Description: 
In PQS, when LoggingPhoenixConnection calls commit or close, metrics logs are 
written properly, however, when LoggingPhoenixConnection is explicitly set with 
AutoCommit as true, metrics don't get logged properly. This bug can also be 
tested by adding the following test scenario in PhoenixLoggingMetricsIT.java 
class. 
{code:java}
@Test
public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
// Autocommit is turned on explicitly
loggedConn.setAutoCommit(true);
//with executeUpdate() method
// run SELECT to verify read metrics are logged
String query = "SELECT * FROM " + tableName1;
verifyQueryLevelMetricsLogging(query);
// run UPSERT SELECT to verify mutation metrics are logged
String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
tableName1;
loggedConn.createStatement().executeUpdate(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);
//with execute() method
loggedConn.createStatement().execute(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);

clearAllTestMetricMaps();
}
{code}
 

  was:
In PQS, when LoggingPhoenixConnection is explicitly set with AutoCommit as 
true, metrics dont get logged properly. This can be tested by adding the 
following test scenario in PhoenixLoggingMetricsIT.java class. 
{code:java}
@Test
public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
// Autocommit is turned on explicitly
loggedConn.setAutoCommit(true);
//with executeUpdate() method
// run SELECT to verify read metrics are logged
String query = "SELECT * FROM " + tableName1;
verifyQueryLevelMetricsLogging(query);
// run UPSERT SELECT to verify mutation metrics are logged
String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
tableName1;
loggedConn.createStatement().executeUpdate(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);
//with execute() method
loggedConn.createStatement().execute(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);

clearAllTestMetricMaps();
}
{code}
 


> PQS metrics are not being logged when AutoCommit is set to true in 
> LoggingPhoenixConnection
> ---
>
> Key: PHOENIX-4870
> URL: https://issues.apache.org/jira/browse/PHOENIX-4870
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.14.0
>Reporter: Swaroopa Kadam
>Assignee: Swaroopa Kadam
>Priority: Major
>
> In PQS, when LoggingPhoenixConnection calls commit or close, metrics logs are 
> written properly, however, when LoggingPhoenixConnection is explicitly set 
> with AutoCommit as true, metrics don't get logged properly. This bug can also 
> be tested by adding the following test scenario in 
> PhoenixLoggingMetricsIT.java class. 
> {code:java}
> @Test
> public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
> // Autocommit is turned on explicitly
> loggedConn.setAutoCommit(true);
> //with executeUpdate() method
> // run SELECT to verify read metrics are logged
> String query = "SELECT * FROM " + tableName1;
> verifyQueryLevelMetricsLogging(query);
> // run UPSERT SELECT to verify mutation metrics are logged
> String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
> tableName1;
> 

[jira] [Updated] (PHOENIX-4870) PQS metrics are not being logged when AutoCommit is set to true in LoggingPhoenixConnection

2018-08-27 Thread Swaroopa Kadam (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-4870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Swaroopa Kadam updated PHOENIX-4870:

Description: 
In PQS, when LoggingPhoenixConnection is explicitly set with AutoCommit as 
true, metrics dont get logged properly. This can be tested by adding the 
following test scenario in PhoenixLoggingMetricsIT.java class. 
{code:java}
@Test
public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
// Autocommit is turned on explicitly
loggedConn.setAutoCommit(true);
//with executeUpdate() method
// run SELECT to verify read metrics are logged
String query = "SELECT * FROM " + tableName1;
verifyQueryLevelMetricsLogging(query);
// run UPSERT SELECT to verify mutation metrics are logged
String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
tableName1;
loggedConn.createStatement().executeUpdate(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);
//with execute() method
loggedConn.createStatement().execute(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);

clearAllTestMetricMaps();
}
{code}
 

  was:
In PQS, when LoggingPhoenixConnection is explicitely set with AutoCommit as true
{code:java}
@Test
public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
// Autocommit is turned on explicitly
loggedConn.setAutoCommit(true);
//with executeUpdate() method
// run SELECT to verify read metrics are logged
String query = "SELECT * FROM " + tableName1;
verifyQueryLevelMetricsLogging(query);
// run UPSERT SELECT to verify mutation metrics are logged
String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
tableName1;
loggedConn.createStatement().executeUpdate(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);
//with execute() method
loggedConn.createStatement().execute(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);

clearAllTestMetricMaps();
}
{code}
 


> PQS metrics are not being logged when AutoCommit is set to true in 
> LoggingPhoenixConnection
> ---
>
> Key: PHOENIX-4870
> URL: https://issues.apache.org/jira/browse/PHOENIX-4870
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.14.0
>Reporter: Swaroopa Kadam
>Assignee: Swaroopa Kadam
>Priority: Major
>
> In PQS, when LoggingPhoenixConnection is explicitly set with AutoCommit as 
> true, metrics dont get logged properly. This can be tested by adding the 
> following test scenario in PhoenixLoggingMetricsIT.java class. 
> {code:java}
> @Test
> public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
> // Autocommit is turned on explicitly
> loggedConn.setAutoCommit(true);
> //with executeUpdate() method
> // run SELECT to verify read metrics are logged
> String query = "SELECT * FROM " + tableName1;
> verifyQueryLevelMetricsLogging(query);
> // run UPSERT SELECT to verify mutation metrics are logged
> String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
> tableName1;
> loggedConn.createStatement().executeUpdate(upsertSelect);
> // Autocommit is turned on explicitly
> // Hence mutation metrics are expected during implicit commit
> assertTrue("Mutation write metrics are not logged for " + tableName2,
> mutationWriteMetricsMap.size()  > 0);
> assertTrue("Mutation read metrics for not found for " + tableName1,
>   

[jira] [Updated] (PHOENIX-4870) PQS metrics are not being logged when AutoCommit is set to true in LoggingPhoenixConnection

2018-08-27 Thread Swaroopa Kadam (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-4870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Swaroopa Kadam updated PHOENIX-4870:

Description: 
In PQS, when c
{code:java}
@Test
public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
// Autocommit is turned on explicitly
loggedConn.setAutoCommit(true);
//with executeUpdate() method
// run SELECT to verify read metrics are logged
String query = "SELECT * FROM " + tableName1;
verifyQueryLevelMetricsLogging(query);
// run UPSERT SELECT to verify mutation metrics are logged
String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
tableName1;
loggedConn.createStatement().executeUpdate(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);
//with execute() method
loggedConn.createStatement().execute(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);

clearAllTestMetricMaps();
}
{code}
 

  was:
{code:java}
@Test
public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
// Autocommit is turned on explicitly
loggedConn.setAutoCommit(true);
//with executeUpdate() method
// run SELECT to verify read metrics are logged
String query = "SELECT * FROM " + tableName1;
verifyQueryLevelMetricsLogging(query);
// run UPSERT SELECT to verify mutation metrics are logged
String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
tableName1;
loggedConn.createStatement().executeUpdate(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);
//with execute() method
loggedConn.createStatement().execute(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);

clearAllTestMetricMaps();
}
{code}
If we run above test, it fails. 


> PQS metrics are not being logged when AutoCommit is set to true in 
> LoggingPhoenixConnection
> ---
>
> Key: PHOENIX-4870
> URL: https://issues.apache.org/jira/browse/PHOENIX-4870
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.14.0
>Reporter: Swaroopa Kadam
>Assignee: Swaroopa Kadam
>Priority: Major
>
> In PQS, when c
> {code:java}
> @Test
> public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
> // Autocommit is turned on explicitly
> loggedConn.setAutoCommit(true);
> //with executeUpdate() method
> // run SELECT to verify read metrics are logged
> String query = "SELECT * FROM " + tableName1;
> verifyQueryLevelMetricsLogging(query);
> // run UPSERT SELECT to verify mutation metrics are logged
> String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
> tableName1;
> loggedConn.createStatement().executeUpdate(upsertSelect);
> // Autocommit is turned on explicitly
> // Hence mutation metrics are expected during implicit commit
> assertTrue("Mutation write metrics are not logged for " + tableName2,
> mutationWriteMetricsMap.size()  > 0);
> assertTrue("Mutation read metrics for not found for " + tableName1,
> mutationReadMetricsMap.get(tableName1).size() > 0);
> //with execute() method
> loggedConn.createStatement().execute(upsertSelect);
> // Autocommit is turned on explicitly
> // Hence mutation metrics are expected during implicit commit
> assertTrue("Mutation write metrics are not logged for " + tableName2,
> mutationWriteMetricsMap.size()  > 0);
> assertTrue("Mutation read metrics for not found for " + 

[jira] [Updated] (PHOENIX-4870) PQS metrics are not being logged when AutoCommit is set to true in LoggingPhoenixConnection

2018-08-27 Thread Swaroopa Kadam (JIRA)


 [ 
https://issues.apache.org/jira/browse/PHOENIX-4870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Swaroopa Kadam updated PHOENIX-4870:

Description: 
In PQS, when LoggingPhoenixConnection is explicitely set with AutoCommit as true
{code:java}
@Test
public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
// Autocommit is turned on explicitly
loggedConn.setAutoCommit(true);
//with executeUpdate() method
// run SELECT to verify read metrics are logged
String query = "SELECT * FROM " + tableName1;
verifyQueryLevelMetricsLogging(query);
// run UPSERT SELECT to verify mutation metrics are logged
String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
tableName1;
loggedConn.createStatement().executeUpdate(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);
//with execute() method
loggedConn.createStatement().execute(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);

clearAllTestMetricMaps();
}
{code}
 

  was:
In PQS, when c
{code:java}
@Test
public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
// Autocommit is turned on explicitly
loggedConn.setAutoCommit(true);
//with executeUpdate() method
// run SELECT to verify read metrics are logged
String query = "SELECT * FROM " + tableName1;
verifyQueryLevelMetricsLogging(query);
// run UPSERT SELECT to verify mutation metrics are logged
String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
tableName1;
loggedConn.createStatement().executeUpdate(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);
//with execute() method
loggedConn.createStatement().execute(upsertSelect);
// Autocommit is turned on explicitly
// Hence mutation metrics are expected during implicit commit
assertTrue("Mutation write metrics are not logged for " + tableName2,
mutationWriteMetricsMap.size()  > 0);
assertTrue("Mutation read metrics for not found for " + tableName1,
mutationReadMetricsMap.get(tableName1).size() > 0);

clearAllTestMetricMaps();
}
{code}
 


> PQS metrics are not being logged when AutoCommit is set to true in 
> LoggingPhoenixConnection
> ---
>
> Key: PHOENIX-4870
> URL: https://issues.apache.org/jira/browse/PHOENIX-4870
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.14.0
>Reporter: Swaroopa Kadam
>Assignee: Swaroopa Kadam
>Priority: Major
>
> In PQS, when LoggingPhoenixConnection is explicitely set with AutoCommit as 
> true
> {code:java}
> @Test
> public void testPhoenixMetricsLoggedOnAutoCommit() throws Exception {
> // Autocommit is turned on explicitly
> loggedConn.setAutoCommit(true);
> //with executeUpdate() method
> // run SELECT to verify read metrics are logged
> String query = "SELECT * FROM " + tableName1;
> verifyQueryLevelMetricsLogging(query);
> // run UPSERT SELECT to verify mutation metrics are logged
> String upsertSelect = "UPSERT INTO " + tableName2 + " SELECT * FROM " + 
> tableName1;
> loggedConn.createStatement().executeUpdate(upsertSelect);
> // Autocommit is turned on explicitly
> // Hence mutation metrics are expected during implicit commit
> assertTrue("Mutation write metrics are not logged for " + tableName2,
> mutationWriteMetricsMap.size()  > 0);
> assertTrue("Mutation read metrics for not found for " + tableName1,
> mutationReadMetricsMap.get(tableName1).size() > 0);
> //with execute() method
> loggedConn.createStatement().execute(upsertSelect);
> // Autocommit is turned on explicitly
> // Hence mutation metrics are expected during implicit commit
> assertTrue("Mutation write metrics are not logged for " + tableName2,
>