This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MidpointLruCache: | |
def __init__(self, size, oldpercentage): | |
self.size = size | |
self.oldsize = size * oldpercentage / 100 | |
self.youngsize = size * (100 - oldpercentage) / 100 | |
self.youngitems = collections.OrderedDict() | |
self.olditems = collections.OrderedDict() | |
def __call__(self, func): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Events: 658K cycles | |
- 58.75% mysqlbinlog [kernel.kallsyms] [k] _raw_spin_lock ◆ | |
- _raw_spin_lock ▒ | |
- 49.41% dput |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bcc-py | |
# | |
# topwaits Show longest off-cpu waits per-stack | |
# | |
# Copyright 2019 Facebook, Inc. | |
# Copyright 2016 Netflix, Inc. | |
# Licensed under the Apache License, Version 2.0 (the "License") | |
# | |
# 13-Jan-2016 Brendan Gregg Wrote offcpu profiler | |
# 27-Nov-2019 Domas Mituzas Gutted most of profiling part and left stall detector |