Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue:4086823 fix error when no telemetry samples #260

Merged
merged 9 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ufm_log_analyzer_ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

# Install dependencies
pip install -r src/loganalyze/requirements.txt
pip install pylint
pip install pylint==3.2.6

# Run PyLint
pylint --rcfile=src/loganalyze/.pylintrc src/loganalyze
2 changes: 1 addition & 1 deletion plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ disable=missing-function-docstring,
missing-class-docstring,
missing-module-docstring,
too-few-public-methods,
logging-fstring-interpolation
logging-fstring-interpolation,
16 changes: 10 additions & 6 deletions plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def create_analyzer(parsed_args, full_extracted_logs_list,
)

if len(failed_extract) > 0:
log.LOGGER.warning(f"Failed to get some logs - {failed_extract}, skipping them")
log.LOGGER.debug(f"Failed to get some logs - {failed_extract}, skipping them")
logs_regex_csv_handler_list = create_logs_regex_csv_handler_list(
logs_to_work_with
)
Expand Down Expand Up @@ -325,9 +325,12 @@ def create_analyzer(parsed_args, full_extracted_logs_list,
"secondary_",
1000,
"gz")
links_flapping_analyzer = LinkFlappingAnalyzer(second_telemetry_samples,
if len(second_telemetry_samples) > 0:
boazhaim marked this conversation as resolved.
Show resolved Hide resolved
links_flapping_analyzer = LinkFlappingAnalyzer(second_telemetry_samples,
args.destination)
ufm_top_analyzer.add_analyzer(links_flapping_analyzer)
ufm_top_analyzer.add_analyzer(links_flapping_analyzer)
else:
links_flapping_analyzer = None # pylint: disable=invalid-name
end = time.perf_counter()
log.LOGGER.debug(f"Took {end-start:.3f} to load the parsed data")

Expand All @@ -350,10 +353,11 @@ def create_analyzer(parsed_args, full_extracted_logs_list,
text_to_show_in_pdf = f"Used ufm version in console log {used_ufm_version}"
fabric_info = "fabric info:" + os.linesep + str(ibdiagnet_analyzer.get_fabric_size()) \
if ibdiagnet_analyzer else "No Fabric Info found" # pylint: disable=invalid-name
link_flapping = links_flapping_analyzer.get_link_flapping_last_week() \
if links_flapping_analyzer:
link_flapping = links_flapping_analyzer.get_link_flapping_last_week() \
if links_flapping_analyzer else "No link flapping info"
text_to_show_in_pdf += os.linesep + str(fabric_info) + os.linesep + \
"Link Flapping:" + os.linesep + str(link_flapping)
text_to_show_in_pdf += os.linesep + str(fabric_info) + os.linesep + \
"Link Flapping:" + os.linesep + str(link_flapping)

critical_events_burst = event_log_analyzer.get_critical_event_bursts()
critical_events_text = "The minute event_type event count" # pylint: disable=invalid-name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _save_data_based_on_timestamp(
self._images_created.extend(images_list_with_title)
plt.close()

def _save_pivot_data_in_bars( # pylint: disable=# pylint: disable=too-many-arguments
def _save_pivot_data_in_bars( # pylint: disable=too-many-arguments
self, pivoted_data, x_label, y_label, title, legend_title
):
if pivoted_data.empty:
Expand Down