| 35 | |
| 36 | |
| 37 | class CommandHandler(CommandListener): |
| 38 | def started(self, event): |
| 39 | print("command started", event) |
| 40 | |
| 41 | def succeeded(self, event): |
| 42 | global total_commands, total_command_duration |
| 43 | total_commands += 1 |
| 44 | total_command_duration += event.duration_micros / 1e6 |
| 45 | print("command succeeded", event) |
| 46 | |
| 47 | def failed(self, event): |
| 48 | global total_commands, total_command_duration |
| 49 | total_commands += 1 |
| 50 | total_command_duration += event.duration_micros / 1e6 |
| 51 | print("command failed", event) |
| 52 | |
| 53 | |
| 54 | class ServerHeartbeatHandler(ServerHeartbeatListener): |