I need count the times that a webservice is consumed, take this number and save it in the database to generate a report, 
I need an idea of how to do it.
I already investigated but I did not find anything useful
            Asked
            
        
        
            Active
            
        
            Viewed 34 times
        
    0
            
            
        
        Mike
        
- 95
 - 2
 - 13
 
- 
                    Do you mean you want to count how many times your application was requested? – AntonTkachov Nov 08 '17 at 17:26
 - 
                    Do you mean something like [this](https://stackoverflow.com/questions/5295026/is-there-a-super-simple-way-to-record-report-page-views-in-rails-2-3-x)? – William Ardila Nov 08 '17 at 17:42
 - 
                    @AntonTkachov the web service is consumed from movil app, but the web service in provided from a web application – Mike Nov 08 '17 at 18:08
 
1 Answers
0
            Generally you'd want to do something like this in memory as an attribute on a singleton instance. Alternatively you could write to an access logfile or database table and count the entries when you generate a report.
Here's a good writeup on the singleton approach: http://konrad-reiche.com/posts/singleton-active-record-charade.html
        Sean Huber
        
- 3,945
 - 2
 - 26
 - 31