My log contain time, user, and response. Response can be either error or success. The code above will display error to success ratio for 10 users. It also handles division by zero. What I want is, I want to include the user only if the count of error for that user is greater than 100. It will be helpful if someone help me to achieve this.
Forget my previous message, it is absolutly not related to your problem ineed. Was just tired.
Anyway for your problem, it might be a bit clunky, but, in the same way you use a if in your division, can't you use one on error count? If inferior to 100 then 0 (or null maybe) else, the actual result?
Could you kindly show me how to do that if else check in my code? I am a beginner and learning these kinds of stuffs, and dont have much idea how to accomplish this
But I think it will take the 10 first user, and then if the condition is not satisfied, it will be null (or try 0). That means that like this, I'm not sure you will still have 10 users to display. You can try it.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.