| OLD | NEW |
| 1 # Copyright 2013 The LUCI Authors. All rights reserved. | 1 # Copyright 2013 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 under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be 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 The first 100mb of logs read is free. It's important to keep logs concise also | 7 The first 100mb of logs read is free. It's important to keep logs concise also |
| 8 for general performance concerns. Each http handler should strive to do only one | 8 for general performance concerns. Each http handler should strive to do only one |
| 9 log entry at info level per request. | 9 log entry at info level per request. |
| 10 """ | 10 """ |
| 11 | 11 |
| 12 import logging | 12 import logging |
| 13 | 13 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 processing. | 147 processing. |
| 148 """ | 148 """ |
| 149 stats_framework.add_entry( | 149 stats_framework.add_entry( |
| 150 '%s; %d; %s' % (_ACTION_NAMES[action], number, where)) | 150 '%s; %d; %s' % (_ACTION_NAMES[action], number, where)) |
| 151 | 151 |
| 152 | 152 |
| 153 def generate_stats(): | 153 def generate_stats(): |
| 154 """Returns the number of minutes processed.""" | 154 """Returns the number of minutes processed.""" |
| 155 return STATS_HANDLER.process_next_chunk(stats_framework.TOO_RECENT) | 155 return STATS_HANDLER.process_next_chunk(stats_framework.TOO_RECENT) |
| 156 | 156 |
| OLD | NEW |