OLD | NEW |
1 # Copyright 2014 The Swarming Authors. All rights reserved. | 1 # Copyright 2014 The LUCI Authors. All rights reserved. |
2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed by the Apache v2.0 license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Generates statistics out of logs. Contains the backend code. | 5 """Generates statistics out of logs. Contains the backend code. |
6 | 6 |
7 It's important to keep logs concise for general performance concerns. Each http | 7 It's important to keep logs concise for general performance concerns. Each http |
8 handler should strive to do only one stats log entry per request. | 8 handler should strive to do only one stats log entry per request. |
9 """ | 9 """ |
10 | 10 |
11 import json | 11 import json |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 class InternalStatsUpdateHandler(webapp2.RequestHandler): | 580 class InternalStatsUpdateHandler(webapp2.RequestHandler): |
581 """Called every few minutes to update statistics.""" | 581 """Called every few minutes to update statistics.""" |
582 @decorators.require_cronjob | 582 @decorators.require_cronjob |
583 def get(self): | 583 def get(self): |
584 self.response.headers['Content-Type'] = 'text/plain' | 584 self.response.headers['Content-Type'] = 'text/plain' |
585 i = STATS_HANDLER.process_next_chunk(stats_framework.TOO_RECENT) | 585 i = STATS_HANDLER.process_next_chunk(stats_framework.TOO_RECENT) |
586 if i is not None: | 586 if i is not None: |
587 msg = 'Processed %d minutes' % i | 587 msg = 'Processed %d minutes' % i |
588 logging.info(msg) | 588 logging.info(msg) |
589 self.response.write(msg) | 589 self.response.write(msg) |
OLD | NEW |