logiguard fork: GPUI xdg-activation keyboard-focus serial fix
Some checks failed
Update All Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Triage Project Sync (#84) / Sync triage project (push) Has been cancelled
release_nightly / notify_on_failure (push) Has been cancelled
release_nightly / check_style (push) Has been cancelled
release_nightly / run_tests_windows (push) Has been cancelled
release_nightly / clippy_windows (push) Has been cancelled
release_nightly / bundle_linux_aarch64 (push) Has been cancelled
release_nightly / bundle_linux_x86_64 (push) Has been cancelled
release_nightly / bundle_mac_aarch64 (push) Has been cancelled
release_nightly / bundle_mac_x86_64 (push) Has been cancelled
release_nightly / bundle_windows_aarch64 (push) Has been cancelled
release_nightly / bundle_windows_x86_64 (push) Has been cancelled
release_nightly / build_nix_linux_x86_64 (push) Has been cancelled
release_nightly / build_nix_mac_aarch64 (push) Has been cancelled
release_nightly / update_nightly_tag (push) Has been cancelled
Hotfix Review Monitor / check-hotfix-reviews (push) Has been cancelled
Stale PR Review Reminder / check-stale-prs (push) Has been cancelled
Update Weekly Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Bump collab-staging Tag / update-collab-staging-tag (push) Has been cancelled
compliance_check / scheduled_compliance_check (push) Has been cancelled
Some checks failed
Update All Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Triage Project Sync (#84) / Sync triage project (push) Has been cancelled
release_nightly / notify_on_failure (push) Has been cancelled
release_nightly / check_style (push) Has been cancelled
release_nightly / run_tests_windows (push) Has been cancelled
release_nightly / clippy_windows (push) Has been cancelled
release_nightly / bundle_linux_aarch64 (push) Has been cancelled
release_nightly / bundle_linux_x86_64 (push) Has been cancelled
release_nightly / bundle_mac_aarch64 (push) Has been cancelled
release_nightly / bundle_mac_x86_64 (push) Has been cancelled
release_nightly / bundle_windows_aarch64 (push) Has been cancelled
release_nightly / bundle_windows_x86_64 (push) Has been cancelled
release_nightly / build_nix_linux_x86_64 (push) Has been cancelled
release_nightly / build_nix_mac_aarch64 (push) Has been cancelled
release_nightly / update_nightly_tag (push) Has been cancelled
Hotfix Review Monitor / check-hotfix-reviews (push) Has been cancelled
Stale PR Review Reminder / check-stale-prs (push) Has been cancelled
Update Weekly Top Ranking Issues / update_top_ranking_issues (push) Has been cancelled
Bump collab-staging Tag / update-collab-staging-tag (push) Has been cancelled
compliance_check / scheduled_compliance_check (push) Has been cancelled
Single-commit orphan branch: full zed-industries/zed @ 8c74db0 source tree with a 3-file patch applied (no upstream history). Patch (crates/gpui_linux/src/linux/wayland/): - serial.rs: add SerialKind::KeyboardEnter - client.rs: store wl_keyboard.enter serial; add latest_serial_of() - window.rs: activate() uses keyboard-enter serial (Mutter focus gate) Mutter honors window activation only when the token carries the keyboard- focus serial from wl_keyboard.enter; GPUI used a stale mouse-press serial. See docs/tray-window-focus-wayland.md in logiguard. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
74
script/histogram
Executable file
74
script/histogram
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Required dependencies for this script:
|
||||
#
|
||||
# pandas: For data manipulation and analysis.
|
||||
# matplotlib: For creating static, interactive, and animated visualizations in Python.
|
||||
# seaborn: For making statistical graphics in Python, based on matplotlib.
|
||||
|
||||
# To install these dependencies, use the following pip command:
|
||||
# pip install pandas matplotlib seaborn
|
||||
|
||||
# This script is designed to parse log files for performance measurements and create histograms of these measurements.
|
||||
# It expects log files to contain lines with measurements in the format "measurement: timeunit" where timeunit can be in milliseconds (ms) or microseconds (µs).
|
||||
# Lines that do not contain a colon ':' are skipped.
|
||||
# The script takes one or more file paths as command-line arguments, parses each log file, and then combines the data into a single DataFrame.
|
||||
# It then converts all time measurements into milliseconds, discards the original time and unit columns, and creates histograms for each unique measurement type.
|
||||
# The histograms display the distribution of times for each measurement, separated by log file, and normalized to show density rather than count.
|
||||
# To use this script, run it from the command line with the log file paths as arguments, like so:
|
||||
# python this_script.py log1.txt log2.txt ...
|
||||
# The script will then parse the provided log files and display the histograms for each type of measurement found.
|
||||
|
||||
import pandas as pd
|
||||
import matplotlib.pyplot as plt
|
||||
import seaborn as sns
|
||||
import sys
|
||||
|
||||
def parse_log_file(file_path):
|
||||
data = {'measurement': [], 'time': [], 'unit': [], 'log_file': []}
|
||||
with open(file_path, 'r') as file:
|
||||
for line in file:
|
||||
if ':' not in line:
|
||||
continue
|
||||
|
||||
parts = line.strip().split(': ')
|
||||
if len(parts) != 2:
|
||||
continue
|
||||
|
||||
measurement, time_with_unit = parts[0], parts[1]
|
||||
if 'ms' in time_with_unit:
|
||||
time, unit = time_with_unit[:-2], 'ms'
|
||||
elif 'µs' in time_with_unit:
|
||||
time, unit = time_with_unit[:-2], 'µs'
|
||||
else:
|
||||
# Print an error message if we can't parse the line and then continue with rest.
|
||||
print(f'Error: Invalid time unit in line "{line.strip()}". Skipping.', file=sys.stderr)
|
||||
continue
|
||||
|
||||
data['measurement'].append(measurement)
|
||||
data['time'].append(float(time))
|
||||
data['unit'].append(unit)
|
||||
data['log_file'].append(file_path.split('/')[-1])
|
||||
return pd.DataFrame(data)
|
||||
|
||||
def create_histograms(df, measurement):
|
||||
filtered_df = df[df['measurement'] == measurement]
|
||||
plt.figure(figsize=(12, 6))
|
||||
sns.histplot(data=filtered_df, x='time_ms', hue='log_file', element='step', stat='density', common_norm=False, palette='bright')
|
||||
plt.title(f'Histogram of {measurement}')
|
||||
plt.xlabel('Time (ms)')
|
||||
plt.ylabel('Density')
|
||||
plt.grid(True)
|
||||
plt.xlim(filtered_df['time_ms'].quantile(0.01), filtered_df['time_ms'].quantile(0.99))
|
||||
plt.show()
|
||||
|
||||
|
||||
file_paths = sys.argv[1:]
|
||||
dfs = [parse_log_file(path) for path in file_paths]
|
||||
combined_df = pd.concat(dfs, ignore_index=True)
|
||||
combined_df['time_ms'] = combined_df.apply(lambda row: row['time'] if row['unit'] == 'ms' else row['time'] / 1000, axis=1)
|
||||
combined_df.drop(['time', 'unit'], axis=1, inplace=True)
|
||||
|
||||
measurement_types = combined_df['measurement'].unique()
|
||||
for measurement in measurement_types:
|
||||
create_histograms(combined_df, measurement)
|
||||
Reference in New Issue
Block a user