Skip to content

Commit

Permalink
query_step
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Szefler committed Jul 5, 2024
1 parent ee37b98 commit 537f9d7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-prometrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ jobs:
- name: Run Prometrix tests
run: |
sleep 10
python tests/main.py tests/config_github_kind.yaml
1 change: 1 addition & 0 deletions prometrix/models/prometheus_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class PrometheusConfig(BaseModel):
PrometheusApis.LABELS,
PrometheusApis.FLAGS,
]
query_step: str = "5m"


class AWSPrometheusConfig(PrometheusConfig):
Expand Down
5 changes: 1 addition & 4 deletions tests/config_github_kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@ testConfig:
- type: "PrometheusConfig"
params:
url: http://localhost:9090
# headers:
# prometheus_auth:
# prometheus_url_query_string:
# additional_labels:
query_step: "1s"
2 changes: 1 addition & 1 deletion tests/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def run_test(test_type: str, config: PrometheusConfig) -> bool:
query="container_memory_working_set_bytes",
start_time=datetime.now() - timedelta(days=1),
end_time=datetime.now(),
step="5m",
step=config.query_step,
)
formatted_result = PrometheusQueryResult(data=result)
if not check_result_not_empty(formatted_result):
Expand Down

0 comments on commit 537f9d7

Please sign in to comment.