Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Fix support ref (#61)
Browse files Browse the repository at this point in the history
* support jira ref was incorrect
* added support reference link to mmap issues
* updated black dependency
  • Loading branch information
rsds143 authored Apr 26, 2021
1 parent 781a885 commit 094c151
Show file tree
Hide file tree
Showing 23 changed files with 80 additions and 66 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
sperf 0.6.8
-----------
* sperf now links to public support topics for mmap recommendation

sperf 0.6.7
-----------
* ttop can not handle gb rate allocations
Expand Down
2 changes: 1 addition & 1 deletion pysper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""top level module for sperf python port"""
VERSION = "0.6.7"
VERSION = "0.6.8"
2 changes: 1 addition & 1 deletion pysper/bgrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __setdates(self, dt):
self.start = dt

def print_report(self, interval=3600):
""" print bucketized result counts """
"""print bucketized result counts"""
print("bucketgrep version %s" % VERSION)
print("search: '%s'" % self.supplied_regex)
print()
Expand Down
2 changes: 1 addition & 1 deletion pysper/commands/core/bgrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def build(subparsers):


def run(args):
""" run bgrep """
"""run bgrep"""
files = None
if args.files:
files = args.files.split(",")
Expand Down
2 changes: 1 addition & 1 deletion pysper/commands/core/gc.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def build(subparsers):


def run(args):
""" run the gcinspector """
"""run the gcinspector"""
files = None
if args.files:
files = args.files.split(",")
Expand Down
2 changes: 1 addition & 1 deletion pysper/commands/sysbottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def build(subparsers):


def run(args):
""""sysbottle subcommand"""
""" "sysbottle subcommand"""
conf = OrderedDict()
conf["iowait_threshold"] = args.iowait
conf["cpu_threshold"] = args.cpu
Expand Down
12 changes: 6 additions & 6 deletions pysper/core/gcinspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


class GCInspector:
""" GCInspector class """
"""GCInspector class"""

def __init__(self, diag_dir=None, files=None, start=None, end=None):
self.diag_dir = diag_dir
Expand All @@ -46,7 +46,7 @@ def __init__(self, diag_dir=None, files=None, start=None, end=None):
self.end_time = date_parse(end)

def analyze(self):
""" analyze files """
"""analyze files"""
target = None
if self.files:
target = self.files
Expand All @@ -69,7 +69,7 @@ def analyze(self):
self.analyzed = True

def __setdates(self, date, node):
""" track start/end times """
"""track start/end times"""
# global
if not self.start:
self.start = date
Expand All @@ -89,15 +89,15 @@ def __setdates(self, date, node):
self.starts[node] = date

def all_pauses(self):
""" get pauses for all nodes """
"""get pauses for all nodes"""
pauses = OrderedDefaultDict(list)
for pausedata in self.pauses.values():
for time, pause in pausedata.items():
pauses[time].extend(pause)
return pauses

def print_report(self, interval=3600, by_node=False, top=3):
""" print gc report """
"""print gc report"""
print("gcinspector version %s" % VERSION)
print("")
if not self.analyzed:
Expand Down Expand Up @@ -151,7 +151,7 @@ def print_report(self, interval=3600, by_node=False, top=3):
print("")

def __print_gc(self, data):
""" print data to the user, expecting datetime keys and list(int) values """
"""print data to the user, expecting datetime keys and list(int) values"""
print(". <300ms + 301-500ms ! >500ms")
print("-" * 30)
busiest = None
Expand Down
12 changes: 6 additions & 6 deletions pysper/core/slowquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


class SlowQueryParser:
""" parses logs for slow queries """
"""parses logs for slow queries"""

BEGIN = "begin"
begin_match = re.compile(
Expand All @@ -47,7 +47,7 @@ def __init__(self):
self.state = None

def parse(self, logfile):
""" parses a debug log for slow queries """
"""parses a debug log for slow queries"""
ret = OrderedDict()
for line in logfile:
if self.state is None:
Expand Down Expand Up @@ -78,7 +78,7 @@ def parse(self, logfile):


class SlowQueryAnalyzer:
""" analyzes results from parsing slow queries """
"""analyzes results from parsing slow queries"""

def __init__(self, diag_dir, files=None, start=None, end=None):
self.diag_dir = diag_dir
Expand All @@ -98,7 +98,7 @@ def __init__(self, diag_dir, files=None, start=None, end=None):
self.end_time = date_parse(end)

def analyze(self):
""" analyze slow queries """
"""analyze slow queries"""
parser = SlowQueryParser()
target = find_logs(self.diag_dir, "debug.log")
if self.files:
Expand Down Expand Up @@ -128,7 +128,7 @@ def analyze(self):
self.analyzed = True

def print_report(self, command_name, interval=3600, top=3):
""" print the report """
"""print the report"""
if not self.analyzed:
self.analyze()
print("%s version: %s" % (command_name, VERSION))
Expand Down Expand Up @@ -160,7 +160,7 @@ def print_report(self, command_name, interval=3600, top=3):
print("")

def __print_query_times(self, data):
""" print data to the user, expecting datetime keys and list(int) values """
"""print data to the user, expecting datetime keys and list(int) values"""
timings = perc.Stats([q[1] for q in self.queries])
window = timings.percentile(25) - 1
window2 = timings.percentile(50) - 1
Expand Down
30 changes: 15 additions & 15 deletions pysper/core/statuslogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


class Table:
""" represents a dse table """
"""represents a dse table"""

def __init__(self, ops=0, data=0):
self.ops = ops
Expand All @@ -42,7 +42,7 @@ def __repr__(self):


class Node:
""" represents a cassandra/dse node """
"""represents a cassandra/dse node"""

def __init__(self):
self.start = None
Expand All @@ -57,15 +57,15 @@ def __init__(self):
self.dumps_analyzed = 0

def get_busiest_tables(self, by_prop):
""" return busiest tables by_prop (data or ops) """
"""return busiest tables by_prop (data or ops)"""
return sorted(
self.tables.items(),
key=lambda table: getattr(table[1], by_prop),
reverse=True,
)

def longest_tp_name_length(self):
""" find the length of the thread pool with the longest name """
"""find the length of the thread pool with the longest name"""
longest = 0
for stage in self.stages.values():
slen = len(max(stage, key=len))
Expand All @@ -74,7 +74,7 @@ def longest_tp_name_length(self):
return longest

def longest_tp_value_length(self):
""" find the length of the longest value in any threadpool """
"""find the length of the longest value in any threadpool"""
longest = 0
for stage in self.stages.values():
for vals in stage.values():
Expand All @@ -84,12 +84,12 @@ def longest_tp_value_length(self):
return longest

def duration(self):
""" duration this node was analyzed """
"""duration this node was analyzed"""
return self.end - self.start


class Summary:
""" summarizes a group of nodes """
"""summarizes a group of nodes"""

def __init__(self, nodes):
if env.DEBUG:
Expand All @@ -109,7 +109,7 @@ def __init__(self, nodes):
]

def get_busiest_tables(self, by_op):
""" get busiest tables by_op """
"""get busiest tables by_op"""
busiest = []
for name, node in self.nodes.items():
table = next(iter(node.get_busiest_tables(by_op)), None)
Expand All @@ -120,7 +120,7 @@ def get_busiest_tables(self, by_op):
)

def get_busiest_stages(self):
""" get all stages sorted by highest value """
"""get all stages sorted by highest value"""
allstages = []
for name, node in self.nodes.items():
for status, stage in node.stages.items():
Expand All @@ -131,7 +131,7 @@ def get_busiest_stages(self):
return sorted(allstages, key=lambda x: x[3], reverse=True)

def get_stages_in(self, status):
""" return all stages in a given status """
"""return all stages in a given status"""
ret = OrderedDict()
for name, node in self.nodes.items():
for stage in node.stages:
Expand All @@ -140,15 +140,15 @@ def get_stages_in(self, status):
return ret

def get_pauses(self):
""" get all gc pauses """
"""get all gc pauses"""
pauses = []
for node in self.nodes.values():
pauses += node.pauses
return sorted(pauses, reverse=True)


class StatusLogger:
""" status logger """
"""status logger"""

def __init__(
self,
Expand Down Expand Up @@ -181,7 +181,7 @@ def __init__(
self.end = date_parse(end)

def analyze(self):
""" analyze log files """
"""analyze log files"""
if self.analyzed:
return
event_filter = UniqEventPerNodeFilter()
Expand Down Expand Up @@ -282,7 +282,7 @@ def __setdates(self, node, date):
node.start = date

def print_histogram(self):
""" print histogram report, analyzing if necessary """
"""print histogram report, analyzing if necessary"""
self.analyze()
print("%s version: %s" % (self.command_name, VERSION))
print("")
Expand Down Expand Up @@ -391,7 +391,7 @@ def __print_recs(self):
print("* %s (%s)" % (rec, reason))

def print_summary(self):
""" prints a summary report """
"""prints a summary report"""
self.analyze()
summary = Summary(self.nodes)
print("%s version: %s" % (self.command_name, VERSION))
Expand Down
4 changes: 2 additions & 2 deletions pysper/jarcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


class JarCheckParser:
""" class to parse and analyze the jars in the classpath of an outlog """
"""class to parse and analyze the jars in the classpath of an outlog"""

def __init__(self, diag_dir=None, files=None):
self.diag_dir = diag_dir
Expand Down Expand Up @@ -57,7 +57,7 @@ def analyze(self):
self.analyzed = True

def print_report(self, diff_only=False):
""" print the report """
"""print the report"""
if not self.analyzed:
self.analyze()
if not self.files_analyzed:
Expand Down
2 changes: 1 addition & 1 deletion pysper/parser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _default_capture(line):


def read_log(lines, capture_line_func=_default_capture, **extras):
""" parses an iterable set of lines yielding events """
"""parses an iterable set of lines yielding events"""
fields = None
for line in lines:
next_fields = capture_line_func(line)
Expand Down
16 changes: 8 additions & 8 deletions pysper/parser/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


def gc_rules():
""" rules to capture gc """
"""rules to capture gc"""
return (
case("GCInspector"),
rule(
Expand Down Expand Up @@ -106,7 +106,7 @@ def gc_rules():


def solr_rules():
""" rules to capture solr """
"""rules to capture solr"""
return (
case("SolrFilterCache"),
rule(
Expand Down Expand Up @@ -166,7 +166,7 @@ def solr_rules():


def daemon_rules():
""" rules to capture from daemon """
"""rules to capture from daemon"""
return (
case("StorageService"),
rule(
Expand Down Expand Up @@ -249,7 +249,7 @@ def daemon_rules():


def cfs_rules():
""" rules to capture from ColumnFamilyStore """
"""rules to capture from ColumnFamilyStore"""
return (
case("ColumnFamilyStore"),
rule(
Expand Down Expand Up @@ -310,7 +310,7 @@ def cfs_rules():


def memtable_rules():
""" rules to capture from memtable/cfs """
"""rules to capture from memtable/cfs"""
return (
case("Memtable", "ColumnFamilyStore"),
rule(
Expand Down Expand Up @@ -374,7 +374,7 @@ def memtable_rules():


def status_rules():
""" rules to capture from statuslogger """
"""rules to capture from statuslogger"""
return (
case("StatusLogger"),
rule(
Expand Down Expand Up @@ -528,7 +528,7 @@ def status_rules():


def config_rules():
""" rules to capture configs """
"""rules to capture configs"""
return (
case("Config"),
# "Node configuration:[aggregated_request_timeout_in_ms=120000; allocate_tokens_for_keyspace=null; allocate_tokens_for_local_replication_factor=3; write_request_timeout_in_ms=2000]
Expand Down Expand Up @@ -571,7 +571,7 @@ def config_rules():


def dd_rules():
""" rules to capture from database descriptor """
"""rules to capture from database descriptor"""
return (
case("DatabaseDescriptor"),
# 6.x disk access mode
Expand Down
2 changes: 1 addition & 1 deletion pysper/parser/outputlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


def update_message(fields):
""" updates message fields """
"""updates message fields"""
subfields = None
if "source_file" in fields:
subfields = capture_message(fields["source_file"][:-5], fields["message"])
Expand Down
Loading

0 comments on commit 094c151

Please sign in to comment.