-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from robusta-dev/strategy-metric-usage-refact…
…oring Refactor strategy dependancy on metrics
- Loading branch information
Showing
24 changed files
with
518 additions
and
597 deletions.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from abc import ABC, abstractmethod | ||
import datetime | ||
|
||
from robusta_krr.core.abstract.strategies import PodsTimeData | ||
from robusta_krr.core.models.objects import K8sObjectData | ||
|
||
|
||
class BaseMetric(ABC): | ||
""" | ||
This abstraction is done for a future use. | ||
Currently we only scrape metrics from Prometheus, | ||
but in the future we may want to support other metric sources like Datadog, etc. | ||
TODO: When we want to support other metric sources, we should maybe rethink an interface here. | ||
""" | ||
|
||
@abstractmethod | ||
async def load_data( | ||
self, object: K8sObjectData, period: datetime.timedelta, step: datetime.timedelta | ||
) -> PodsTimeData: | ||
... |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .loader import MetricsLoader | ||
from .loader import PrometheusMetricsLoader | ||
from .metrics_service.prometheus_metrics_service import PrometheusDiscovery, PrometheusNotFound | ||
from .prometheus_client import CustomPrometheusConnect, ClusterNotSpecifiedException |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .base_metric import BaseMetricLoader, bind_metric | ||
from .cpu_metric import CPUMetricLoader | ||
from .memory_metric import MemoryMetricLoader | ||
from .cpu import CPULoader, MaxCPULoader, PercentileCPULoader | ||
from .memory import MemoryLoader, MaxMemoryLoader, PercentileMemoryLoader | ||
from .base import PrometheusMetric |
Oops, something went wrong.