-
Notifications
You must be signed in to change notification settings - Fork 79
Divide multi-valued seriesList by another multi-valued seriesList #147
Comments
You can use .es(split=name:10) to get a line for each of the top 10 products. The issue is with the division later on, timelion isn't equipped to do the sort of matrix math in which you get a value for each name, then divide it by a different value for the same name. |
@rashidkpc thanks for response. In kibana with line chart it also not showing correct result. any pointer ?
|
+1 unfortunately I can not use timelion for my usecases without this functionality e.g.: .es(split=id:0).divide(.es(split=id:0, metric=sum:fieldname)) . Thanks for having a serious look guys ;) |
@rashidkpc , i have implemented divideseries function added in timelion series_function folder in local . I didn't spend much time. if you can review it that would be great. This code might not up to standard but we have tight deadline to generate report so.
|
I'd probably suggest implementing this as an option to the divide() function instead of as its own thing. Though it would probably make sense to implement for everything that uses the reduce() helper |
That is good point. I would add to divide() function so it can handle series. any comments on code? |
You might look at how reduce is implemented, that should give you some hints on the path to go down to make it more generalized. Alternatively, you could publish it as a plugin based on the example plugin here: https://github.com/rashidkpc/timelion-random |
yes i changed reduce.js file in my local. i will look into plugin how can be made. Thanks !! |
@tlktoash @leeway23 could this solve your problem? https://github.com/fermiumlabs/mathlion |
Hi i am getting build data from jenkins and dumping into elastic to generate code coverage using awesome timlion plugin for kibana. my document has following data structure . Where product has different module with name. Now want to get code coverage for each module and sum it up for each product. I am using codecoverageline and total line to get right code coverage %. I am using fit(carry) function to carry previous value if build data is not available for module at particular day. I was able to achieve right code coverage % my query look like this . But i have to do this for each modules to get right code coverage for product. Is there any way i can use field: name in query so it group by module name so i don't have to do for each module. Any help or pointer will be really appropriated. I love timlion it's awesome!!
(.es(metric='sum:codecoverageline' q='XXX.Web.Build.R2016').fit(carry).divide(.es(metric='sum:totalline' q='XXX.Web.Build.R2016').fit(carry))).multiply(100)
The text was updated successfully, but these errors were encountered: