-
Notifications
You must be signed in to change notification settings - Fork 10
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
+10
−4
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
23f2fcb
Update doc to describe parameters (#51)
db1d3c8
Check For SQL Trace
48bdfda
Check For SQL Trace
bb99aba
Check For SQL Trace
b55da32
Sql Trace enabled check
09300ba
Sql Trace enabled check
f63cf13
Sql Trace enabled check
d217bdd
Sql Trace check
171638b
Sql Trace check
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ | |
import static com.instana.dc.rdb.impl.Constants.CACHE_WRITE_RATIO_SCRIPT; | ||
import static com.instana.dc.rdb.impl.Constants.LOCK_WAITS_SCRIPT; | ||
import static com.instana.dc.rdb.impl.Constants.LRU_WRITES_SCRIPT; | ||
import static com.instana.dc.rdb.impl.Constants.DB_SQL_TRACE_ENABLED; | ||
import static com.instana.dc.rdb.impl.informix.InformixUtil.DB_HOST_AND_VERSION_SQL; | ||
|
||
|
||
|
@@ -65,6 +66,8 @@ public class InformixDc extends AbstractDbDc { | |
|
||
private final MetricsCollector metricCollector; | ||
|
||
public boolean sqlTraceEnabled; | ||
|
||
public InformixDc(Map<String, Object> properties, String dbSystem, String dbDriver) throws SQLException { | ||
super(properties, dbSystem, dbDriver); | ||
parseCustomAttributes(properties); | ||
|
@@ -230,6 +233,7 @@ private void scheduleCustomPollRate(int pollInterval, IntervalType intervalType) | |
@SuppressWarnings("unchecked") | ||
private void parseCustomAttributes(Map<String, Object> properties) { | ||
Map<String, Object> customInput = (Map<String, Object>) properties.get("custom.input"); | ||
sqlTraceEnabled = (Boolean)customInput.getOrDefault(DB_SQL_TRACE_ENABLED, false); | ||
debnathbikram marked this conversation as resolved.
Show resolved
Hide resolved
|
||
int sequentialScanCount = (Integer)customInput.getOrDefault("db.sequential.scan.count", 0); | ||
long elapsedTimeFrame = Long.parseLong((customInput.getOrDefault("db.sql.elapsed.timeframe", DEFAULT_ELAPSED_TIME)).toString()); | ||
StringBuilder databaseName = new StringBuilder(Constants.SINGLE_QUOTES + getDbName() + Constants.SINGLE_QUOTES); | ||
|
@@ -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) { | ||
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. it is boolean attribute why do you need |
||
getRawMetric(DB_SQL_COUNT_NAME).setValue((Number) metricCollector.collectMetrics(DB_SQL_COUNT_NAME)); | ||
getRawMetric(DB_SQL_ELAPSED_TIME_NAME).setValue((List<SimpleQueryResult>) metricCollector.collectMetrics(DB_SQL_ELAPSED_TIME_NAME)); | ||
} | ||
getRawMetric(DB_SQL_RATE_NAME).setValue((Number) metricCollector.collectMetrics(DB_SQL_RATE_NAME)); | ||
getRawMetric(DB_TRANSACTION_COUNT_NAME).setValue((Number) metricCollector.collectMetrics(DB_TRANSACTION_COUNT_NAME)); | ||
getRawMetric(DB_TRANSACTION_RATE_NAME).setValue((Number) metricCollector.collectMetrics(DB_TRANSACTION_COUNT_NAME)); | ||
getRawMetric(DB_SQL_ELAPSED_TIME_NAME).setValue((List<SimpleQueryResult>) metricCollector.collectMetrics(DB_SQL_ELAPSED_TIME_NAME)); | ||
} | ||
|
||
private void shortPollingInterval() { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do you need it to be public? I don't see you are using it anywhere outside this class.