chipmunk icon indicating copy to clipboard operation
chipmunk copied to clipboard

Display average and standard deviation for values searched by regular expression

Open Viermusketiere opened this issue 4 years ago • 2 comments

Prerequisites

affected version: 2.22.3

make sure to check this before filing an issue:

  • [X] I checked the documentation and found no answer
  • [X] I checked to make sure that this issue has not already been filed

Describe what you would like to have

What should be added to support your usecase? Display in a sidebar window the calculated values for average and standard deviation of a set of values defined by a regular expression. This could be useful eg when tracing the runtime of different modules where the time per cycle is logged and then compared. This feature would fit together with the graphs to examine received numeric data in detail. To enable a more general solution a setting could be added, that similar to custom search filters, formulas could be entered and saved to enable the user to process the received data to their liking.

Potential Workaround

Do you have an alternative way of achieving what you intend to do? Tried developing a plugin to solve the need for a official feature request but I have no idea of how to access the data returned by a search with a regular expression to calculate the needed values.

More Information

The implementation could follow a plugin style and add a separate tab in the vertical scrollbar to enter mathematic formulas and display the calculated values. A hint on how to access the data throughout a plugin could also solve the problem and lead to plugin which would fulfill my needs.

Viermusketiere avatar Oct 15 '21 10:10 Viermusketiere

@Viermusketiere hello. Thanks much for your request. Sounds interesting. Could you please (to make "picture" completely transparent) post here also an example of logs and output (for sidebar), which you would like to see. Just to see things like you see it.

Tried developing a plugin to solve the need for a official feature request but I have no idea of how to access the data returned by a search with a regular expression to calculate the needed values.

Yeah, it's true, we don't have an API for plugins to access search results.

DmitryAstafyev avatar Oct 15 '21 14:10 DmitryAstafyev

@DmitryAstafyev thanks for the fast reply. I'll try to clarify my request as good as possible.

The logs look like this:

a.cpp:559 Identifier: task1 Duration: 5375
a.cpp:560 Identifier: task2 Duration: 11600
a.cpp:559 Identifier: task1 Duration: 5875
a.cpp:560 Identifier: task2 Duration: 6250
a.cpp:559 Identifier: task1 Duration: 5250
a.cpp:560 Identifier: task3 Duration: 6750
a.cpp:559 Identifier: task3 Duration: 5125
a.cpp:560 Identifier: task3 Duration: 6750
a.cpp:559 Identifier: task3 Duration: 5125
a.cpp:560 Identifier: task1 Duration: 10000

Search term with regular expression for Duration for which the average should be calculated: task1 Duration: ([-+]?[0-9]*.?[0-9]+([eE][-+]?[0-9]+)?)

Returned lines based on searchterm:

a.cpp:559 Identifier: task1 Duration: 5375
a.cpp:559 Identifier: task1 Duration: 5875
a.cpp:559 Identifier: task1 Duration: 5250
a.cpp:560 Identifier: task1 Duration: 10000

Desired result of the calculation:

Average: 6625
Standard deviation: 1963
Variance: 3.851.563

Feature description: The output should be calculated when a search term with a regular expression returning a numeric value is entered. For that a separate window could be added to the sidebar. An additional feature to avoid performance drops could be a checkbox in above mentioned window to enable or disable the automatic calculation of the mathematical values. To keep the feature versatile the addition of custom calculations could be integrated, by allowing the user to add custom formulas eg. via lua scripts or simple loop statements (This feature has the lowest priority but it was worth mentioning).

The overall aim is, that when a set of data is selected in the search output window and a regular expression is sued to mask for a numeric value, the average, standard deviation and eventually variance are automatically calculated and displayed. The search could be started either by manually entering the desired search term or by recalling a saved search term.

I hope this clarifies the request as needed and I am looking forward to seeing this feature in the future.

Viermusketiere avatar Oct 18 '21 06:10 Viermusketiere