-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: add DfdaemonUpload.sync_host. #929
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: baowj <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #929 +/- ##
==========================================
- Coverage 34.58% 32.33% -2.25%
==========================================
Files 60 60
Lines 9308 9892 +584
==========================================
- Hits 3219 3199 -20
- Misses 6089 6693 +604
|
Signed-off-by: baowj <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add parent selector to resource.
Signed-off-by: baowj <[email protected]>
@@ -176,6 +183,9 @@ pub struct DfdaemonUploadServerHandler { | |||
|
|||
/// persistent_cache_task is the persistent cache task manager. | |||
persistent_cache_task: Arc<persistent_cache_task::PersistentCacheTask>, | |||
|
|||
/// sync_interval is the interval to send host info by sync_host. | |||
sync_interval: Duration, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove sync_interval
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sync_host
requires the parameter sync_interval
to control the refresh interval. Can this parameter be included in the SyncHostRequest
later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove tokio::spawn
.
Signed-off-by: baowj <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many problems. Continue to optimize the code.
Signed-off-by: baowj <[email protected]>
Signed-off-by: baowj <[email protected]>
) -> Result<Response<Self::SyncHostStream>, Status> { | ||
unimplemented!() | ||
/// DEFAULT_INTERFACE_SPEED is the default speed for interfaces. | ||
const DEFAULT_INTERFACE_SPEED: ByteSize = ByteSize::mb(10000 / 8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
const DEFAULT_INTERFACE_SPEED: ByteSize = ByteSize::mb(10000 / 8); | ||
/// FIRST_HOST_INFO_REFRESH_INTERVAL is the interval for the first refresh of the host info | ||
/// when start up. | ||
const FIRST_HOST_INFO_REFRESH_INTERVAL: Duration = Duration::from_millis(100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
/// when start up. | ||
const FIRST_HOST_INFO_REFRESH_INTERVAL: Duration = Duration::from_millis(100); | ||
/// DEFAULT_HOST_INFO_REFRESH_INTERVAL is the default interval for refreshing the host info. | ||
const DEFAULT_HOST_INFO_REFRESH_INTERVAL: Duration = Duration::from_secs(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to 500ms.
/// DEFAULT_HOST_INFO_REFRESH_INTERVAL is the default interval for refreshing the host info. | ||
const DEFAULT_HOST_INFO_REFRESH_INTERVAL: Duration = Duration::from_secs(1); | ||
/// MILLISECONDS_PER_SECOND is the number of milliseconds contained per second. | ||
const MILLISECONDS_PER_SECOND: u64 = 1_000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
/// MILLISECONDS_PER_SECOND is the number of milliseconds contained per second. | ||
const MILLISECONDS_PER_SECOND: u64 = 1_000; | ||
/// BITS_PER_BYTE is the number of bits contained per byte. | ||
const BITS_PER_BYTE: u64 = 8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
Description
DfdaemonUpload.sync_host
to respond forSyncHost
requests.Related Issue
dragonflyoss/dragonfly#3713
Motivation and Context
Screenshots (if appropriate)
Types of changes
Checklist