Skip to content

Commit

Permalink
feat: change search index in Cost Model
Browse files Browse the repository at this point in the history
  • Loading branch information
stat-kwon committed Jan 24, 2025
1 parent f3727c4 commit 235f5fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/spaceone/cost_analysis/manager/cost_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ def analyze_costs(self, query, domain_id, target="SECONDARY_PREFERRED"):
_LOGGER.debug(f"[analyze_costs] query: {query}")

query = self._change_filter_project_group_id(query, domain_id)
query["hint"] = "COMPOUND_INDEX_FOR_SEARCH"
return self.cost_model.analyze(**query)

def analyze_monthly_costs(self, query, domain_id, target="SECONDARY_PREFERRED"):
Expand Down
3 changes: 2 additions & 1 deletion src/spaceone/cost_analysis/model/cost_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ class Cost(MongoModel):
"fields": [
"domain_id",
"data_source_id",
"-billed_date",
"workspace_id",
"project_id",
"product",
"-billed_date",
"cost",
],
"name": "COMPOUND_INDEX_FOR_SEARCH",
Expand Down

0 comments on commit 235f5fe

Please sign in to comment.