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

Performance collection trigger after storage registration #506

Merged
merged 6 commits into from
Mar 19, 2021

Conversation

sushanthakumar
Copy link
Collaborator

What this PR does / why we need it:
This PR addresses performance collection trigger after storage registration
It removes the old performance collection implementation and respective files as the trigger and mechanism are changed

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

Release note:

@codecov
Copy link

codecov bot commented Mar 13, 2021

Codecov Report

Merging #506 (0d98eed) into master (efae333) will increase coverage by 0.83%.
The diff coverage is 96.42%.

@@            Coverage Diff             @@
##           master     #506      +/-   ##
==========================================
+ Coverage   69.06%   69.89%   +0.83%     
==========================================
  Files         122      120       -2     
  Lines        9415     9239     -176     
  Branches     1055     1032      -23     
==========================================
- Hits         6502     6458      -44     
+ Misses       2567     2440     -127     
+ Partials      346      341       -5     
Impacted Files Coverage Δ
delfin/api/v1/router.py 100.00% <ø> (ø)
delfin/common/config.py 94.11% <ø> (+29.00%) ⬆️
delfin/service.py 25.78% <ø> (+0.13%) ⬆️
delfin/task_manager/manager.py 0.00% <0.00%> (ø)
delfin/task_manager/rpcapi.py 61.53% <ø> (+2.91%) ⬆️
delfin/task_manager/tasks/resources.py 82.58% <ø> (+4.95%) ⬆️
delfin/api/v1/storages.py 77.12% <100.00%> (+4.11%) ⬆️
delfin/common/constants.py 100.00% <100.00%> (ø)
delfin/exception.py 98.80% <100.00%> (+0.02%) ⬆️

@mock.patch('delfin.common.config.load_json_file')
def test_delete(self, mock_load_json_file):
req = fakes.HTTPRequest.blank('/storages/fake_id')
mock_load_json_file.return_value = fake_schedular_config
Copy link
Member

Choose a reason for hiding this comment

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

this test need update

Copy link

@AmitRoushan AmitRoushan Mar 13, 2021

Choose a reason for hiding this comment

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

code with scheduler conf is removed. testcase ```test_delete_invalid_schedular_conf```` is deleted

@@ -139,11 +139,6 @@ def main():
'delfin', 'delfin.conf')
copy_files(conf_file_src, conf_file)

# Copy the scheduler_config.json file
Copy link
Member

Choose a reason for hiding this comment

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

Need to remove installer reference , opened #507 in delfin and sodafoundation/installer#426 in installer

Choose a reason for hiding this comment

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

Sure, The current code removal is part of scheduler conf related removal.

capabilities)
except Exception as e:
# Unexpected error occurred, while performance monitoring.
msg = _('Failed to trigger performance monitoring for storage: '
Copy link
Member

Choose a reason for hiding this comment

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

how about changing message like 'Failed to create performance monitoring task for this storage '

Choose a reason for hiding this comment

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

Updated as per suggestion



class Task(object):
DEFAULT_TASK_INTERVAL = 30
Copy link
Member

Choose a reason for hiding this comment

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

move to conf

Choose a reason for hiding this comment

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

Currently the value fetched from Constants for the completion of flow. Agree to move in conf file.
Can take it in upcoming PR of scheduler. Need to add all other configuration for scheduler, and scheduled task.

task = dict()
task.update(storage_id=storage_id)
task.update(args=capabilities.get('resource_metrics'))
task.update(interval=constants.Task.DEFAULT_TASK_INTERVAL)
Copy link
Member

Choose a reason for hiding this comment

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

hope this has to be inn sync with scheduler , better to take from conf file.

Choose a reason for hiding this comment

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

Yes agreed, That's why added as constant. Will fix it in scheduler PR

import socket
from delfin import exception

from apscheduler.schedulers.background import BackgroundScheduler
Copy link
Member

Choose a reason for hiding this comment

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

this import not required

Copy link

@AmitRoushan AmitRoushan Mar 16, 2021

Choose a reason for hiding this comment

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

Removed as per comments. Thanks

LOG.error(e)
raise exception.ConfigNotFound(e)


class Scheduler:
Copy link
Member

Choose a reason for hiding this comment

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

This class can be removed

Copy link

@AmitRoushan AmitRoushan Mar 16, 2021

Choose a reason for hiding this comment

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

Removed as per comment. Thanks

kumarashit
kumarashit previously approved these changes Mar 13, 2021
Copy link
Collaborator

@kumarashit kumarashit left a comment

Choose a reason for hiding this comment

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

LGTM

joseph-v
joseph-v previously approved these changes Mar 13, 2021
Copy link
Collaborator

@joseph-v joseph-v left a comment

Choose a reason for hiding this comment

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

LGTM

delfin/api/v1/storages.py Show resolved Hide resolved
delfin/api/v1/storages.py Outdated Show resolved Hide resolved
delfin/api/v1/storages.py Outdated Show resolved Hide resolved
delfin/api/v1/storages.py Outdated Show resolved Hide resolved
delfin/api/v1/storages.py Show resolved Hide resolved
delfin/task_manager/tasks/resources.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@joseph-v joseph-v left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@wisererik wisererik left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@NajmudheenCT NajmudheenCT left a comment

Choose a reason for hiding this comment

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

LGTM

@wisererik wisererik merged commit b333b23 into sodafoundation:master Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants