Skip to content

Commit

Permalink
Debug es-analyzer: workable workflow type counts (#6206)
Browse files Browse the repository at this point in the history
* handle index name and table name to avoid nil pointer

* delete the offset clause
  • Loading branch information
bowenxia authored Aug 2, 2024
1 parent 196d14b commit a56d386
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
11 changes: 9 additions & 2 deletions service/worker/esanalyzer/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,17 @@ func New(
config *Config,
) *Analyzer {
var mode readMode
var indexName string
var pinotTableName string

if esClient != nil {
mode = ES
indexName = esConfig.Indices[common.VisibilityAppName]
pinotTableName = ""
} else if pinotClient != nil {
mode = Pinot
indexName = ""
pinotTableName = pinotConfig.Table
}

return &Analyzer{
Expand All @@ -134,8 +141,8 @@ func New(
readMode: mode,
logger: logger,
tallyScope: tallyScope,
visibilityIndexName: esConfig.Indices[common.VisibilityAppName],
pinotTableName: pinotConfig.Table,
visibilityIndexName: indexName,
pinotTableName: pinotTableName,
resource: resource,
domainCache: domainCache,
config: config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ AND StartTime > 0
GROUP BY WorkflowType
ORDER BY count
LIMIT 10
OFFSET 0
`, w.analyzer.pinotTableName, domain.GetInfo().ID), nil
}

Expand Down
2 changes: 0 additions & 2 deletions service/worker/esanalyzer/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ WHERE DomainID = '%s'
GROUP BY WorkflowType
ORDER BY count DESC
LIMIT 10
OFFSET 0
`, w.analyzer.pinotTableName, domain.GetInfo().ID), nil
}

Expand All @@ -185,7 +184,6 @@ WHERE DomainID = '%s'
GROUP BY JSON_EXTRACT_SCALAR(Attr, '$.CadenceChangeVersion', 'STRING_ARRAY') AS CadenceChangeVersion
ORDER BY count DESC
LIMIT 10
OFFSET 0
`, w.analyzer.pinotTableName, domain.GetInfo().ID, wfType), nil
}

Expand Down

0 comments on commit a56d386

Please sign in to comment.