Skip to content

Commit 065e437

Browse files
committed
cleanup
1 parent 4768595 commit 065e437

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

receiver/oracledbreceiver/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func TestValidateInvalidConfigs(t *testing.T) {
117117

118118
func TestCreateDefaultConfig(t *testing.T) {
119119
cfg := createDefaultConfig().(*Config)
120-
assert.Equal(t, 10*time.Second, cfg.CollectionInterval)
120+
assert.Equal(t, 10*time.Second, cfg.ControllerConfig.CollectionInterval)
121121
}
122122

123123
func TestParseConfig(t *testing.T) {

receiver/oracledbreceiver/scraper.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,6 @@ func (s *oracleScraper) scrapeLogs(ctx context.Context) (plog.Logs, error) {
533533

534534
if s.logsBuilderConfig.Events.DbServerTopQuery.Enabled {
535535
currentCollectionTime := time.Now()
536-
537536
if int(math.Ceil(currentCollectionTime.Sub(s.lastExecutionTimestamp).Seconds())) < int(s.topQueryCollectCfg.CollectionInterval.Seconds()) {
538537
s.logger.Debug("Skipping the collection of top queries because the current time has not yet exceeded the last execution time plus the specified collection interval")
539538
} else {
@@ -626,7 +625,6 @@ func (s *oracleScraper) collectTopNMetricData(ctx context.Context, logs plog.Log
626625
// if cache updates is not equal to rows returned, that indicates there is problem somewhere
627626
s.logger.Debug("Cache update", zap.Int("update-count", cacheUpdates), zap.Int("new-size", s.metricCache.Len()))
628627

629-
s.lastExecutionTimestamp = collectionTime
630628
if len(hits) == 0 {
631629
s.logger.Info("No log records for this scrape")
632630
return errors.Join(errs...)
@@ -685,6 +683,7 @@ func (s *oracleScraper) collectTopNMetricData(ctx context.Context, logs plog.Log
685683
s.logger.Debug("Log records for this scrape", zap.Int("count", hitCount))
686684
}
687685

686+
s.lastExecutionTimestamp = collectionTime
688687
s.lb.Emit(metadata.WithLogsResource(rb.Emit())).ResourceLogs().MoveAndAppendTo(logs.ResourceLogs())
689688

690689
return errors.Join(errs...)

receiver/oracledbreceiver/templates/oracleQueryMetricsAndTextSql.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* otel-collector */ SELECT
2-
SYSDATE,
32
SQL_ID,
43
SQL_FULLTEXT,
54
CHILD_NUMBER,

0 commit comments

Comments
 (0)