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

Add shift operation for profiles to EDSL #830

Closed
camargo opened this issue Mar 30, 2023 · 1 comment · Fixed by #1007
Closed

Add shift operation for profiles to EDSL #830

camargo opened this issue Mar 30, 2023 · 1 comment · Fixed by #1007
Assignees
Labels
constraints Anything related to the constraints domain feature A new feature or feature request

Comments

@camargo
Copy link
Member

camargo commented Mar 30, 2023

In order to do rolling window constraints (i.e. no more than X minutes of this activity in any Y hour window) we need to be able to shift real profiles in time. The pattern will be:

let duration = Spans.ForEachActivity("my activity").accummulatedDuration();
return duration.plus(duration.shiftBy(X).negate()).lessThan(Y);

While we're at it, it can't hurt to allow shifting of discrete profiles too. It would be less used, but still could be helpful and not hard to implement.

@camargo
Copy link
Member Author

camargo commented Jun 8, 2023

@JoelCourtney Just noting for this one we should provide a couple examples in our docs with how to implement some "real world" constraints that require this operator

@camargo camargo added the constraints Anything related to the constraints domain label Jun 20, 2023
@camargo camargo moved this from Todo to In Progress in Aerie Jun 22, 2023
@JoelCourtney JoelCourtney linked a pull request Jun 28, 2023 that will close this issue
3 tasks
@camargo camargo moved this from In Progress to In Review in Aerie Jul 6, 2023
@github-project-automation github-project-automation bot moved this from In Review to Done in Aerie Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
constraints Anything related to the constraints domain feature A new feature or feature request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants