Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added threshold for each metric #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ tests :
labels:
- "[Jira: PerfScale]"
direction: 0
threshold: 10

- name: apiserverCPU
metricName : containerCPU
Expand All @@ -40,6 +41,7 @@ tests :
labels:
- "[Jira: kube-apiserver]"
direction: 0
threshold: 10

- name: ovnCPU
metricName : containerCPU
Expand All @@ -51,6 +53,7 @@ tests :
labels:
- "[Jira: Networking / ovn-kubernetes]"
direction: 0
threshold: 10

- name: etcdCPU
metricName : containerCPU
Expand All @@ -62,6 +65,7 @@ tests :
labels:
- "[Jira: etcd]"
direction: 0
threshold: 10

- name: etcdDisk
metricName : 99thEtcdDiskBackendCommitDurationSeconds
Expand All @@ -72,6 +76,7 @@ tests :
labels:
- "[Jira: etcd]"
direction: 0
threshold: 10

- name: kubelet
metricName : kubeletCPU
Expand All @@ -82,9 +87,10 @@ tests :
value: cpu
agg_type: avg
direction: 0
threshold: 10

```
**Note**: `direction: 1` specifies to show positive changes, `direction: 0` specifies to show both positive and negative changes while `direction: -1` shows negative changes.
**Note**: `direction: 1` specifies to show positive changes, `direction: 0` specifies to show both positive and negative changes while `direction: -1` shows negative changes. `threshold` is an absolute value, which allows only changepoints greater than a certain percentage to be detected.

## Build Orion
Building Orion is a straightforward process. Follow these commands:
Expand Down
3 changes: 2 additions & 1 deletion pkg/algorithms/edivisive/edivisive.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def _analyze(self):
for metric, changepoint_list in change_points_by_metric.items():
for i in range(len(changepoint_list)-1, -1, -1):
if ((self.metrics_config[metric]["direction"] == 1 and changepoint_list[i].stats.mean_1 > changepoint_list[i].stats.mean_2) or
(self.metrics_config[metric]["direction"] == -1 and changepoint_list[i].stats.mean_1 < changepoint_list[i].stats.mean_2) ):
(self.metrics_config[metric]["direction"] == -1 and changepoint_list[i].stats.mean_1 < changepoint_list[i].stats.mean_2) or
self.metrics_config[metric]["threshold"] > abs((changepoint_list[i].stats.mean_1 - changepoint_list[i].stats.mean_2)/changepoint_list[i].stats.mean_1)*100 ):
del changepoint_list[i]
if [val for li in change_points_by_metric.values() for val in li]:
self.regression_flag=True
Expand Down
3 changes: 2 additions & 1 deletion pkg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_metric_data(

labels = metric.pop("labels", None)
direction = int(metric.pop("direction", 0))

threshold = abs(int(metric.pop("threshold", 0)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how will things go, if 0 is the threshold value? want to document about it?

logger_instance.info("Collecting %s", metric_name)
try:
if "agg" in metric:
Expand All @@ -58,6 +58,7 @@ def get_metric_data(

metric["labels"] = labels
metric["direction"] = direction
metric["threshold"] = threshold
metrics_config[metric_dataframe_name] = metric
dataframe_list.append(metric_df)
logger_instance.debug(metric_df)
Expand Down
Loading