Skip to content
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

Informix Db: Parameterized Sql Trace via configuration #52

Merged
merged 9 commits into from
Jul 11, 2024

Conversation

vivek-22
Copy link
Collaborator

@vivek-22 vivek-22 commented Jul 8, 2024

A parameter to specify whether SQL Tracing for Informix DB is enabled is added in the Configuration

@vivek-22 vivek-22 marked this pull request as ready for review July 8, 2024 08:49
@vivek-22 vivek-22 requested a review from BikramDebnath1 July 8, 2024 08:49
@@ -33,6 +33,7 @@ instances:
#Time Frame for which you want to get the expensive query. Default value 900 Sec
db.sql.elapsed.timeframe: 900 # Values should be in Seconds
db.sequential.scan.count: 0
db.sql.trace.enabled: 0 # Value should be 0 if the SQL Trace is enabled and 1 when not eneabled.When not specified, SQL Trace is considered to be disabled.
Copy link
Collaborator

Choose a reason for hiding this comment

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

it should be a boolean value.

Suggested change
db.sql.trace.enabled: 0 # Value should be 0 if the SQL Trace is enabled and 1 when not eneabled.When not specified, SQL Trace is considered to be disabled.
db.sql.trace.enabled: false #Default is false. Make it true only if `SqlTrace` is enabled for the DB.

@debnathbikram debnathbikram added the review + merge For review and merge label Jul 8, 2024
@vivek-22 vivek-22 requested a review from debnathbikram July 9, 2024 06:56
@@ -65,6 +66,8 @@ public class InformixDc extends AbstractDbDc {

private final MetricsCollector metricCollector;

public boolean sqlTraceEnabled;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you need it to be public? I don't see you are using it anywhere outside this class.

Suggested change
public boolean sqlTraceEnabled;
private boolean isSqlTraceEnabled;

@@ -289,11 +293,13 @@ private void getallMetrics() {

@SuppressWarnings("unchecked")
private void mediumPollingInterval() {
getRawMetric(DB_SQL_COUNT_NAME).setValue((Number) metricCollector.collectMetrics(DB_SQL_COUNT_NAME));
if(sqlTraceEnabled==true) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

it is boolean attribute why do you need == true

@debnathbikram debnathbikram changed the title Informix trace check Informix Db: Parameterized Sql Trace via configuration Jul 9, 2024
@vivek-22 vivek-22 requested a review from debnathbikram July 10, 2024 09:52
Copy link
Collaborator

@debnathbikram debnathbikram left a comment

Choose a reason for hiding this comment

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

LGTM

@vivek-22 vivek-22 merged commit 5c56f55 into main Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review + merge For review and merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants