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

feature: Math expressions #11

Open
Beanow opened this issue May 1, 2024 · 0 comments
Open

feature: Math expressions #11

Beanow opened this issue May 1, 2024 · 0 comments

Comments

@Beanow
Copy link

Beanow commented May 1, 2024

In Grafana, typically the datasources themselves handle math in their respective query languages. Like PromQL or SQL.
Haven't looked around the Go landscape for any packages that might help, but this could add some neat new possibilities.

For example:

  • CompletedLaps + NormalizedCarPosition = Lap progress as a float
  • (BrakeBias - 0.5) * 2.0 = BrakeBias but ranging from -1 to +1
  • max(BrakeTempFL, BrakeTempFR, BrakeTempRL, BrakeTempRR) = The temp of your hottest brake

Doing so with the current values would already be very useful.

Even crazier would be if time ranges could be supported. Something like:

  • max(RPMs[3s]) = The highest RPM of the last 3 seconds. (Useful for "sustaining" the RPM value when you shifted)
  • sum(ABS[0.5s]) = Meaningless number to visualize ABS as an increasing value rather than flickering between 0/1

Note that shows some design challenge in what max and friends are supposed to do or take as arguments.
The one with time ranges is more like PromQL. The current value one closer to Math.max() from JS.

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

No branches or pull requests

1 participant