smui icon indicating copy to clipboard operation
smui copied to clipboard

Rules Usage Report

Open jweiss3034 opened this issue 1 year ago • 0 comments

We have found that if the csv file is generated on windows and has line endings end in \r\n that we receive the following error message

[error] s.RulesUsageService - Could not load rule usage statistics smui | java.lang.IllegalArgumentException: Mapping for SMUI_GUID not found, expected one of [SMUI_GUID, USER_QUERY, FREQUENCY] smui | at org.apache.commons.csv.CSVRecord.get(CSVRecord.java:121) smui | at services.RulesUsageService.$anonfun$getRulesUsageStatistics$3(RulesUsageService.scala:28) smui | at scala.collection.StrictOptimizedIterableOps.map(StrictOptimizedIterableOps.scala:100) smui | at scala.collection.StrictOptimizedIterableOps.map$(StrictOptimizedIterableOps.scala:87) smui | at scala.collection.convert.JavaCollectionWrappers$JIterableWrapper.map(JavaCollectionWrappers.scala:83) smui | at services.RulesUsageService.$anonfun$getRulesUsageStatistics$1(RulesUsageService.scala:26) smui | at scala.Option.map(Option.scala:242) smui | at services.RulesUsageService.getRulesUsageStatistics(RulesUsageService.scala:21) smui | at controllers.ApiController.$anonfun$getRulesUsageReport$1(ApiController.scala:673) smui | at play.api.mvc.ActionBuilder.$anonfun$apply$13(Action.scala:376)

This does not occur if the csv file is generated on a non-windows machine and the line endings end in \n

I have attached a sample file generated on windows to this issue stats-on-rules-usage.csv

jweiss3034 avatar Sep 18 '24 20:09 jweiss3034