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

Make LDMSD support interval strings #1242

Merged
merged 1 commit into from
Jul 30, 2023

Conversation

nichamon
Copy link
Collaborator

The patch makes LDMSD support time-interval strings. A time-interval string is an integer followed by a unit string. A unit string is one of the followings:
us -- microseconds
ms -- milliseconds
s -- seconds
min -- minutes
hr -- hours
day -- days

For example, with this patch, to specify a sampling interval of 1 second, '1s' can be used.

@nichamon
Copy link
Collaborator Author

@nick-enoent Here is the patch that removes check_offset() from ldmsd_communicator.py. Please review the patch. Thanks!

us -- microseconds
ms -- milliseconds
s -- seconds
min -- minutes
Copy link
Collaborator

Choose a reason for hiding this comment

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

'm'
'h'
'd'
seems more concise.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@nichamon Maestro currently supports "m" for minutes as well. It doesn't currently support hours or days, but I can add a quick patch to address this once we land on a final format for minutes/hours/days. I'm in favor of shortening it like @tom95858 suggested, as it lends itself less to typos.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@tom95858 @nick-enoent I changed the minute, hour, and day strings to 'm', 'h', and 'd', respectively. Also, the patch supports floats, e.g., '1.5s' as in Maestro.

@tom95858
Copy link
Collaborator

@nichamon, @nick-enoent can we make sure whatever these strings are they need to be match what maestro uses.

@nichamon
Copy link
Collaborator Author

@nichamon, @nick-enoent can we make sure whatever these strings are they need to be match what maestro uses.

@tom95858 After I shorten 'min' to 'm', the strings in this patch will be the same as in Maestro. However, there are 2 main differences:

  1. Maestro supports floats as an interval but my patch does not. You can give '1.5s' in Maestro but you need to give '1500ms' in ldmsd_controller. I'll update my patch to support floats.
  1. My patch supports more time units, i.e., nanosecond (n), h (hour), and d (day).

I will update the patch during the weekend.

@tom95858
Copy link
Collaborator

@nichamon The only one I think is unreasonable is nano-second.

Copy link
Collaborator

@nick-enoent nick-enoent left a comment

Choose a reason for hiding this comment

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

@nichamon This patch works just fine with maestro currently, aside from the "m" vs "min" format for minutes.

@nichamon nichamon force-pushed the support-interval-string branch 3 times, most recently from a38b0c8 to ea35794 Compare July 29, 2023 14:28
The patch makes LDMSD support time-interval strings. A time-interval
string is a float followed by a unit string. A unit string is one of
the followings:
  us -- microseconds
  ms -- milliseconds
  s  -- seconds
  m  -- minutes
  h  -- hours
  d  -- days

For example, with this patch, '1s', '1.5s', and '100'ms' can be used.
@nichamon
Copy link
Collaborator Author

@tom95858 Per your request in #1240 (comment), I'll add this patch on top of #1240 and close this pull request when we think this patch is good .

@tom95858
Copy link
Collaborator

@nichamon, @nick-enoent is this patch ready to go?

@@ -204,17 +204,6 @@
'auth_add': {'req_attr': ['name', 'plugin'], 'opt_attr': []},
}

def check_offset(interval_us, offset_us=None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did we decide that this check was no longer necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • The main reason is that LDMSD also checks the offset value.
  • With the patch, LDMSD converts interval strings to microseconds, so we don't have to duplicate the code in ldmsctl, ldmsd_controller, and the config file parser.
  • If we want to keep the check_offset(), I need to convert interval strings to microseconds before passing the values to check_offset(). I will probably move the conversion and the check logic out from LDMSD and put them in ldmsctl and config file parser, similar to ldmsd_controller.

@tom95858
Copy link
Collaborator

@nichamon, ready to merge?

@nichamon
Copy link
Collaborator Author

@nichamon, ready to merge?

Yes, it is ready.

@tom95858 tom95858 merged commit e3f52ed into ovis-hpc:OVIS-4 Jul 30, 2023
14 checks passed
@nichamon nichamon deleted the support-interval-string branch August 30, 2023 17:45
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.

3 participants